|
@@ -89,7 +89,7 @@ export abstract class MusicSheetCalculator {
|
|
|
return this.graphicalMusicSheet.LeadSheet;
|
|
|
}
|
|
|
|
|
|
- private static setMeasuresMinStaffEntriesWidth(measures: GraphicalMeasure[], minimumStaffEntriesWidth: number): void {
|
|
|
+ protected static setMeasuresMinStaffEntriesWidth(measures: GraphicalMeasure[], minimumStaffEntriesWidth: number): void {
|
|
|
for (let idx: number = 0, len: number = measures.length; idx < len; ++idx) {
|
|
|
const measure: GraphicalMeasure = measures[idx];
|
|
|
measure.minimumStaffEntriesWidth = minimumStaffEntriesWidth;
|
|
@@ -193,13 +193,16 @@ export abstract class MusicSheetCalculator {
|
|
|
let minLength: number = 0;
|
|
|
const maxInstructionsLength: number = this.rules.MaxInstructionsConstValue;
|
|
|
if (this.graphicalMusicSheet.MeasureList.length > 0) {
|
|
|
+ /** list of vertical measures */
|
|
|
let measures: GraphicalMeasure[] = this.graphicalMusicSheet.MeasureList[0];
|
|
|
let minimumStaffEntriesWidth: number = this.calculateMeasureXLayout(measures);
|
|
|
+ minimumStaffEntriesWidth = this.calculateMeasureWidthFromLyrics(measures, minimumStaffEntriesWidth);
|
|
|
MusicSheetCalculator.setMeasuresMinStaffEntriesWidth(measures, minimumStaffEntriesWidth);
|
|
|
minLength = minimumStaffEntriesWidth * 1.2 + maxInstrNameLabelLength + maxInstructionsLength;
|
|
|
for (let i: number = 1; i < this.graphicalMusicSheet.MeasureList.length; i++) {
|
|
|
measures = this.graphicalMusicSheet.MeasureList[i];
|
|
|
minimumStaffEntriesWidth = this.calculateMeasureXLayout(measures);
|
|
|
+ minimumStaffEntriesWidth = this.calculateMeasureWidthFromLyrics(measures, minimumStaffEntriesWidth);
|
|
|
MusicSheetCalculator.setMeasuresMinStaffEntriesWidth(measures, minimumStaffEntriesWidth);
|
|
|
minLength = Math.max(minLength, minimumStaffEntriesWidth * 1.2 + maxInstructionsLength);
|
|
|
}
|
|
@@ -207,6 +210,10 @@ export abstract class MusicSheetCalculator {
|
|
|
this.graphicalMusicSheet.MinAllowedSystemWidth = minLength;
|
|
|
}
|
|
|
|
|
|
+ public calculateMeasureWidthFromLyrics(measuresVertical: GraphicalMeasure[], oldMinimumStaffEntriesWidth: number): number {
|
|
|
+ throw new Error("abstract, not implemented");
|
|
|
+ }
|
|
|
+
|
|
|
protected formatMeasures(): void {
|
|
|
throw new Error("abstract, not implemented");
|
|
|
}
|
|
@@ -670,6 +677,8 @@ export abstract class MusicSheetCalculator {
|
|
|
musicSystemBuilder.initialize(this.graphicalMusicSheet, visibleMeasureList, numberOfStaffLines);
|
|
|
musicSystemBuilder.buildMusicSystems();
|
|
|
|
|
|
+ this.formatMeasures();
|
|
|
+
|
|
|
// check for Measures with only WholeRestNotes and correct their X-Position (middle of Measure)
|
|
|
this.checkMeasuresForWholeRestNotes();
|
|
|
if (!this.leadSheet) {
|
|
@@ -725,8 +734,6 @@ export abstract class MusicSheetCalculator {
|
|
|
this.calculateTempoExpressions();
|
|
|
}
|
|
|
|
|
|
- this.formatMeasures();
|
|
|
-
|
|
|
// calculate all LyricWords Positions
|
|
|
this.calculateLyricsPosition();
|
|
|
|