summaryrefslogtreecommitdiff
path: root/src/layout/flex.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/layout/flex.rs')
-rw-r--r--src/layout/flex.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/layout/flex.rs b/src/layout/flex.rs
index c136ad0d..a65391da 100644
--- a/src/layout/flex.rs
+++ b/src/layout/flex.rs
@@ -129,7 +129,7 @@ impl FlexLayouter {
/// Layout a content box into the current flex run or start a new run if
/// it does not fit.
fn layout_box(&mut self, boxed: Layout) -> LayoutResult<()> {
- let size = boxed.dimensions.generalized(self.ctx.axes);
+ let size = self.ctx.axes.generalize(boxed.dimensions);
let space = self.space.unwrap_or(Size::zero());
let new_run_size = self.run.size.x + space + size.x;
@@ -166,14 +166,14 @@ impl FlexLayouter {
fn finish_run(&mut self) -> LayoutResult<()> {
let mut actions = LayoutActionList::new();
for (x, layout) in self.run.content.drain(..) {
- let position = Size2D::with_x(x).specialized(self.ctx.axes);
+ let position = self.ctx.axes.specialize(Size2D::with_x(x));
actions.add_layout(position, layout);
}
self.run.size.y += self.ctx.flex_spacing;
self.stack.add(Layout {
- dimensions: self.run.size.specialized(self.ctx.axes),
+ dimensions: self.ctx.axes.specialize(self.run.size),
actions: actions.into_vec(),
debug_render: false,
})?;
@@ -183,6 +183,11 @@ impl FlexLayouter {
Ok(())
}
+ /// Update the axes in use by this flex layouter.
+ pub fn set_axes(&self, axes: LayoutAxes) {
+
+ }
+
/// This layouter's context.
pub fn ctx(&self) -> FlexContext {
self.ctx