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
Splitterdivides.
Functions§
- relax_
weight - The closed form for
Splitter::relax: the weight to give a pane currently sizedpane_sizeso 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; iffree_space <= 0falls back to1.0. - solve
- Apportion
totalcells acrossslots, honoring each[min, max]and distributing the remaining free space byweight. Deterministic (largest-remainder rounding); the returned sizes always sum tototal.max(sum_of_mins-clamped)and never violate a slot’s bounds.