|
@@ -1281,12 +1281,13 @@ export const scrollViewNote = () => {
|
|
|
const domId = "vf" + noteId;
|
|
|
const cursorElement: any = document.querySelector(`[data-vf=${domId}]`)?.parentElement;
|
|
|
const musicAndSelection = document.getElementById(state.scrollContainer)!;
|
|
|
+ const noteCenterOffsetTop = cursorElement ? cursorElement?.offsetTop + (cursorElement?.offsetHeight/2) : 0;
|
|
|
// console.log('滑动',cursorElement.offsetTop,offsetTop, cursorElement, )
|
|
|
- if (!cursorElement || !musicAndSelection || offsetTop === cursorElement.offsetTop || Math.abs(offsetTop - cursorElement.offsetTop) < 30) return;
|
|
|
- offsetTop = cursorElement.offsetTop;
|
|
|
- if (offsetTop > 50) {
|
|
|
+ if (!cursorElement || !noteCenterOffsetTop || !musicAndSelection || offsetTop === noteCenterOffsetTop || Math.abs(offsetTop - noteCenterOffsetTop) < 30) return;
|
|
|
+ offsetTop = noteCenterOffsetTop;
|
|
|
+ if (offsetTop > 100) {
|
|
|
musicAndSelection.scrollTo({
|
|
|
- top: (offsetTop - 50) * state.musicZoom,
|
|
|
+ top: (offsetTop - 100) * state.musicZoom,
|
|
|
behavior: "smooth",
|
|
|
});
|
|
|
} else {
|