Explorar o código

compact mode: don't add system margin to top margin (#898). compacttight: Set PageBottomMargin to 0.

now in compacttight mode the first system really starts without any margin (blank white space above it) at all.
sschmid %!s(int64=4) %!d(string=hai) anos
pai
achega
aee60f60e5

+ 2 - 2
src/MusicalScore/Graphical/DrawingParameters.ts

@@ -115,7 +115,7 @@ export class DrawingParameters {
     }
 
     public setForCompactMode(): void {
-        this.setForDefault();
+        // this.setForDefault(); // this would reset all EngravingRules to default values.
         this.rules.CompactMode = true;
         this.DrawCredits = false; // sets DrawComposer, DrawTitle, DrawLyricist to false
         // this.DrawPartNames = true; // unnecessary
@@ -139,7 +139,7 @@ export class DrawingParameters {
         this.rules.StaffDistance = 3.5;
         this.rules.MinimumDistanceBetweenSystems = 1;
         // this.rules.PageTopMargin = 0.0; // see this.rules.PageTopMarginNarrow used in compact mode
-        this.rules.PageBottomMargin = 1.0;
+        this.rules.PageBottomMargin = 0.0;
         this.rules.PageLeftMargin = 2.0;
         this.rules.PageRightMargin = 2.0;
         // this.BetweenStaffDistance = 2.5 // etc needs to be set in OSMD.rules

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

@@ -1105,7 +1105,9 @@ export class MusicSystemBuilder {
                     }*/
                 }
                 // now add the border-top: everything that stands out above the staffline:
-                currentYPosition += -currentSystem.PositionAndShape.BorderTop;
+                if (!this.rules.CompactMode || this.rules.PageTopMargin > 0) {
+                    currentYPosition += -currentSystem.PositionAndShape.BorderTop;
+                }
                 const relativePosition: PointF2D = new PointF2D(this.rules.PageLeftMargin + this.rules.SystemLeftMargin,
                                                                 currentYPosition);
                 currentSystem.PositionAndShape.RelativePosition = relativePosition;