TIANYONG 11 miesięcy temu
rodzic
commit
e4dc20040a
2 zmienionych plików z 6 dodań i 1 usunięć
  1. 3 1
      src/state.ts
  2. 3 0
      src/view/music-score/index.module.less

+ 3 - 1
src/state.ts

@@ -1713,7 +1713,9 @@ export const fillWordColor = () => {
   const currentLyrics: SVGAElement[] = Array.from(document.querySelectorAll(`.lyric${currentNote?.noteId}`));
   currentLyrics.forEach((lyric, index) => {
     const lyricIndex = lyric.getAttribute('lyricIndex');
-    if ((index === currentNote.repeatIdx && currentNote.repeatIdx + 1 == lyricIndex) || (currentNote.repeatIdx > 0 && currentNote.formatLyricsEntries?.length === 1)) {
+    // bug:#10942,如果需要反复唱的小节,只有一遍歌词,反复唱的时候,歌词都需要高亮
+    const onlyOneLyric = currentNote.measures?.every((item: any) => item?.formatLyricsEntries?.length <= 1);
+    if ((index === currentNote.repeatIdx && currentNote.repeatIdx + 1 == lyricIndex) || (currentNote.repeatIdx != index && !onlyOneLyric && currentNote.repeatIdx + 1 == lyricIndex) || (currentNote.repeatIdx > 0 && currentNote.formatLyricsEntries?.length === 1 && onlyOneLyric)) {
       lyric?.classList.add('lyricActive')
     }
     // if ((index === currentNote.repeatIdx && currentNote.repeatIdx + 1 == lyricIndex)) {

+ 3 - 0
src/view/music-score/index.module.less

@@ -22,6 +22,9 @@
             left: 0;
             top: 0;
         }
+        // #osmdCanvasPage2 {
+        //     display: none;
+        // }
     }
     .noteActive {
         path {