mirror of
https://github.com/typst/typst
synced 2025-05-18 02:55:28 +08:00
delete now unused header_height
field
This commit is contained in:
parent
78c87c811d
commit
be12824af2
@ -122,8 +122,13 @@ pub(super) struct Current {
|
||||
/// until they fit and are not orphans in at least one region (or exactly
|
||||
/// one, for non-repeated headers).
|
||||
pub(super) lrows_orphan_snapshot: Option<usize>,
|
||||
/// The total simulated height for all headers currently in
|
||||
/// `repeating_headers` and `pending_headers`.
|
||||
/// The height of effectively repeating headers, that is, ignoring
|
||||
/// non-repeating pending headers, in the current region.
|
||||
///
|
||||
/// This is used by multi-page auto rows so they can inform cell layout on
|
||||
/// how much space should be taken by headers if they break across regions.
|
||||
/// In particular, non-repeating headers only occupy the initial region,
|
||||
/// but disappear on new regions, so they can be ignored.
|
||||
///
|
||||
/// This field is reset on each new region and properly updated by
|
||||
/// `layout_auto_row` and `layout_relative_row`, and should not be read
|
||||
@ -135,14 +140,6 @@ pub(super) struct Current {
|
||||
/// updated whenever a new header is found, subtracting the height of
|
||||
/// headers which stopped repeating and adding the height of all new
|
||||
/// headers.
|
||||
pub(super) header_height: Abs,
|
||||
/// The height of effectively repeating headers, that is, ignoring
|
||||
/// non-repeating pending headers.
|
||||
///
|
||||
/// This is used by multi-page auto rows so they can inform cell layout on
|
||||
/// how much space should be taken by headers if they break across regions.
|
||||
/// In particular, non-repeating headers only occupy the initial region,
|
||||
/// but disappear on new regions, so they can be ignored.
|
||||
pub(super) repeating_header_height: Abs,
|
||||
/// The height for each repeating header that was placed in this region.
|
||||
/// Note that this includes headers not at the top of the region, before
|
||||
@ -261,7 +258,6 @@ impl<'a> GridLayouter<'a> {
|
||||
repeated_header_rows: 0,
|
||||
last_repeated_header_end: 0,
|
||||
lrows_orphan_snapshot: None,
|
||||
header_height: Abs::zero(),
|
||||
repeating_header_height: Abs::zero(),
|
||||
repeating_header_heights: vec![],
|
||||
footer_height: Abs::zero(),
|
||||
@ -1731,7 +1727,6 @@ impl<'a> GridLayouter<'a> {
|
||||
if !last {
|
||||
self.current.repeated_header_rows = 0;
|
||||
self.current.last_repeated_header_end = 0;
|
||||
self.current.header_height = Abs::zero();
|
||||
self.current.repeating_header_height = Abs::zero();
|
||||
self.current.repeating_header_heights.clear();
|
||||
|
||||
|
@ -138,11 +138,6 @@ impl<'a> GridLayouter<'a> {
|
||||
self.current.repeating_header_height -= removed_height;
|
||||
}
|
||||
|
||||
// Non-repeating headers stop at the pending stage for orphan
|
||||
// prevention only. Flushing pending headers, so those will no longer
|
||||
// appear in a future region.
|
||||
self.current.header_height = self.current.repeating_header_height;
|
||||
|
||||
// Let's try to place them at least once.
|
||||
// This might be a waste as we could generate an orphan and thus have
|
||||
// to try to place old and new headers all over again, but that happens
|
||||
@ -280,7 +275,6 @@ impl<'a> GridLayouter<'a> {
|
||||
|
||||
// Reset the header height for this region.
|
||||
// It will be re-calculated when laying out each header row.
|
||||
self.current.header_height = Abs::zero();
|
||||
self.current.repeating_header_height = Abs::zero();
|
||||
self.current.repeating_header_heights.clear();
|
||||
|
||||
@ -306,7 +300,6 @@ impl<'a> GridLayouter<'a> {
|
||||
while let Some(&header) = self.repeating_headers.get(i) {
|
||||
let header_height =
|
||||
self.layout_header_rows(header, engine, disambiguator, false)?;
|
||||
self.current.header_height += header_height;
|
||||
self.current.repeating_header_height += header_height;
|
||||
|
||||
// We assume that this vector will be sorted according
|
||||
@ -338,7 +331,6 @@ impl<'a> GridLayouter<'a> {
|
||||
for header in self.pending_headers {
|
||||
let header_height =
|
||||
self.layout_header_rows(header.unwrap(), engine, disambiguator, false)?;
|
||||
self.current.header_height += header_height;
|
||||
if matches!(header, Repeatable::Repeated(_)) {
|
||||
self.current.repeating_header_height += header_height;
|
||||
self.current.repeating_header_heights.push(header_height);
|
||||
@ -418,12 +410,9 @@ impl<'a> GridLayouter<'a> {
|
||||
// it is guaranteed this header won't appear in a future
|
||||
// region, so multi-page rows and cells can effectively ignore
|
||||
// this header.
|
||||
if !short_lived {
|
||||
self.current.header_height += header_height;
|
||||
if matches!(header, Repeatable::Repeated(_)) {
|
||||
self.current.repeating_header_height += header_height;
|
||||
self.current.repeating_header_heights.push(header_height);
|
||||
}
|
||||
if !short_lived && matches!(header, Repeatable::Repeated(_)) {
|
||||
self.current.repeating_header_height += header_height;
|
||||
self.current.repeating_header_heights.push(header_height);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user