Skip to content

Commit

Permalink
fix: Top margin at unforced page break not truncated correctly
Browse files Browse the repository at this point in the history
- fix #1279
  • Loading branch information
MurakamiShinyu committed Feb 16, 2024
1 parent 2b8a951 commit 97779f3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/core/src/vivliostyle/vgen.ts
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 97779f3

Please sign in to comment.