Carry XDV device advances through packed box scopes
This commit is contained in:
1 parent
9da75c82f5
commit
9efededf6d
14 files changed
+252
-83
No files matched your search
@@ -571,9 +571,11 @@ impl Navigation {
|
||||
let mut content_origins = Vec::new();
|
||||
let mut captures: Vec<(u32, XdvCanvas, DisplayList)> = Vec::new();
|
||||
let mut sources = std::mem::take(&mut page.sources);
|
||||
let mut offsets = std::mem::take(&mut page.xdv_horizontal_offsets).into_iter().peekable();
|
||||
let mut packets = page.prepared_virtual_glyphs.as_mut().map(std::mem::take);
|
||||
for (index, item) in std::mem::take(&mut page.items).into_iter().enumerate() {
|
||||
let origin = sources.remove(&index);
|
||||
let shift = offsets.next_if(|&(i, _)| i == index).map_or(0, |(_, shift)| shift);
|
||||
let packet = packets.as_mut().and_then(|packets| packets.remove(&index));
|
||||
if let DisplayItem::PdfGraphics {
|
||||
x,
|
||||
@@ -686,7 +688,7 @@ impl Navigation {
|
||||
.unwrap()
|
||||
.insert(output.items.len(), packet);
|
||||
}
|
||||
output.items.push(item);
|
||||
output.push_device_item(item, shift);
|
||||
}
|
||||
if !captures.is_empty() {
|
||||
return Err("incomplete XDV form display list".into());
|
||||
|
||||
Reference in new issue
Block a user