Skip to content

Commit

Permalink
fix(Drawing range): Fix rendering up to measure number 9 instead of 1…
Browse files Browse the repository at this point in the history
…0 when drawUpToMeasureNumber 10 set if piece has pickup measure.

the fix for min was already added in an earlier commit, now also done for max measure number.
  • Loading branch information
sschmidTU committed May 21, 2024
1 parent 2352e27 commit 3ec051c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/OpenSheetMusicDisplay/OpenSheetMusicDisplay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,14 @@ export class OpenSheetMusicDisplay {
// this.graphic.GetCalculator.clearSystemsAndMeasures(); // maybe?
// this.graphic.GetCalculator.clearRecreatedObjects();

// drawing range: check if pickup measure and start Measure > 1
if (this.Sheet.SourceMeasures[0].ImplicitMeasure &&
this.rules.MinMeasureToDrawNumber > 1
) {
this.rules.MinMeasureToDrawIndex = this.rules.MinMeasureToDrawNumber; // -1 for index, +1 for pickup
// drawing range: check if pickup measure and start or end measure number > 1
if (this.Sheet.SourceMeasures[0].ImplicitMeasure) {
if (this.rules.MinMeasureToDrawNumber > 1) {
this.rules.MinMeasureToDrawIndex = this.rules.MinMeasureToDrawNumber; // -1 for index, +1 for pickup
}
if (this.rules.MaxMeasureToDrawNumber > 0) {
this.rules.MaxMeasureToDrawIndex = this.rules.MaxMeasureToDrawNumber; // -1 for index, +1 for pickup
}
}

// Set page width
Expand Down

0 comments on commit 3ec051c

Please sign in to comment.