pub struct TaffyEngine { /* private fields */ }Expand description
Taffy 0.10 backend.
Invariant: every dom id in id_map has a valid NodeId in tree.
Implementations§
Source§impl TaffyEngine
impl TaffyEngine
Sourcepub fn computed_absolute(&self, id: u32) -> Option<Rect>
pub fn computed_absolute(&self, id: u32) -> Option<Rect>
The node’s rounded ABSOLUTE (root-relative) rect — x/y are the sum
of the rounded parent-relative offsets down the ancestor chain (the
integer cell where the renderer paints the node); width/height are
identical to LayoutEngine::computed’s.
ADDITIVE companion to computed (which stays parent-relative —
wire/API covenant): produced by the same round_node post-pass, so the
two are coherent per calculate. Returns None for unknown, freed,
or never-calculated ids. A node detached AFTER the last calculate
(remove_child without destroy) serves its last-calculated rect
until the next calculate evicts it — the same staleness contract as
rounded (see destroy’s eviction note). No live-taffy fallback
like computed’s: an absolute position requires the ancestor chain
walked by calculate, which a not-yet-calculated node does not have.
The rendered path (build → calculate → read) never hits that case.
Trait Implementations§
Source§impl Default for TaffyEngine
impl Default for TaffyEngine
Source§impl LayoutEngine for TaffyEngine
impl LayoutEngine for TaffyEngine
Source§fn create(&mut self, id: u32) -> Result<(), String>
fn create(&mut self, id: u32) -> Result<(), String>
Source§fn apply_style(&mut self, id: u32, style: &Style) -> Result<(), String>
fn apply_style(&mut self, id: u32, style: &Style) -> Result<(), String>
id. Read moreSource§fn set_measure(&mut self, id: u32, f: Box<MeasureFn>)
fn set_measure(&mut self, id: u32, f: Box<MeasureFn>)
id. Read more