Skip to content

Commit

Permalink
Merge pull request #1280 from vivliostyle/fix/issue1279
Browse files Browse the repository at this point in the history
fix: Top margin at unforced page break not truncated correctly
  • Loading branch information
MurakamiShinyu authored Feb 16, 2024
2 parents 2b8a951 + 97779f3 commit 8ecff45
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/core/src/vivliostyle/vgen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,9 @@ export class ViewFactory
!Css.isDefaultingValue(breakBefore) &&
!(insideNonRootMultiColumn && breakBefore === Css.ident.column)
) {
this.nodeContext.breakBefore = breakBefore.toString();
if (this.nodeContext.fragmentIndex === 1) {
this.nodeContext.breakBefore = breakBefore.toString();
}
if (Break.forcedBreakValues[this.nodeContext.breakBefore]) {
delete computedStyle["break-before"];
}
Expand Down Expand Up @@ -1027,7 +1029,10 @@ export class ViewFactory
// unless page type is explicitly set
!(!pageType && computedStyle["position"] === Css.ident.fixed)
) {
if (!Break.isSpreadBreakValue(this.nodeContext.breakBefore)) {
if (
this.nodeContext.fragmentIndex === 1 &&
!Break.isSpreadBreakValue(this.nodeContext.breakBefore)
) {
this.nodeContext.breakBefore = "page";
}
this.styler.cascade.previousPageType =
Expand Down

0 comments on commit 8ecff45

Please sign in to comment.