mirror of
https://github.com/typst/typst
synced 2025-07-01 17:52:52 +08:00
use different disambiguators when skipping region
This commit is contained in:
parent
ce41113d9c
commit
3361b3714d
@ -202,7 +202,7 @@ impl<'a> GridLayouter<'a> {
|
|||||||
) -> SourceResult<()> {
|
) -> SourceResult<()> {
|
||||||
// Generate different locations for content in headers across its
|
// Generate different locations for content in headers across its
|
||||||
// repetitions by assigning a unique number for each one.
|
// repetitions by assigning a unique number for each one.
|
||||||
let disambiguator = self.finished.len();
|
let mut disambiguator = self.finished.len();
|
||||||
|
|
||||||
// At first, only consider the height of the given headers. However,
|
// At first, only consider the height of the given headers. However,
|
||||||
// for upcoming regions, we will have to consider repeating headers as
|
// for upcoming regions, we will have to consider repeating headers as
|
||||||
@ -254,18 +254,21 @@ impl<'a> GridLayouter<'a> {
|
|||||||
// if 'full'changes? (Assuming height doesn't change for now...)
|
// if 'full'changes? (Assuming height doesn't change for now...)
|
||||||
if !skipped_region {
|
if !skipped_region {
|
||||||
if let HeadersToLayout::NewHeaders { headers, .. } = headers {
|
if let HeadersToLayout::NewHeaders { headers, .. } = headers {
|
||||||
|
// Update disambiguator as we are re-measuring headers
|
||||||
|
// which were already laid out.
|
||||||
|
disambiguator = self.finished.len();
|
||||||
header_height =
|
header_height =
|
||||||
// Laying out new headers, so we have to consider the
|
// Laying out new headers, so we have to consider the
|
||||||
// combined height of already repeating headers as well
|
// combined height of already repeating headers as well
|
||||||
// when beginning a new region.
|
// when beginning a new region.
|
||||||
self.simulate_header_height(
|
self.simulate_header_height(
|
||||||
self.repeating_headers
|
self.repeating_headers
|
||||||
.iter().copied()
|
.iter().copied()
|
||||||
.chain(self.pending_headers.iter().chain(headers).map(Repeatable::unwrap)),
|
.chain(self.pending_headers.iter().chain(headers).map(Repeatable::unwrap)),
|
||||||
&self.regions,
|
&self.regions,
|
||||||
engine,
|
engine,
|
||||||
disambiguator,
|
disambiguator,
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user