summaryrefslogtreecommitdiff
path: root/src/layout/flex.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2019-12-04 19:34:29 +0100
committerLaurenz <laurmaedje@gmail.com>2019-12-04 19:35:28 +0100
commit9fb31defd037a90bf8f9e38fa33acae23a70b269 (patch)
treee0fd887792a59cbb3262a5d3157d0c786df56d60 /src/layout/flex.rs
parentace57c34206a13b4bc3885b944cc51e274f30b0f (diff)
Expand functionality of function! macro 🛰
Diffstat (limited to 'src/layout/flex.rs')
-rw-r--r--src/layout/flex.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/layout/flex.rs b/src/layout/flex.rs
index afca23ec..3e8a64e1 100644
--- a/src/layout/flex.rs
+++ b/src/layout/flex.rs
@@ -14,7 +14,7 @@ pub struct FlexLayouter {
#[derive(Debug, Clone)]
enum FlexUnit {
Boxed(Layout),
- Space(Size, SpaceKind),
+ Space(Size, SpacingKind),
SetAxes(LayoutAxes),
Break,
}
@@ -102,11 +102,11 @@ impl FlexLayouter {
self.units.push(FlexUnit::Break);
}
- pub fn add_primary_space(&mut self, space: Size, kind: SpaceKind) {
+ pub fn add_primary_space(&mut self, space: Size, kind: SpacingKind) {
self.units.push(FlexUnit::Space(space, kind))
}
- pub fn add_secondary_space(&mut self, space: Size, kind: SpaceKind) -> LayoutResult<()> {
+ pub fn add_secondary_space(&mut self, space: Size, kind: SpacingKind) -> LayoutResult<()> {
if !self.run_is_empty() {
self.finish_run()?;
}
@@ -179,7 +179,7 @@ impl FlexLayouter {
debug_render: false,
})?;
- self.stack.add_spacing(self.flex_spacing, SpaceKind::Independent);
+ self.stack.add_spacing(self.flex_spacing, SpacingKind::Independent);
let remaining = self.axes.specialize(Size2D {
x: self.part.usable
@@ -230,7 +230,7 @@ impl FlexLayouter {
while size.x > self.line.usable {
if self.stack.space_is_last() {
- lerr!("box does not fit into line");
+ lr!("box does not fit into line");
}
self.stack.finish_space(true);
@@ -238,7 +238,7 @@ impl FlexLayouter {
}
if let LastSpacing::Soft(space) = self.part.space {
- self.layout_space(space, SpaceKind::Hard);
+ self.layout_space(space, SpacingKind::Hard);
}
let offset = self.part.dimensions.x;
@@ -251,8 +251,8 @@ impl FlexLayouter {
Ok(())
}
- fn layout_space(&mut self, space: Size, kind: SpaceKind) {
- if kind == SpaceKind::Soft {
+ fn layout_space(&mut self, space: Size, kind: SpacingKind) {
+ if kind == SpacingKind::Soft {
if self.part.space != LastSpacing::Forbidden {
self.part.space = LastSpacing::Soft(space);
}
@@ -263,7 +263,7 @@ impl FlexLayouter {
self.part.dimensions.x += space;
}
- if kind == SpaceKind::Hard {
+ if kind == SpacingKind::Hard {
self.part.space = LastSpacing::Forbidden;
}
}