Browse Source

feat(Wavy-Line): Add option not to draw wavy-lines: osmd.EngravingRules.RenderWavyLines = false (#112)

sschmidTU 1 year ago
parent
commit
b099265eaa

+ 2 - 0
src/MusicalScore/Graphical/EngravingRules.ts

@@ -398,6 +398,7 @@ export class EngravingRules {
     public RenderKeySignatures: boolean;
     public RenderTimeSignatures: boolean;
     public RenderPedals: boolean;
+    public RenderWavyLines: boolean;
     public DynamicExpressionMaxDistance: number;
     public DynamicExpressionSpacer: number;
     public IgnoreRepeatedDynamics: boolean;
@@ -841,6 +842,7 @@ export class EngravingRules {
         this.RenderKeySignatures = true;
         this.RenderTimeSignatures = true;
         this.RenderPedals = true;
+        this.RenderWavyLines = true;
         this.ArticulationPlacementFromXML = true;
         this.BreathMarkDistance = 0.8;
         this.FingeringPosition = PlacementEnum.AboveOrBelow; // AboveOrBelow = correct bounding boxes

+ 3 - 1
src/MusicalScore/Graphical/MusicSheetCalculator.ts

@@ -976,7 +976,9 @@ export abstract class MusicSheetCalculator {
                 this.calculatePedals();
             }
             //calculate all wavy lines (vibrato, trill marks)
-            this.calculateWavyLines();
+            if (this.rules.RenderWavyLines) {
+                this.calculateWavyLines();
+            }
             // calcualte RepetitionInstructions (Dal Segno, Coda, etc)
             this.calculateWordRepetitionInstructions();
         }