pub fn compute(widget: &Widget, avail_w: f32, avail_h: f32) -> LayoutNodeExpand description
Compute layout starting at (0,0) with given available size. Returns the root LayoutNode with absolute coordinates.
Sizing rules (CSS-flexbox-like, single pass per container):
- A
Units::Percentsize resolves exactly once, against the parent’s content box (its size minus padding and scrollbar strip) on the same axis — in both a Row and a Column, at any depth. While a parent is still being measured for content on an axis (an auto size along an unbounded axis), a percent along that axis acts asAutountil the parent’s final size is known. flex(andDock::Fill) grows a child into the parent’s free main-axis space; the grown size sticks and the child’s own children lay out against it. A growing child with an auto main size starts from its min size instead of its content (like WPF star sizing), so it fills exactly the free space — ascroll_viewscrolls the rest, and nothing nested inside can push the child’s siblings out of the parent.