TuiLayoutFrame
The output of {@see \Milpa\Live\Contracts\Tui\TuiLayoutEngineInterface::layout()}: every visible node's computed bounds, an id-indexed node lookup, and the order nodes should be painted in. Only nodes that survived layout (i.e. were not hidden) are present in `$bounds`/`$nodes`/`$paintOrder` — a node's absence from this frame means it was not laid out, not that it has zero-size bounds.
TuiLayoutFrame::__construct()
public function __construct(Milpa\Live\ValueObjects\Tui\TuiNode $root, array $bounds, array $nodes, array $paintOrder):Parameters
| Name | Type | Description |
|---|---|---|
| $root | TuiNode | The tree's root node, as passed to the layout engine. |
| $bounds | array<string, TuiBounds> | Computed bounds for every visible node, keyed by node id. |
| $nodes | array<string, TuiNode> | Every visible node, keyed by its own id. |
| $paintOrder | array<int, string> | Node ids in the order they MUST be painted; later entries (e.g. overlays) are painted on top of earlier ones. |
TuiLayoutFrame::boundsFor()
public function boundsFor(string $id): ?Milpa\Live\ValueObjects\Tui\TuiBoundsThe bounds resolved for this node id, or null when the node is not in the tree.
Parameters
| Name | Type | Description |
|---|---|---|
| $id | string |
Returns
`null` if `$id` was not laid out (e.g. it was hidden, or is not part of this tree).
TuiLayoutFrame::nodeFor()
public function nodeFor(string $id): ?Milpa\Live\ValueObjects\Tui\TuiNodeThe node with this id, or null when it is not in the tree.
Parameters
| Name | Type | Description |
|---|---|---|
| $id | string |
Returns
`null` if `$id` was not laid out (e.g. it was hidden, or is not part of this tree).