pub struct LayoutEngine { /* private fields */ }Expand description
Layout engine with memoization.
Implementations§
Source§impl LayoutEngine
impl LayoutEngine
Sourcepub fn compute(&mut self, root: &mut dyn Widget, viewport: Size) -> LayoutTree
pub fn compute(&mut self, root: &mut dyn Widget, viewport: Size) -> LayoutTree
Compute layout for the widget tree.
This performs a two-phase layout:
- Measure phase (bottom-up): Determine intrinsic sizes
- Layout phase (top-down): Assign final positions and sizes
Sourcepub fn compute_readonly(
&mut self,
root: &dyn Widget,
viewport: Size,
) -> LayoutTree
pub fn compute_readonly( &mut self, root: &dyn Widget, viewport: Size, ) -> LayoutTree
Compute layout with read-only widget tree (for measurement only).
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear the layout cache.
Sourcepub const fn cache_stats(&self) -> (usize, usize)
pub const fn cache_stats(&self) -> (usize, usize)
Get cache statistics.
Trait Implementations§
Source§impl Debug for LayoutEngine
impl Debug for LayoutEngine
Source§impl Default for LayoutEngine
impl Default for LayoutEngine
Source§fn default() -> LayoutEngine
fn default() -> LayoutEngine
Returns the “default value” for a type. Read more