|
TachyonUI 0.1.0
High-performance UI for building tools.
|
Computes element sizes and positions from styles, content and constraints, in four passes run after construction: More...
#include <gui_core/layout/gui_layout_engine.h>
Public Member Functions | |
| LayoutEngine (ITextSystem &textSystem, ScrollManagement &scrollManagement) noexcept | |
| void | Layout (OSWindowManager &osWindowManager, ElementStorage &storage) |
| Lays out every element in storage; call after EndConstruction. | |
Computes element sizes and positions from styles, content and constraints, in four passes run after construction:
1. Horizontal sizing - bottom-up natural widths 2. Horizontal positioning - top-down flex distribution, X positions 3. Vertical sizing - bottom-up natural heights, with final widths 4. Vertical positioning - top-down flex distribution, Y positions
A wrapping flex column breaks its lines on heights in pass 2, so pass 2 sizes its subtree vertically first, from the widths so far (pass 3 sizes it again).
Flex grow / shrink happens in the positioning passes, where the parent's final size is known; it cascades from ancestor to descendant.
|
inlineexplicitnoexcept |
| void tachyon::LayoutEngine::Layout | ( | OSWindowManager & | osWindowManager, |
| ElementStorage & | storage ) |
Lays out every element in storage; call after EndConstruction.