tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 501HTML 254C 19JavaScript 81414 Definiciones

fix compatibility calculation

7a6c99d2e620908c01a17463883308586616f714 · por Emil Sjölander · (hace 7 años) · padre 33f5ba4b8 · ver el árbol en este commit

Delta semántico · 1

src/algo.rs

1 archivos · +6 −2

diff --git a/src/algo.rs b/src/algo.rs
index 61160842d..e6ae721e5 100644
--- a/src/algo.rs
+++ b/src/algo.rs
@@ -123,11 +123,15 @@ fn compute_internal(
             if let Some(cache) = node.measure_cache.get() {
                 let width_compatible = if let Number::Defined(width) = node_size.width {
                     (width - cache.result.width).abs() < f32::EPSILON
-                } else { true };
+                } else {
+                    cache.constraint.width.is_undefined()
+                };
 
                 let height_compatible = if let Number::Defined(height) = node_size.height {
                     (height - cache.result.height).abs() < f32::EPSILON
-                } else { true };
+                } else {
+                    cache.constraint.height.is_undefined()
+                };
 
                 if cache.constraint == node_size || (width_compatible && height_compatible) {
                     return ComputeResult { size: cache.result, children: vec![] };