From cce5fe739a0d476b6d54ae7cd9385a2313eb639e Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Mon, 3 Mar 2025 19:59:41 -0300 Subject: [PATCH] multiple footers --- crates/typst-library/src/layout/grid/resolve.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/typst-library/src/layout/grid/resolve.rs b/crates/typst-library/src/layout/grid/resolve.rs index baf6b7383..42df8953b 100644 --- a/crates/typst-library/src/layout/grid/resolve.rs +++ b/crates/typst-library/src/layout/grid/resolve.rs @@ -678,8 +678,8 @@ pub struct CellGrid<'a> { pub hlines: Vec>, /// The repeatable headers of this grid. pub headers: Vec>, - /// The repeatable footer of this grid. - pub footer: Option>, + /// The repeatable footers of this grid. + pub footers: Vec>, /// Whether this grid has gutters. pub has_gutter: bool, } @@ -756,7 +756,7 @@ impl<'a> CellGrid<'a> { vlines, hlines, headers, - footer, + footers: footer.into_iter().collect(), has_gutter, } } @@ -895,6 +895,11 @@ impl<'a> CellGrid<'a> { pub fn has_repeated_headers(&self) -> bool { self.headers.iter().any(|h| h.repeated) } + + #[inline] + pub fn has_repeated_footers(&self) -> bool { + self.footers.iter().any(|f| f.repeated) + } } /// Resolves and positions all cells in the grid before creating it.