Place insertion material at the page bottom
This commit is contained in:
1 parent
159bb6a386
commit
493180125a
3 files changed
+79
-11
No files matched your search
@@ -1371,6 +1371,37 @@ mod tests {
|
||||
crate::render::DisplayItem::Rule { width, .. } if *width == 100 * 65_536
|
||||
)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn insertion_material_sits_at_the_page_bottom() {
|
||||
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 rule = list.items.iter().find_map(|item| match item {
|
||||
crate::render::DisplayItem::Rule { y, .. } => Some(*y),
|
||||
_ => None,
|
||||
});
|
||||
assert!(rule.expect("insertion rule") >= 697 * 65_536);
|
||||
}
|
||||
#[test]
|
||||
fn link_rectangles_become_pdf_annotations() {
|
||||
use crate::render::DisplayList;
|
||||
|
||||
Reference in new issue
Block a user