frus-layout
frus's layout engine: it turns a tree of styled nodes into positioned rectangles.
Layer: Foundations. Flexbox comes from taffy,
kept behind frus's own types so it can be replaced without breaking the API. It does not
know what a widget is. See
ARCHITECTURE.md.
What you reach for
Layout: the node tree. Add leaves and containers,computeit, read the rects back.Style, withDimension,FlexDirection,JustifyandAlign: what a node asks for.Overflowing: whatLayout::overflowsreports when children do not fit their parent.
Example
use ;
let fixed = ;
let mut layout: = new;
let a = layout.leaf;
let b = layout.leaf;
let row = layout.container;
layout.compute;
let rects = layout.absolute_rects;
let = rects.iter.find.unwrap;
assert_eq!;
Part of frus
Widgets build their layout through this crate; an application describes layout with widgets instead. See the workspace README. Licensed under MIT or Apache-2.0.