Keep tables that fit on a single page intact
This commit is contained in:
1 parent
9ae7353376
commit
d248a84764
1 file changed
+10
@@ -3016,6 +3016,16 @@ pub(super) fn build_positioned_pages(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Keep a table that fits on one page intact instead of
|
||||||
|
// splitting its rows at the bottom of the current page.
|
||||||
|
if table_height > 0 && total_height <= page_goal.saturating_sub(top_skip) {
|
||||||
|
let page_nonempty = pages.last().is_some_and(|page| !page.items.is_empty());
|
||||||
|
if page_nonempty && cursor.saturating_add(total_height) > page_goal {
|
||||||
|
pages.push(PositionedPage::default());
|
||||||
|
cursor = top_skip;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let mut line_index = 0;
|
let mut line_index = 0;
|
||||||
let mut has_caption_lines = false;
|
let mut has_caption_lines = false;
|
||||||
for line in caption_lines {
|
for line in caption_lines {
|
||||||
|
|||||||
Reference in new issue
Block a user