Paint route-D float placeholders at page edges
This commit is contained in:
1 parent
6e1ee13d68
commit
af50f1afa1
3 files changed
+86
-1
No files matched your search
@@ -1372,6 +1372,42 @@ mod tests {
|
||||
)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn float_placeholders_are_painted_at_page_edges() {
|
||||
let page = Page {
|
||||
items: vec![VerticalItem::Box(VerticalBox {
|
||||
width: 100 * 65_536,
|
||||
height: 20 * 65_536,
|
||||
})],
|
||||
insertions: Vec::new(),
|
||||
marks: Vec::new(),
|
||||
floats: vec![
|
||||
Float {
|
||||
placement: FloatPlacement::Top,
|
||||
width: 50 * 65_536,
|
||||
height: 15 * 65_536,
|
||||
},
|
||||
Float {
|
||||
placement: FloatPlacement::Bottom,
|
||||
width: 60 * 65_536,
|
||||
height: 10 * 65_536,
|
||||
},
|
||||
],
|
||||
sources: Vec::new(),
|
||||
hash: 0,
|
||||
};
|
||||
let list = page.display_list_with_goal(700 * 65_536);
|
||||
assert!(list.items.iter().any(|item| matches!(
|
||||
item,
|
||||
crate::render::DisplayItem::Rule { y, width, height, .. }
|
||||
if *y == 0 && *width == 50 * 65_536 && *height == 15 * 65_536
|
||||
)));
|
||||
assert!(list.items.iter().any(|item| matches!(
|
||||
item,
|
||||
crate::render::DisplayItem::Rule { y, width, height, .. }
|
||||
if *y == 690 * 65_536 && *width == 60 * 65_536 && *height == 10 * 65_536
|
||||
)));
|
||||
}
|
||||
#[test]
|
||||
fn footnote_separator_sits_above_the_insertion_area() {
|
||||
let page = Page {
|
||||
|
||||
Reference in new issue
Block a user