summaryrefslogtreecommitdiff
path: root/src/layout/fixed.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-05-17 15:00:29 +0200
committerLaurenz <laurmaedje@gmail.com>2021-05-17 15:00:29 +0200
commit1003d320d40aa46a0a3fba49b09425ead1b4b584 (patch)
tree388a529930e377c84dbd359faee79fc058aa7fe6 /src/layout/fixed.rs
parentfbb823964f409c4c5d95f0a0a07e1eda70406c62 (diff)
Rename expand to fixed and switch to bools
Diffstat (limited to 'src/layout/fixed.rs')
-rw-r--r--src/layout/fixed.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/layout/fixed.rs b/src/layout/fixed.rs
index 04ea5a3a..5905fa95 100644
--- a/src/layout/fixed.rs
+++ b/src/layout/fixed.rs
@@ -31,13 +31,8 @@ impl Layout for FixedNode {
size = Size::new(width, width / aspect);
}
- let fill_if = |cond| if cond { Expand::Fill } else { Expand::Fit };
- let expand = Spec::new(
- fill_if(self.width.is_some()),
- fill_if(self.height.is_some()),
- );
-
- let areas = Areas::once(size, full, expand).with_aspect(self.aspect);
+ let fixed = Spec::new(self.width.is_some(), self.height.is_some());
+ let areas = Areas::once(size, full, fixed).with_aspect(self.aspect);
self.child.layout(ctx, &areas)
}
}