Kaynağa Gözat

fix(DrawingParameters): switching default and compact mode during runtime correctly renders each mode after re-render.

fix DrawingParameters: disabling Subtitle no longer disables Title.
sschmidTU 6 yıl önce
ebeveyn
işleme
96bf081d4c

+ 20 - 5
src/MusicalScore/Graphical/DrawingParameters.ts

@@ -72,11 +72,14 @@ export class DrawingParameters {
         this.drawScrollIndicator = true;
         this.drawComments = true;
         this.drawMarkedAreas = true;
-        this.drawTitle = true;
-        this.drawSubtitle = true;
+        this.DrawTitle = true;
+        this.DrawSubtitle = true;
+        this.DrawComposer = true;
+        this.DrawLyricist = true;
         this.drawCredits = true;
-        this.drawPartNames = true;
+        this.DrawPartNames = true;
         this.drawHiddenNotes = true;
+        EngravingRules.Rules.CompactMode = false;
     }
 
     public setForDefault(): void {
@@ -143,11 +146,23 @@ export class DrawingParameters {
         return this.drawSubtitle;
     }
 
-    /** Enable or disable drawing the Subtitle of the piece. If disabled, will disable drawing Title as well. */
+    /** Enable or disable drawing the Subtitle of the piece. If enabled, will enable drawing Title as well. */
     public set DrawSubtitle(value: boolean) {
-        this.drawTitle = value;
         this.drawSubtitle = value;
         EngravingRules.Rules.RenderSubtitle = value;
+        if (value) {
+            this.DrawTitle = true; // if subtitle is drawn, title needs to be drawn as well
+        }
+    }
+
+    public get DrawComposer(): boolean {
+        return this.drawComposer;
+    }
+
+    /** Enable or disable drawing a label for the Composer of the piece. */
+    public set DrawComposer(value: boolean) {
+        this.drawComposer = value;
+        EngravingRules.Rules.RenderComposer = value;
     }
 
     public get DrawLyricist(): boolean {

+ 4 - 5
src/MusicalScore/Graphical/MusicSheetCalculator.ts

@@ -224,12 +224,11 @@ export abstract class MusicSheetCalculator {
         throw new Error("abstract, not implemented");
     }
 
-    /// <summary>
-    /// This method calculates the relative Positions of all MusicSystems.
-    /// </summary>
-    /// <param name="graphicalMusicPage"></param>
+    /** Calculates the relative Positions of all MusicSystems.
+     *
+     */
     protected calculateMusicSystemsRelativePositions(graphicalMusicPage: GraphicalMusicPage): void {
-        // xPosition is always fix
+        // xPosition is always fixed
         let relativePosition: PointF2D = new PointF2D(this.rules.PageLeftMargin + this.rules.SystemLeftMargin, 0);
 
         if (EngravingRules.Rules.CompactMode) {