tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 583HTML 275Markdown 8TOML 41586 Definiciones

Fix case where Taffy allowed margins to collapse through an element when it shouldn't have (#695)

a2378a72fe6ebf86969bb5e9c5b15ff351bf086c · por Nico Burns · (hace 2 años) · padre 3bc35ec3b · ver el árbol en este commit

Delta semántico · 2

src/compute/block.rs

src/compute/leaf.rs

2 archivos · +6 −2

diff --git a/src/compute/block.rs b/src/compute/block.rs
index 7e0bc1aa5..512e885fa 100644
--- a/src/compute/block.rs
+++ b/src/compute/block.rs
@@ -186,7 +186,9 @@ fn compute_inner(tree: &mut impl LayoutBlockContainer, node_id: NodeId, inputs:
         || padding.top > 0.0
         || padding.bottom > 0.0
         || border.top > 0.0
-        || border.bottom > 0.0;
+        || border.bottom > 0.0
+        || matches!(size.height, Some(h) if h > 0.0)
+        || matches!(min_size.height, Some(h) if h > 0.0);
 
     drop(style);
 
diff --git a/src/compute/leaf.rs b/src/compute/leaf.rs
index 0c3f5a0af..c05d54eb2 100644
--- a/src/compute/leaf.rs
+++ b/src/compute/leaf.rs
@@ -78,7 +78,9 @@ where
         || padding.top > 0.0
         || padding.bottom > 0.0
         || border.top > 0.0
-        || border.bottom > 0.0;
+        || border.bottom > 0.0
+        || matches!(node_size.height, Some(h) if h > 0.0)
+        || matches!(node_min_size.height, Some(h) if h > 0.0);
 
     debug_log!("LEAF");
     debug_log!("node_size", dbg:node_size);