Trait taffy::RoundTree

source ·
pub trait RoundTree: TraverseTree {
    // Required methods
    fn get_unrounded_layout(&self, node_id: NodeId) -> &Layout;
    fn set_final_layout(&mut self, node_id: NodeId, layout: &Layout);
}
Expand description

Trait used by the round_layout method which takes a tree of unrounded float-valued layouts and performs rounding to snap the values to the pixel grid.

As indicated by it’s dependence on TraverseTree, it required full recursive access to the tree.

Required Methods§

source

fn get_unrounded_layout(&self, node_id: NodeId) -> &Layout

Get the node’s unrounded layout

source

fn set_final_layout(&mut self, node_id: NodeId, layout: &Layout)

Get a reference to the node’s final layout

Object Safety§

This trait is not object safe.

Implementors§