From 9422ecc74ade554a755659c41eecf1e6beaf87e1 Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Wed, 21 May 2025 01:11:30 -0300 Subject: [PATCH] fix footer progression --- crates/typst-layout/src/grid/layouter.rs | 3 ++- crates/typst-layout/src/grid/repeated.rs | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/typst-layout/src/grid/layouter.rs b/crates/typst-layout/src/grid/layouter.rs index 5d37584ec..d068c134e 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 512593a5b..4fdbd8e62 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(()) }