Guide API
Skip to main content

Module layout

Module layout 

Source
Expand description

Pure layout math for the splitter: constraint types + the flexbox solver. No view, no rendering — fully unit-testable.

Structs§

Constraints
How a pane claims space along the splitter axis. min == max ⇒ a fixed pane.
Slot
One pane’s solver input: its hard bounds plus a mutable effective weight (seeded from Constraints.weight, mutated by drags/relax). Fixed panes (min == max) carry weight 0 and take no free space.

Enums§

Orientation
Which axis a Splitter divides.

Functions§

relax_weight
The closed form for Splitter::relax: the weight to give a pane currently sized pane_size so that making it flexible does not move any divider. other_weights = sum of the currently flexible panes’ weights; free_space = current free cells (total content minus the sum of mins). Returns the weight; if free_space <= 0 falls back to 1.0.
solve
Apportion total cells across slots, honoring each [min, max] and distributing the remaining free space by weight. Deterministic (largest-remainder rounding); the returned sizes always sum to total.max(sum_of_mins-clamped) and never violate a slot’s bounds.