Skip to content
docsv0.3.0

SimpleTuiLayoutEngine

Resolves a node tree into absolute bounds plus a paint order. Stacks children vertically inside their parent and clips to the viewport, so a renderer never has to compute geometry — it is handed the rectangle it may paint.

SimpleTuiLayoutEngine::layout()

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

Resolves the tree into per-node bounds and a paint order, clipped to the viewport.

Parameters

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