|
@@ -347,11 +347,10 @@ const setCursorPosition = (note: any, cursor: any) => {
|
|
|
state.musicRenderType === EnumMusicRenderType.fixedTone
|
|
|
) {
|
|
|
nextTick(() => {
|
|
|
- const noteEl = document.querySelector(`.noteIndex_${note.i}`) as HTMLElement;
|
|
|
- if (!noteEl) return;
|
|
|
- // console.log(noteEl.offsetLeft , noteEl.offsetWidth)
|
|
|
- const width = (noteEl.offsetWidth - 18) / 3;
|
|
|
- cursor.cursorElement.style.left = noteEl.offsetLeft + "px";
|
|
|
+ const bbox = note.bbox;
|
|
|
+ if (!bbox) return;
|
|
|
+ const width = (bbox.width - 18) / 3;
|
|
|
+ cursor.cursorElement.style.left = bbox.left + "px";
|
|
|
cursor.cursorElement.style.transform = `translateX(${width}px)`;
|
|
|
});
|
|
|
}
|