瀏覽代碼

fix compact mode: don't add TopMargin for compact mode (fix previous commit) (#898)

sschmid 4 年之前
父節點
當前提交
490964c970
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      src/MusicalScore/Graphical/MusicSystemBuilder.ts

+ 4 - 2
src/MusicalScore/Graphical/MusicSystemBuilder.ts

@@ -1105,8 +1105,10 @@ export class MusicSystemBuilder {
                     }*/
                 }
                 // now add the border-top: everything that stands out above the staffline:
-                if (!this.rules.CompactMode || this.rules.PageTopMargin > 0) {
-                    currentYPosition += -currentSystem.PositionAndShape.BorderTop;
+                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);