Skip to content
docsv0.3.0

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

Parameters of __construct()
NameTypeDescription
$rootTuiNodeThe tree's root node, as passed to the layout engine.
$boundsarray<string, TuiBounds>Computed bounds for every visible node, keyed by node id.
$nodesarray<string, TuiNode>Every visible node, keyed by its own id.
$paintOrderarray<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\TuiBounds

The bounds resolved for this node id, or null when the node is not in the tree.

Parameters

Parameters of boundsFor()
NameTypeDescription
$idstring

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\TuiNode

The node with this id, or null when it is not in the tree.

Parameters

Parameters of nodeFor()
NameTypeDescription
$idstring

Returns

`null` if `$id` was not laid out (e.g. it was hidden, or is not part of this tree).