summaryrefslogtreecommitdiff
path: root/library/src/layout
diff options
context:
space:
mode:
Diffstat (limited to 'library/src/layout')
-rw-r--r--library/src/layout/flow.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/library/src/layout/flow.rs b/library/src/layout/flow.rs
index 627ea988..6940b55c 100644
--- a/library/src/layout/flow.rs
+++ b/library/src/layout/flow.rs
@@ -438,6 +438,7 @@ impl FlowLayouter<'_> {
find_footnotes(&mut notes, frame);
}
+ let prev_len = self.items.len();
self.items.push(item);
// No new footnotes.
@@ -473,10 +474,12 @@ impl FlowLayouter<'_> {
if !had_footnotes {
self.items.pop();
}
- let item = self.items.pop();
+ let moved: Vec<_> = self.items.drain(prev_len..).collect();
self.finish_region()?;
- self.items.extend(item);
+ self.has_footnotes =
+ moved.iter().any(|item| matches!(item, FlowItem::Footnote(_)));
self.regions.size.y -= height;
+ self.items.extend(moved);
can_skip = false;
continue 'outer;
}