Просмотр исходного кода

refactor

alignRests option names changed from true and false to always and never
(auto unchanged)

part of #621
sschmid 5 лет назад
Родитель
Сommit
163cdf620a

+ 1 - 1
src/MusicalScore/Graphical/EngravingRules.ts

@@ -405,7 +405,7 @@ export class EngravingRules {
         this.metronomeMarkYShift = -0.5;
 
         // Render options (whether to render specific or invisible elements)
-        this.alignRests = AlignRestOption.False; // 0 = false, 1 = true, 2 = auto
+        this.alignRests = AlignRestOption.Never; // 0 = false, 1 = true, 2 = auto
         this.drawSlurs = true;
         this.coloringMode = ColoringMode.XML;
         this.coloringEnabled = true;

+ 2 - 2
src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetCalculator.ts

@@ -146,9 +146,9 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
 
       for (const measure of measures) {
         // determine whether to align rests
-        if (EngravingRules.Rules.AlignRests === AlignRestOption.False) {
+        if (EngravingRules.Rules.AlignRests === AlignRestOption.Never) {
           (measure as VexFlowMeasure).formatVoices = formatVoicesDefault;
-        } else if (EngravingRules.Rules.AlignRests === AlignRestOption.True) {
+        } else if (EngravingRules.Rules.AlignRests === AlignRestOption.Always) {
           (measure as VexFlowMeasure).formatVoices = formatVoicesAlignRests;
         } else if (EngravingRules.Rules.AlignRests === AlignRestOption.Auto) {
           let alignRests: boolean = false;

+ 2 - 2
src/OpenSheetMusicDisplay/OSMDOptions.ts

@@ -111,8 +111,8 @@ export interface IOSMDOptions {
 }
 
 export enum AlignRestOption {
-    False = 0,
-    True = 1,
+    Never = 0, // false should also work
+    Always = 1, // true should also work
     Auto = 2
 }