|
@@ -1356,7 +1356,7 @@ export const hanldeDirectSelection = (list: any[]) => {
|
|
|
console.log('选段小节', state.section)
|
|
|
}, 0);
|
|
|
};
|
|
|
-let offsetTop = 0;
|
|
|
+let offsetTop = 0, musicScrollTop = 0;
|
|
|
/**
|
|
|
* 窗口内滚动到音符的区域
|
|
|
* @param isScroll 可选: 强制滚动到顶部, 默认: false
|
|
@@ -1379,7 +1379,11 @@ export const scrollViewNote = (resetTop?: boolean) => {
|
|
|
state.headTopHeight = document.querySelector('.headHeight')?.getBoundingClientRect()?.height || 100;
|
|
|
}
|
|
|
// console.log('滑动',cursorElement.offsetTop,offsetTop, cursorElement, )
|
|
|
- if (!cursorElement || !musicAndSelection || offsetTop === cursorElement.offsetTop || Math.abs(offsetTop - cursorElement.offsetTop) < 30) return;
|
|
|
+ if (Math.abs(musicAndSelection?.scrollTop - musicScrollTop) > 30) {
|
|
|
+ // 手动滑动谱面,重新播放需要滚动到对应位置
|
|
|
+ } else {
|
|
|
+ if (!cursorElement || !musicAndSelection || offsetTop === cursorElement.offsetTop || Math.abs(offsetTop - cursorElement.offsetTop) < 30) return;
|
|
|
+ }
|
|
|
offsetTop = cursorElement.offsetTop;
|
|
|
if (offsetTop > (state.headTopHeight + 30)) {
|
|
|
musicAndSelection.scrollTo({
|
|
@@ -1392,6 +1396,7 @@ export const scrollViewNote = (resetTop?: boolean) => {
|
|
|
behavior: "smooth",
|
|
|
});
|
|
|
}
|
|
|
+ musicScrollTop = musicAndSelection.scrollTop;
|
|
|
};
|
|
|
|
|
|
/** 检测是否是节奏练习 */
|