mirror of
https://github.com/typst/typst
synced 2025-05-14 17:15:28 +08:00
set snapshot when laying out new headers
- Still need to detect when this doesn't make sense, e.g. in the last region, or right before a footer...
This commit is contained in:
parent
40bc08291d
commit
e4bbe471a7
@ -357,8 +357,9 @@ impl<'a> GridLayouter<'a> {
|
|||||||
self.unbreakable_rows_left +=
|
self.unbreakable_rows_left +=
|
||||||
total_header_row_count(headers.iter().map(Repeatable::unwrap));
|
total_header_row_count(headers.iter().map(Repeatable::unwrap));
|
||||||
|
|
||||||
|
let initial_row_count = self.lrows.len();
|
||||||
let placing_at_the_start =
|
let placing_at_the_start =
|
||||||
skipped_region || self.lrows.len() == self.current_header_rows;
|
skipped_region || initial_row_count == self.current_header_rows;
|
||||||
for header in headers {
|
for header in headers {
|
||||||
let header_height = self.layout_header_rows(header.unwrap(), engine, 0)?;
|
let header_height = self.layout_header_rows(header.unwrap(), engine, 0)?;
|
||||||
|
|
||||||
@ -382,6 +383,12 @@ impl<'a> GridLayouter<'a> {
|
|||||||
self.current_header_rows = self.lrows.len();
|
self.current_header_rows = self.lrows.len();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove new headers at the end of the region if upcoming child doesn't fit.
|
||||||
|
// TODO: Short lived if footer comes afterwards
|
||||||
|
if !short_lived {
|
||||||
|
self.lrows_orphan_snapshot = Some(initial_row_count);
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user