fix: space below a block need not fit on its page
LibreOffice drops it at the page bottom, as it drops space above at a page top (probed: a paragraph 8mm clear of the bottom keeps its 2cm below and stays). Counting it pushed the last block of a page down a page too early.
This commit is contained in:
1 parent
80e935145b
commit
970ad3776a
1 file changed
+4
-1
@@ -1084,7 +1084,10 @@ export const PageBreaks = Extension.create({
|
||||
bandOpenY: target,
|
||||
reason: 'leaf-jump-to-next-page',
|
||||
});
|
||||
} else if (effectiveBottom + (leaf.spaceAfter ?? 0) > contentEnd) {
|
||||
// Space below is not part of what has to fit: a block whose last line ends
|
||||
// on the page keeps it and the gap is dropped at the page bottom, the way
|
||||
// space above is at a page top (probed: 2cm below a line 8mm short of it).
|
||||
} else if (effectiveBottom > contentEnd) {
|
||||
if (leaf.kind === 'atomic') {
|
||||
const cf = leaf.columnsFragment;
|
||||
if (cf && cf.blockCount > 1 && cf.firstBlockNeededPx + COLUMNS_FIT_MARGIN_PX <= contentEnd - effectiveTop) {
|
||||
|
||||
Reference in new issue
Block a user