diff --git a/crates/texrra-tex-core/src/lib.rs b/crates/texrra-tex-core/src/lib.rs index db086a7..b372af9 100644 --- a/crates/texrra-tex-core/src/lib.rs +++ b/crates/texrra-tex-core/src/lib.rs @@ -1861,6 +1861,41 @@ mod tests { let svg = list.to_svg(); assert!(svg.contains(">x")); } + + #[test] + fn bottom_float_content_is_painted_at_the_page_bottom() { + let mut document = Document::new(100, Vec::new()); + document.top_skip = 0; + document.text_fraction_percent = 0; + document.units.push(Unit::vertical( + 1, + vec![VerticalItem::Box(VerticalBox { + width: 10, + height: 10, + })], + )); + document.units.push(Unit::float_with_content( + 2, + FloatPlacement::Bottom, + 30, + 20, + vec![VerticalItem::Rule { + width: 30, + height: 2, + }], + )); + let engine = Engine::layout(&document); + let list = engine.pages()[0].display_list_with_goal(100); + assert!(list.items.iter().any(|item| matches!( + item, + DisplayItem::Rule { + y: 80, + width: 30, + height: 2, + .. + } + ))); + } #[test] fn float_content_is_painted_at_the_top_of_the_page() { let mut document = Document::new(1000, Vec::new());