summaryrefslogtreecommitdiff
path: root/src/layout/flex.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2019-11-30 18:54:46 +0100
committerLaurenz <laurmaedje@gmail.com>2019-11-30 18:54:46 +0100
commit5782b82770f6923677942c3b4e2bf4f7258e47d8 (patch)
tree2b477fc285e9da5380e556648056b985ecbccfe0 /src/layout/flex.rs
parentb13ed627fff73a599b34d760cd99aa2f08d58ea8 (diff)
Refactor layouting base ♻
Diffstat (limited to 'src/layout/flex.rs')
-rw-r--r--src/layout/flex.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/layout/flex.rs b/src/layout/flex.rs
index 53f6dfdf..96b2aa85 100644
--- a/src/layout/flex.rs
+++ b/src/layout/flex.rs
@@ -41,7 +41,7 @@ struct PartialLine {
usable: Size,
content: Vec<(Size, Layout)>,
dimensions: Size2D,
- space: SpaceState,
+ space: LastSpacing,
}
impl PartialLine {
@@ -50,7 +50,7 @@ impl PartialLine {
usable,
content: vec![],
dimensions: Size2D::zero(),
- space: SpaceState::Forbidden,
+ space: LastSpacing::Forbidden,
}
}
}
@@ -237,7 +237,7 @@ impl FlexLayouter {
}
}
- if let SpaceState::Soft(space) = self.part.space {
+ if let LastSpacing::Soft(space) = self.part.space {
self.layout_space(space, SpaceKind::Hard);
}
@@ -246,15 +246,15 @@ impl FlexLayouter {
self.part.dimensions.x += size.x;
self.part.dimensions.y.max_eq(size.y);
- self.part.space = SpaceState::Allowed;
+ self.part.space = LastSpacing::Allowed;
Ok(())
}
fn layout_space(&mut self, space: Size, kind: SpaceKind) {
if kind == SpaceKind::Soft {
- if self.part.space != SpaceState::Forbidden {
- self.part.space = SpaceState::Soft(space);
+ if self.part.space != LastSpacing::Forbidden {
+ self.part.space = LastSpacing::Soft(space);
}
} else {
if self.part.dimensions.x + space > self.part.usable {
@@ -264,7 +264,7 @@ impl FlexLayouter {
}
if kind == SpaceKind::Hard {
- self.part.space = SpaceState::Forbidden;
+ self.part.space = LastSpacing::Forbidden;
}
}
}