Ver Fonte

fix: bug修改

TIANYONG há 11 meses atrás
pai
commit
05db17278f
1 ficheiros alterados com 7 adições e 2 exclusões
  1. 7 2
      src/helpers/formateMusic.ts

+ 7 - 2
src/helpers/formateMusic.ts

@@ -969,9 +969,13 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
 			// } else {
 			// } else {
 			// 	activeVerticalMeasureList = [note.sourceMeasure?.verticalMeasureList?.[0]] || [];
 			// 	activeVerticalMeasureList = [note.sourceMeasure?.verticalMeasureList?.[0]] || [];
 			// }
 			// }
-			
+			// 合并展示某些分轨,需要把展示的分轨筛选出来
+			if (state.isCombineRender && note.sourceMeasure.verticalMeasureList.length) {
+				note.sourceMeasure.verticalMeasureList = note.sourceMeasure?.verticalMeasureList.filter((item: any) => state.canSelectTracks.includes(item.parentStaff.parentInstrument.Name))
+			}
+
 			activeVerticalMeasureList = [note.sourceMeasure?.verticalMeasureList?.[0]] || [];
 			activeVerticalMeasureList = [note.sourceMeasure?.verticalMeasureList?.[0]] || [];
-			const currenrtVfVoices = activeVerticalMeasureList[0]?.vfVoices['1'] ? activeVerticalMeasureList[0]?.vfVoices['1'] : activeVerticalMeasureList[0]?.vfVoices['2'] ? activeVerticalMeasureList[0]?.vfVoices['2'] : null;
+			let currenrtVfVoices = activeVerticalMeasureList[0]?.vfVoices['1'] ? activeVerticalMeasureList[0]?.vfVoices['1'] : activeVerticalMeasureList[0]?.vfVoices['2'] ? activeVerticalMeasureList[0]?.vfVoices['2'] : null;
 			/**
 			/**
 			 * TODO:多分轨合并的小节,音符可能没有id,此时就去其它分轨找
 			 * TODO:多分轨合并的小节,音符可能没有id,此时就去其它分轨找
 			 */
 			 */
@@ -981,6 +985,7 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
 			while (!hasSvgElement && vmLength > 1 && currentVmIndex <= vmLength - 1) {
 			while (!hasSvgElement && vmLength > 1 && currentVmIndex <= vmLength - 1) {
 				currentVmIndex += 1;
 				currentVmIndex += 1;
 				activeVerticalMeasureList = [note.sourceMeasure?.verticalMeasureList?.[currentVmIndex]] || [];
 				activeVerticalMeasureList = [note.sourceMeasure?.verticalMeasureList?.[currentVmIndex]] || [];
+				currenrtVfVoices = activeVerticalMeasureList[0]?.vfVoices['1'] ? activeVerticalMeasureList[0]?.vfVoices['1'] : activeVerticalMeasureList[0]?.vfVoices['2'] ? activeVerticalMeasureList[0]?.vfVoices['2'] : null;
 				hasSvgElement = currenrtVfVoices?.tickables[staveNoteIndex];
 				hasSvgElement = currenrtVfVoices?.tickables[staveNoteIndex];
 			}
 			}