Reserve depth at the bottom of the page frame

This commit is contained in:
gloamxun committed 2026-10-19 18:15:00 +08:00
1 parent 71bd01c82c
commit ff509c2d59
2 files changed
+7 -1

No files matched your search

+4 -1
View File
@@ -1623,7 +1623,10 @@ pub(super) fn build_positioned_pages(
let max_depth = i64::from(scaled_points(ARTICLE_11PT_MAX_DEPTH_PT).0);
let paragraph_gap = (normal_line_height as f64 * 0.35).round() as i64;
let heading_gap = (normal_line_height as f64 * 0.65).round() as i64;
let page_goal = scaled_points(content_height_mm * PDF_POINTS_PER_INCH / 25.4).0 as i64;
// Leave a small descent guard so the last baseline and its descender stay
// inside the page frame; TeX's \maxdepth plays the same role.
let page_goal = scaled_points(content_height_mm * PDF_POINTS_PER_INCH / 25.4).0 as i64
- millimeters_to_scaled(3.0);
let mut pages = vec![PositionedPage::default()];
let mut deferred: Vec<DeferredFloat> = Vec::new();
let mut block_end_pages: HashMap<usize, usize> = HashMap::new();