Browse Source

fix: 简谱音符颜色问题修改

TIANYONG 1 year ago
parent
commit
6710535620
2 changed files with 6 additions and 0 deletions
  1. 3 0
      src/state.ts
  2. 3 0
      src/view/music-score/index.module.less

+ 3 - 0
src/state.ts

@@ -1635,12 +1635,15 @@ export const fillWordColor = () => {
   state.times.forEach((item: any, idx: number) => {
     const svgEl = document.getElementById(`vf-${state.times[idx]?.svgElement?.attrs?.id}`)
     const stemEl = document.getElementById(`vf-${state.times[idx]?.svgElement?.attrs?.id}-stem`)
+    const stemLine = document.getElementById(`vf-${state.times[idx]?.svgElement?.attrs?.id}-lines`)
     if ((item.i === state.activeNoteIndex || item.id === state.times[state.activeNoteIndex].id) && item.svgElement) {
       svgEl?.classList.add('noteActive')
       stemEl?.classList.add('noteActive')
+      stemLine?.classList.add('noteActive')
     } else {
       svgEl?.classList.remove('noteActive')
       stemEl?.classList.remove('noteActive')
+      stemLine?.classList.remove('noteActive')
     }
   })
 

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

@@ -28,6 +28,9 @@
             fill: #FFC121;
             stroke: #FFC121;
         }
+        rect {
+            stroke: #FFC121;
+        }
         transform-box: fill-box;
         transform-origin: center;
         // animation: noteAnimate 0.3s linear;