gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 709HTML 662Markdown 12TOML 62348 Definitions

Cargo fmt

3cd5b660e06db4de823304ff2294eb1c47812b1a · by Emil Sjölander · (7 years ago) · parent dce51aaa5 · browse the tree at this commit

Semantic delta · 1

src/algo.rs

1 files · +14 −34

diff --git a/src/algo.rs b/src/algo.rs
index 6bb4d64b4..10b93979b 100644
--- a/src/algo.rs
+++ b/src/algo.rs
@@ -355,17 +355,12 @@ fn compute_internal(
         // webkit handled various scenarios. Can probably be solved better by passing in
         // min-content max-content constraints fromt the top
         let min_main = if is_row {
-            compute_internal(
-                child.node,
-                Size { width: Undefined, height: Undefined },
-                available_space,
-                false,
-            )
-            .size
-            .width
-            .maybe_max(child.min_size.width)
-            .maybe_min(child.size.width)
-            .to_number()
+            compute_internal(child.node, Size { width: Undefined, height: Undefined }, available_space, false)
+                .size
+                .width
+                .maybe_max(child.min_size.width)
+                .maybe_min(child.size.width)
+                .to_number()
         } else {
             child.min_size.main(dir)
         };
@@ -594,17 +589,12 @@ fn compute_internal(
                 // min-content max-content constraints fromt the top. Need to figure out correct thing to do here as
                 // just piling on more conditionals.
                 let min_main = if is_row && child.node.measure.is_none() {
-                    compute_internal(
-                        child.node,
-                        Size { width: Undefined, height: Undefined },
-                        available_space,
-                        false,
-                    )
-                    .size
-                    .width
-                    .maybe_min(child.size.width)
-                    .maybe_max(child.min_size.width)
-                    .to_number()
+                    compute_internal(child.node, Size { width: Undefined, height: Undefined }, available_space, false)
+                        .size
+                        .width
+                        .maybe_min(child.size.width)
+                        .maybe_max(child.min_size.width)
+                        .to_number()
                 } else {
                     child.min_size.main(dir)
                 };
@@ -1039,12 +1029,7 @@ fn compute_internal(
     // layout we are done now.
     if !perform_layout {
         let result = ComputeResult { size: container_size, children: vec![] };
-        node.layout_cache.replace(Some(LayoutCache {
-            node_size,
-            parent_size,
-            perform_layout,
-            result: result.clone(),
-        }));
+        node.layout_cache.replace(Some(LayoutCache { node_size, parent_size, perform_layout, result: result.clone() }));
         return result;
     }
 
@@ -1317,11 +1302,6 @@ fn compute_internal(
     children.sort_by(|c1, c2| c1.order.cmp(&c2.order));
 
     let result = ComputeResult { size: container_size, children };
-    node.layout_cache.replace(Some(LayoutCache {
-        node_size,
-        parent_size,
-        perform_layout,
-        result: result.clone(),
-    }));
+    node.layout_cache.replace(Some(LayoutCache { node_size, parent_size, perform_layout, result: result.clone() }));
     result
 }