Paint a footnote separator above insertions

This commit is contained in:
gloamxun committed 2026-10-20 18:19:42 +08:00
1 parent 493180125a
commit 6e1ee13d68
3 files changed
+54

No files matched your search

+32
View File
@@ -1372,6 +1372,38 @@ mod tests {
)));
}
#[test]
fn footnote_separator_sits_above_the_insertion_area() {
let page = Page {
items: vec![
VerticalItem::Box(VerticalBox {
width: 100 * 65_536,
height: 100 * 65_536,
}),
VerticalItem::Insertion(Insertion {
class: 0,
height: 20 * 65_536,
items: vec![VerticalItem::Rule {
width: 100 * 65_536,
height: 2 * 65_536,
}],
}),
],
insertions: Vec::new(),
marks: Vec::new(),
floats: Vec::new(),
sources: Vec::new(),
hash: 0,
};
let list = page.display_list_with_goal(700 * 65_536);
let separator = list.items.iter().find_map(|item| match item {
crate::render::DisplayItem::Rule { y, width, .. } if *width == 40 * 65_536 => Some(*y),
_ => None,
});
let y = separator.expect("separator rule");
assert!(y > 690 * 65_536);
assert!(y < 700 * 65_536);
}
#[test]
fn insertion_material_sits_at_the_page_bottom() {
let page = Page {