diff --git a/crates/typst-layout/src/grid/repeated.rs b/crates/typst-layout/src/grid/repeated.rs index df206ea9c..81ac48d1a 100644 --- a/crates/typst-layout/src/grid/repeated.rs +++ b/crates/typst-layout/src/grid/repeated.rs @@ -240,6 +240,8 @@ impl<'a> GridLayouter<'a> { // TODO(layout model): re-calculate heights of headers and footers // on each region if 'full' changes? (Assuming height doesn't // change for now...) + // + // Would remove the footer height update below (move it here). skipped_region = true; self.regions.size.y -= self.current.footer_height; @@ -250,7 +252,6 @@ impl<'a> GridLayouter<'a> { if skipped_region { // Simulate the footer again; the region's 'full' might have // changed. - // TODO: maybe this should go in the loop, a bit hacky as is... self.regions.size.y += self.current.footer_height; self.current.footer_height = self .simulate_footer(footer, &self.regions, engine, disambiguator)? diff --git a/crates/typst-layout/src/grid/rowspans.rs b/crates/typst-layout/src/grid/rowspans.rs index 3f5f902b3..ae8869d5f 100644 --- a/crates/typst-layout/src/grid/rowspans.rs +++ b/crates/typst-layout/src/grid/rowspans.rs @@ -527,23 +527,7 @@ impl GridLayouter<'_> { // we have to use initial header heights (note that // header height can change in the middle of the // region). - // TODO: maybe cache this - // NOTE: it is safe to access 'lrows' here since - // 'breakable' can only be true outside of headers - // and unbreakable rows in general, so there is no risk - // of accessing an incomplete list of rows. - let initial_header_height = self.current.lrows - [..self.current.repeated_header_rows] - .iter() - .map(|row| match row { - Row::Frame(frame, _, _) => frame.height(), - Row::Fr(_, _, _) => Abs::zero(), - }) - .sum(); - - self.current.initial.y - - initial_header_height - - self.current.footer_height + self.current.initial_after_repeats } else { // When measuring unbreakable auto rows, infinite // height is available for content to expand.