summaryrefslogtreecommitdiff
path: root/src/layout/line.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-10-05 16:34:20 +0200
committerLaurenz <laurmaedje@gmail.com>2020-10-05 16:44:35 +0200
commit5a7a32a9bafbcc69077e7766451310ab5ece62bf (patch)
tree29d5fc9ec380c2bd1b63bff1fd605408e8f53eea /src/layout/line.rs
parent93eaafb236bba73cd72c8cd142279366b8afa0be (diff)
Streamline generic layouting primitives 🛫
Diffstat (limited to 'src/layout/line.rs')
-rw-r--r--src/layout/line.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/layout/line.rs b/src/layout/line.rs
index 19ec053d..745a0d14 100644
--- a/src/layout/line.rs
+++ b/src/layout/line.rs
@@ -67,7 +67,7 @@ impl LineLayouter {
} else if align.primary > prev.primary {
let mut rest_run = LineRun::new();
- let usable = self.stack.usable().primary(sys);
+ let usable = self.stack.usable().get(sys.primary.axis());
rest_run.usable = Some(match align.primary {
GenAlign::Start => unreachable!("start > x"),
GenAlign::Center => usable - 2.0 * self.run.size.width,
@@ -181,7 +181,7 @@ impl LineLayouter {
/// it will fit into this layouter's underlying stack.
pub fn remaining(&self) -> Vec<LayoutSpace> {
let mut spaces = self.stack.remaining();
- *spaces[0].size.secondary_mut(self.ctx.sys) -= self.run.size.height;
+ *spaces[0].size.get_mut(self.ctx.sys.secondary.axis()) -= self.run.size.height;
spaces
}
@@ -213,7 +213,11 @@ impl LineLayouter {
for (offset, child) in layouts {
let x = match self.ctx.sys.primary.is_positive() {
true => offset,
- false => self.run.size.width - offset - child.size.primary(self.ctx.sys),
+ false => {
+ self.run.size.width
+ - offset
+ - child.size.get(self.ctx.sys.primary.axis())
+ }
};
let pos = Point::new(x, 0.0);