summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPgBiel <9021226+PgBiel@users.noreply.github.com>2025-05-21 01:11:30 -0300
committerPgBiel <9021226+PgBiel@users.noreply.github.com>2025-06-28 22:39:35 -0300
commit9422ecc74ade554a755659c41eecf1e6beaf87e1 (patch)
tree0f3f7ba55f81427ba9bf4c89d99c116cc3aed361
parent58db042ff325bda52309c42b28bfae4d9be2114a (diff)
fix footer progression
-rw-r--r--crates/typst-layout/src/grid/layouter.rs3
-rw-r--r--crates/typst-layout/src/grid/repeated.rs3
2 files changed, 5 insertions, 1 deletions
diff --git a/crates/typst-layout/src/grid/layouter.rs b/crates/typst-layout/src/grid/layouter.rs
index 5d37584e..d068c134 100644
--- a/crates/typst-layout/src/grid/layouter.rs
+++ b/crates/typst-layout/src/grid/layouter.rs
@@ -317,10 +317,11 @@ impl<'a> GridLayouter<'a> {
}
}
- if let Some(next_footer) = self.upcoming_footers.first() {
+ if let [next_footer, other_footers @ ..] = self.upcoming_footers {
// TODO(subfooters): effective range (consider gutter before
// if it was removed)
if next_footer.range().contains(&y) {
+ self.upcoming_footers = other_footers;
self.place_new_footer(engine, next_footer)?;
self.flush_orphans();
y = next_footer.end;
diff --git a/crates/typst-layout/src/grid/repeated.rs b/crates/typst-layout/src/grid/repeated.rs
index 512593a5..4fdbd8e6 100644
--- a/crates/typst-layout/src/grid/repeated.rs
+++ b/crates/typst-layout/src/grid/repeated.rs
@@ -567,6 +567,9 @@ impl<'a> GridLayouter<'a> {
0,
)?;
+ self.repeating_footers
+ .extend(next_repeating_footers.iter().filter_map(Repeatable::as_repeated));
+
Ok(())
}