TIANYONG 1 год назад
Родитель
Сommit
53e920a629
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      src/state.ts

+ 4 - 4
src/state.ts

@@ -683,10 +683,10 @@ export const gotoCustomNote = (index: number) => {
 const setCursorPosition = (note: any, cursor: any) => {
   if (state.musicRenderType === EnumMusicRenderType.firstTone || state.musicRenderType === EnumMusicRenderType.fixedTone) {
     /**
-     * bug:#9920
+     * bug:#9920、#9940
      * 简谱选段模式,预备小节为休止小节时,选段播放结束,指针会重置到第一小节位置的初始位置
      */
-    if (state.sectionStatus && note.multipleRestMeasures) {
+    if (state.sectionStatus && state.playState === 'paused' && state.sectionFirst && (note.multipleRestMeasures || note.MeasureNumberXML !== state.sectionFirst?.MeasureNumberXML)) {
       return
     }
     nextTick(() => {
@@ -808,8 +808,8 @@ export const handleChangeSection = () => {
   // 如果开启了选段,再次点击取消选段
   if (state.sectionStatus) {
     togglePlay("paused");
-    skipNotePlay(0, true);
     clearSelection();
+    skipNotePlay(0, true);
     state.sectionFirst = null;
     return;
   }
@@ -959,8 +959,8 @@ export const isRhythmicExercises = () => {
 /** 重置状态 */
 export const handleRessetState = () => {
   // 切换模式,清除选段
-  skipNotePlay(0, true);
   clearSelection();
+  skipNotePlay(0, true);
   // midi 重置播放进度
   if (state.isAppPlay) {
     audioData.progress = 0;