Переглянути джерело

fix(Layout): don't add first system's border to margin below title. Saves a lot of space.

the first system's border was added to the margin above it,
duplicating the role of the EngravingRules TitleBottomDistance (if title drawn)
and PageTopMargin.

this change saves a lot of space for the title part (header).

the old behavior can be mimicked by increasing PageTopMargin and/or TitleBottomDistance EngravingRules.

somewhat related to #898
sschmid 4 роки тому
батько
коміт
5c32ff14be
1 змінених файлів з 7 додано та 5 видалено
  1. 7 5
      src/MusicalScore/Graphical/MusicSystemBuilder.ts

+ 7 - 5
src/MusicalScore/Graphical/MusicSystemBuilder.ts

@@ -1105,11 +1105,13 @@ export class MusicSystemBuilder {
                     }*/
                 }
                 // now add the border-top: everything that stands out above the staffline:
-                if (!this.rules.CompactMode) { // don't add extra margins/borders in compact mode
-                    if (this.rules.PageTopMargin > 0) { // don't add extra margins with PageTopMargin == 0
-                        currentYPosition += -currentSystem.PositionAndShape.BorderTop;
-                    }
-                }
+                // note: this is unnecessary. We have PageTopMargin and TitleBottomDistance for this.
+                //   also, this creates a sudden margin spike from PageTopMargin = 0.1 to PageTopMargin = 0.
+                // if (!this.rules.CompactMode) { // don't add extra margins/borders in compact mode
+                //     if (this.rules.PageTopMargin > 0) { // don't add extra margins with PageTopMargin == 0
+                //         currentYPosition += -currentSystem.PositionAndShape.BorderTop;
+                //     }
+                // }
                 const relativePosition: PointF2D = new PointF2D(this.rules.PageLeftMargin + this.rules.SystemLeftMargin,
                                                                 currentYPosition);
                 currentSystem.PositionAndShape.RelativePosition = relativePosition;