Ver código fonte

fix: 选段播放完成,光标回到预备小节

TIANYONG 7 meses atrás
pai
commit
80d69b76fd
1 arquivos alterados com 3 adições e 1 exclusões
  1. 3 1
      src/state.ts

+ 3 - 1
src/state.ts

@@ -637,7 +637,9 @@ export const onPlay = () => {
 /** 播放模式结束自动重播 */
 const autoResetPlay = () => {
   if (state.modeType !== "practise") return;
-  skipNotePlay(0, true);
+  // 如果是选段需要跳转到预备小节或者选段内的第一小节,否则跳转到第一小节
+  const targetIdx = state.section.length === 2 ? state.sectionFirst?.i || state.section[1].i : 0;
+  skipNotePlay(targetIdx, true);
   // 没有开启自动重播, 不是练习模式
   if (!state.setting.repeatAutoPlay) return;
   offsetTop = 0;