Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
WIP
Nathan Sobo6d1032879645
diff --git a/crates/gpui/playground/ui/src/node.rs b/crates/gpui/playground/ui/src/node.rsindex 36d85c09b24..ea1eb4bc1e5 100644--- a/crates/gpui/playground/ui/src/node.rs+++ b/crates/gpui/playground/ui/src/node.rs@@ -355,8 +355,8 @@ impl<V: View> Node<V> {dbg!(self.id_as_string());for axis in [Axis2d::X, Axis2d::Y] {- dbg!(axis);let length = self.style.size.get(axis);+ dbg!(axis, length);match length {Length::Fixed(fixed_length) => {@@ -364,7 +364,8 @@ impl<V: View> Node<V> {// before laying out the children.let fixed_length = fixed_length.to_pixels(rem_pixels);let mut remaining_flex = total_flex.get(axis);- let mut remaining_length = padded_constraint.max.get(axis) - fixed_length;+ let mut remaining_length =+ (padded_constraint.max.get(axis) - fixed_length).max(0.);// Here we avoid the padding exceeding the fixed length by giving// the padding calculation its own remaining_flex and remaining_length.@@ -379,7 +380,7 @@ impl<V: View> Node<V> {rem_pixels,);remaining_flex -= padding_flex;- remaining_length -= padding_flex;+ remaining_length -= padding_length;layout.margins.compute_flex_edges(&self.style.margins,axis,@@ -388,6 +389,8 @@ impl<V: View> Node<V> {rem_pixels,);+ dbg!(remaining_flex, remaining_length);+child_constraint.max.set(axis, remaining_length);if axis == cross_axis {child_constraint.min.set(axis, remaining_length);