sschmidTU 3 سال پیش
والد
کامیت
a3d4c5b923
1فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  1. 2 0
      src/OpenSheetMusicDisplay/Cursor.ts

+ 2 - 0
src/OpenSheetMusicDisplay/Cursor.ts

@@ -151,6 +151,8 @@ export class Cursor implements IPlaybackListener {
     this.updateCurrentPageFromSystem(currentSystem);
     const previousStaffEntry: GraphicalStaffEntry = values[2];
 
+    // for samples starting with a precount measure (e.g. Mozart - An Chloe), the measure number can be 0,
+    //   so without max(n, 1), [topMeasureNumber - 1] would be [-1], causing an error
     const topMeasureNumber: number = Math.max(previousStaffEntry.parentMeasure.MeasureNumber, 1);
     // we have to find the top measure, otherwise the cursor with type 3 "jumps around" between vertical measures
     let topMeasure: GraphicalMeasure;