gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

HTML 5544Rust 89Markdown 11TOML 91930 Sutichaykuna

Fix commented out variant of basic example (#526)

ae0e31da6d5ce67dd2fe4b09e8e927b6cb40ce32 · ruwaq Nico Burns · (3 wata ñawpaq) · tayta 3341abe49 · kay commitpi sach'ata qhaway

Semántico sayk'uy · 1

examples/basic.rs

  • ukhunpi t'ikrakurqan fn main

1 qillqakuna · +5 −3

diff --git a/examples/basic.rs b/examples/basic.rs
index 888fd8164..7a5a0fcc2 100644
--- a/examples/basic.rs
+++ b/examples/basic.rs
@@ -17,14 +17,16 @@ fn main() -> Result<(), taffy::TaffyError> {
         &[child],
     )?;
 
+    println!("Compute layout with 100x100 viewport:");
     taffy.compute_layout(
         node,
         Size { height: AvailableSpace::Definite(100.0), width: AvailableSpace::Definite(100.0) },
     )?;
+    println!("node: {:#?}", taffy.layout(node)?);
+    println!("child: {:#?}", taffy.layout(child)?);
 
-    // or just use undefined for 100 x 100
-    // taffy.compute_layout(node, Size::NONE)?;
-
+    println!("Compute layout with undefined (infinite) viewport:");
+    taffy.compute_layout(node, Size::MAX_CONTENT)?;
     println!("node: {:#?}", taffy.layout(node)?);
     println!("child: {:#?}", taffy.layout(child)?);