|
@@ -8,6 +8,7 @@ import styles from "./index.module.less";
|
|
|
import queryString from "query-string";
|
|
|
import { getGradualLengthByXml } from "/src/helpers/calcSpeed";
|
|
|
import { resetFormate, resetGivenFormate, setGlobalMusicSheet } from "/src/helpers/customMusicScore"
|
|
|
+import { setGlobalData } from "/src/utils";
|
|
|
|
|
|
export const musicRenderTypeKey = "musicRenderType";
|
|
|
let osmd: any = null;
|
|
@@ -21,7 +22,21 @@ const musicData = reactive({
|
|
|
/** 重新计算曲谱渲染比例 */
|
|
|
export const resetMusicScore = () => {
|
|
|
const contaienrWidth = document.getElementById("musicAndSelection")?.offsetWidth || 625;
|
|
|
- state.musicZoom = contaienrWidth / musicData.containerWidth;
|
|
|
+ // state.musicZoom = contaienrWidth / musicData.containerWidth;
|
|
|
+ if (state.fingeringInfo?.name && state.fingeringInfo?.direction === 'vertical') {
|
|
|
+ if (contaienrWidth > musicData.containerWidth) {
|
|
|
+ setGlobalData('wrapNum', 8)
|
|
|
+ } else {
|
|
|
+ setGlobalData('wrapNum', 6)
|
|
|
+ }
|
|
|
+ musicData.showSelection = false
|
|
|
+ osmd.zoom = state.zoom;
|
|
|
+ osmd.render();
|
|
|
+ setTimeout(() => {
|
|
|
+ musicData.showSelection = true
|
|
|
+ }, 100);
|
|
|
+ }
|
|
|
+
|
|
|
};
|
|
|
|
|
|
/** 重新渲染曲谱 */
|