Phosphor::Layout
Splits a Frame into sub-frames according to a list of Constraints.
Construct one via .vertical or .horizontal, then call #split with the
frame to divide. Pure and stateless once built — safe to call #split
every render.
See DESIGN.md § "Layout and Constraint" for the full rationale.
Constructors
Returns a Layout that divides a frame's width among constraints,
left to right, distributing leftover space per flex.
Instance methods
Splits frame into one sub-frame per constraint, in the same order as
constraints.
Sizes are resolved in four passes — fixed (Length/Percentage), then
Min/Max, then Fill (and Min's growth beyond its floor), then
Ratio — each pass claiming from whatever space the previous pass left
behind. flex then decides where any leftover space (only possible
when there's no Fill or Ratio to soak it up) shifts the slots to.
Every pass claims against a shrinking budget, so constraints that don't fit shrink toward zero instead of overflowing the frame — no branch here can panic.