* Adds a helper method `unrounded_layout` to `TaffyTree` that allows access to the unrounded node layout values for individual nodes without toggling the `use_rounding` setting for the entire tree.
* Removed the `TaffyResult` wrapper from the returned value.
diff --git a/src/tree/taffy_tree.rs b/src/tree/taffy_tree.rs
index 69bcc43c4..9cb0a6a4a 100644
--- a/src/tree/taffy_tree.rs
+++ b/src/tree/taffy_tree.rs
@@ -795,6 +795,11 @@ impl<NodeContext> TaffyTree<NodeContext> {
}
}
+ /// Returns this node layout with unrounded values relative to its parent.
+ pub fn unrounded_layout(&self, node: NodeId) -> &Layout {
+ &self.nodes[node.into()].unrounded_layout
+ }
+
/// Marks the layout of this node and its ancestors as outdated
///
/// WARNING: this may stack-overflow if the tree contains a cycle