Skip to content
docsv0.3.0

TuiLayoutEngineInterface

Computes per-node screen-space bounds for a retained {@see TuiNode} tree within a viewport — the TUI analog of a flexbox-style layout pass. Hidden nodes ({@see TuiNode::hidden()}) MUST be excluded from the result. Overlay nodes ({@see TuiNode::overlay()}) are positioned independently of normal document flow (e.g. centered/floating over their parent) and MUST still be included, with their paint order placed above non-overlay siblings via {@see TuiNode::layer()}.

TuiLayoutEngineInterface::layout()

abstract public function layout(Milpa\Live\ValueObjects\Tui\TuiNode $root, Milpa\Live\ValueObjects\Tui\TuiBounds $viewport): Milpa\Live\ValueObjects\Tui\TuiLayoutFrame

Lays out `$root` and its visible descendants within `$viewport`.

Parameters

Parameters of layout()
NameTypeDescription
$rootMilpa\Live\ValueObjects\Tui\TuiNode
$viewportMilpa\Live\ValueObjects\Tui\TuiBounds

Returns

Per-node bounds and nodes keyed by id, plus a paint order where later entries MUST be drawn on top of earlier ones.