Skip to main content

compute_layout

Function compute_layout 

Source
pub fn compute_layout(
    root: NodeId,
    width: AvailableSpace,
    height: AvailableSpace,
) -> Result<(), LayoutError>
Expand description

Lays out root against the given space and reflects the result into each node’s rect signal. Collects the (signal, rect) updates while holding the runtime borrow, then applies them in a batch after releasing it — a rect .set() can flush effects, and one of those may itself touch the layout runtime (a reactive list), which would re-enter the borrow.