|
@@ -1836,6 +1836,11 @@ export const fillWordColor = () => {
|
|
stemEl?.classList.remove('noteActive')
|
|
stemEl?.classList.remove('noteActive')
|
|
// stemLine?.classList.remove('noteActive')
|
|
// stemLine?.classList.remove('noteActive')
|
|
svgEl?.parentElement?.classList.remove('voiceActive')
|
|
svgEl?.parentElement?.classList.remove('voiceActive')
|
|
|
|
+ const si = state.times[prevActiveNoteIndex].si || 0;
|
|
|
|
+ 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 activeNoteId = state.times[state.activeNoteIndex]?.svgElement?.attrs?.id
|
|
const svgEl = document.getElementById(`vf-${activeNoteId}`)
|
|
const svgEl = document.getElementById(`vf-${activeNoteId}`)
|
|
@@ -1849,7 +1854,16 @@ export const fillWordColor = () => {
|
|
// const parentVoice = svgEl?.parentElement;
|
|
// const parentVoice = svgEl?.parentElement;
|
|
// 简谱模式下,二分音符和全音符才显示音符右侧的"-"
|
|
// 简谱模式下,二分音符和全音符才显示音符右侧的"-"
|
|
if (state.times[state.activeNoteIndex].noteElement?.length?.realValue >= 0.5) {
|
|
if (state.times[state.activeNoteIndex].noteElement?.length?.realValue >= 0.5) {
|
|
- svgEl?.parentElement?.classList.add('voiceActive');
|
|
|
|
|
|
+ // 如果是二分音符,只亮该音符后面那个"-",本小节其它的"-"不亮
|
|
|
|
+ if (state.times[state.activeNoteIndex].noteElement?.length?.realValue === 0.5) {
|
|
|
|
+ const si = state.times[state.activeNoteIndex].si || 0;
|
|
|
|
+ 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');
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
prevActiveNoteIndex = state.activeNoteIndex
|
|
prevActiveNoteIndex = state.activeNoteIndex
|