Calculate the final layout for a component
The component's box model
The measured size from measure()
Available space constraints
Optional position (x, y) - defaults to (0, 0)
Computed layout with final dimensions and content area
Measure the size needed for a component based on its box model and content size
The component's box model
The size of the component's content
Measured size including padding and margins
Calculate position relative to parent layout
The component's computed layout
The parent's computed layout
Updated layout with position relative to parent
StaticgetGet the shared singleton instance. Creates the instance on first access.
Layout Engine
Pure service for calculating component layouts. Takes box model + constraints → computed layout.
Implemented as a singleton since it's stateless - all methods are pure functions.