fix space calculation of new footers
however, there are widows...
@ -298,11 +298,6 @@ impl<'a> GridLayouter<'a> {
|
||||
|
||||
self.prepare_next_repeating_footers(true, engine)?;
|
||||
|
||||
// Ensure rows in the first region will be aware of the possible
|
||||
// presence of the footer.
|
||||
self.regions.size.y -= self.current.footer_height;
|
||||
self.current.initial_after_repeats = self.regions.size.y;
|
||||
|
||||
let mut y = 0;
|
||||
let mut consecutive_header_count = 0;
|
||||
while y < self.grid.rows.len() {
|
||||
@ -1785,13 +1780,6 @@ impl<'a> GridLayouter<'a> {
|
||||
)?;
|
||||
}
|
||||
|
||||
// Ensure rows don't try to overrun the footer.
|
||||
// Note that header layout will only subtract this again if it has
|
||||
// to skip regions to fit headers, so there is no risk of
|
||||
// subtracting this twice.
|
||||
self.regions.size.y -= self.current.footer_height;
|
||||
self.current.initial_after_repeats = self.regions.size.y;
|
||||
|
||||
if !self.repeating_headers.is_empty() || !self.pending_headers.is_empty() {
|
||||
// Add headers to the new region.
|
||||
self.layout_active_headers(engine)?;
|
||||
|
@ -632,9 +632,18 @@ impl<'a> GridLayouter<'a> {
|
||||
.simulate_footer_heights(footers, &self.regions, engine, disambiguator)?;
|
||||
}
|
||||
|
||||
// Ensure rows don't try to overrun the new footers.
|
||||
// Note that header layout will only subtract this again if it has
|
||||
// to skip regions to fit headers, so there is no risk of
|
||||
// subtracting this twice.
|
||||
self.regions.size.y -= expected_footer_height;
|
||||
self.current.footer_height += expected_footer_height;
|
||||
self.current.repeating_footer_heights.extend(expected_footer_heights);
|
||||
|
||||
if at_region_top {
|
||||
self.current.initial_after_repeats = self.regions.size.y;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 973 B |
Before Width: | Height: | Size: 772 B After Width: | Height: | Size: 721 B |
BIN
tests/ref/grid-subfooters-repeat-replace-multiple-levels.png
Normal file
After Width: | Height: | Size: 910 B |
Before Width: | Height: | Size: 979 B After Width: | Height: | Size: 970 B |
Before Width: | Height: | Size: 975 B After Width: | Height: | Size: 963 B |