tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 788HTML 740Markdown 12TOML 62536 Definiciones

`unrounded_layout` helper method (#765)

* 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.

b3aeb2ecb74fed0c86761b57213e95048efc1de9 · por ickshonpe · (hace 1 año) · padre 5c7c91413 · ver el árbol en este commit

Delta semántico · 1

src/tree/taffy_tree.rs

1 archivos · +5 −0

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