fix gutter popping edge case

- With a header at the end, decrease the header row count for orphan prevention.
This commit is contained in:
PgBiel 2025-04-06 14:59:58 -03:00
parent 0c6fae92f0
commit 6b133dca3f

View File

@ -1432,6 +1432,13 @@ impl<'a> GridLayouter<'a> {
{ {
// Remove the last row in the region if it is a gutter row. // Remove the last row in the region if it is a gutter row.
self.lrows.pop().unwrap(); self.lrows.pop().unwrap();
if self.lrows.len() == self.current_header_rows {
if self.current_header_rows == self.current_repeating_header_rows {
self.current_repeating_header_rows -= 1;
}
self.current_header_rows -= 1;
}
} }
let footer_would_be_widow = if let Some(last_header_row) = self let footer_would_be_widow = if let Some(last_header_row) = self