|
@@ -1837,7 +1837,10 @@ export const fillWordColor = () => {
|
|
|
// stemLine?.classList.remove('noteActive')
|
|
|
svgEl?.parentElement?.classList.remove('voiceActive')
|
|
|
const si = state.times[prevActiveNoteIndex].si || 0;
|
|
|
- svgEl?.parentElement?.querySelectorAll('rect')?.[si]?.classList.remove('rectActive');
|
|
|
+ svgEl?.parentElement?.querySelectorAll('rect')?.forEach((item: any) => {
|
|
|
+ item?.classList.remove('rectActive');
|
|
|
+ })
|
|
|
+ // svgEl?.parentElement?.querySelectorAll('rect')?.[si]?.classList.remove('rectActive');
|
|
|
}
|
|
|
const activeNoteId = state.times[state.activeNoteIndex]?.svgElement?.attrs?.id
|
|
|
const svgEl = document.getElementById(`vf-${activeNoteId}`)
|
|
@@ -1854,7 +1857,10 @@ export const fillWordColor = () => {
|
|
|
// 如果是二分音符,只亮该音符后面那个"-",本小节其它的"-"不亮
|
|
|
if (state.times[state.activeNoteIndex].noteElement?.length?.realValue === 0.5) {
|
|
|
const si = state.times[state.activeNoteIndex].si || 0;
|
|
|
- svgEl?.parentElement?.querySelectorAll('rect')[si].classList.add('rectActive');
|
|
|
+ const halfNotes = state.times[state.activeNoteIndex].measures.filter((item: any) => item?.noteElement?.length?.realValue === 0.5) || [];
|
|
|
+ const sIdx = halfNotes.findIndex((item: any) => item.noteElement === state.times[state.activeNoteIndex].noteElement);
|
|
|
+ const filterRects = svgEl?.parentElement?.querySelectorAll('rect')?.length ? Array.from(svgEl?.parentElement?.querySelectorAll('rect')).filter(item => item.parentElement === svgEl?.parentElement) : [];
|
|
|
+ filterRects?.[sIdx]?.classList.add('rectActive');
|
|
|
} else {
|
|
|
svgEl?.parentElement?.classList.add('voiceActive');
|
|
|
}
|