Skip to content

Commit

Permalink
Fix case where Taffy allowed margins to collapse through an element w…
Browse files Browse the repository at this point in the history
…hen it shouldn't have (#695)
  • Loading branch information
nicoburns authored Jul 16, 2024
1 parent 3bc35ec commit a2378a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/compute/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 3 additions & 1 deletion src/compute/leaf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a2378a7

Please sign in to comment.