summaryrefslogtreecommitdiff
path: root/src/layout/grid.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-06-27 19:02:23 +0200
committerGitHub <noreply@github.com>2021-06-27 19:02:23 +0200
commitd8d60207ef1833001196feccb84cc0c78bdd84df (patch)
treecdc2130d8b4265c52863f10418842d188afb63e8 /src/layout/grid.rs
parentf64c772b6d969fa3aa1a7391a3d8118b21430434 (diff)
parente9960b89424ab67e633076ccc9f8c420316b076a (diff)
Merge pull request #33 from typst/cache-patterns
A test framework for incremental compilation
Diffstat (limited to 'src/layout/grid.rs')
-rw-r--r--src/layout/grid.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/layout/grid.rs b/src/layout/grid.rs
index d2976502..33fce064 100644
--- a/src/layout/grid.rs
+++ b/src/layout/grid.rs
@@ -56,6 +56,8 @@ struct GridLayouter<'a> {
cross: SpecAxis,
/// The axis of the main direction.
main: SpecAxis,
+ /// The original expand state of the target region.
+ expand: Spec<bool>,
/// The column tracks including gutter tracks.
cols: Vec<TrackSizing>,
/// The row tracks including gutter tracks.
@@ -135,7 +137,8 @@ impl<'a> GridLayouter<'a> {
let full = regions.current.get(main);
let rcols = vec![Length::zero(); cols.len()];
- // We use the regions only for auto row measurement.
+ // We use the regions only for auto row measurement and constraints.
+ let expand = regions.expand;
regions.expand = Gen::new(true, false).to_spec(main);
Self {
@@ -144,8 +147,9 @@ impl<'a> GridLayouter<'a> {
cols,
rows,
children: &grid.children,
- constraints: Constraints::new(regions.expand),
+ constraints: Constraints::new(expand),
regions,
+ expand,
rcols,
lrows: vec![],
full,
@@ -506,7 +510,7 @@ impl<'a> GridLayouter<'a> {
self.used.main = Length::zero();
self.fr = Fractional::zero();
self.finished.push(output.constrain(self.constraints));
- self.constraints = Constraints::new(self.regions.expand);
+ self.constraints = Constraints::new(self.expand);
}
/// Get the node in the cell in column `x` and row `y`.