瀏覽代碼

fix(Playback): Prevent playback stopped by implicit measure (time signature change at end of staffline)

this sort of virtual measure that's only for showing a time signature change, but is implemented as a graphical measure,
has measure number -1 and no parent source measure set, so we need to check for this.
sschmidTU 3 年之前
父節點
當前提交
80bd989939
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/MusicalScore/Graphical/MusicSheetDrawer.ts

+ 4 - 1
src/MusicalScore/Graphical/MusicSheetDrawer.ts

@@ -379,7 +379,10 @@ export abstract class MusicSheetDrawer {
     protected drawStaffLine(staffLine: StaffLine): void {
     protected drawStaffLine(staffLine: StaffLine): void {
         for (const measure of staffLine.Measures) {
         for (const measure of staffLine.Measures) {
             this.drawMeasure(measure);
             this.drawMeasure(measure);
-            measure.parentSourceMeasure.WasRendered = true; // simplification
+            if (measure.parentSourceMeasure) {
+                measure.parentSourceMeasure.WasRendered = true; // simplification
+                // parentSourceMeasure can be undefined for implicit measure (e.g. time signature change at end of staffline)
+            }
         }
         }
 
 
         if (this.rules.RenderLyrics) {
         if (this.rules.RenderLyrics) {