Respect width and height properties when Stack is empty

This commit is contained in:
Héctor Ramón Jiménez 2024-04-27 06:08:30 +02:00
parent ce12231e22
commit bb9244107c
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -152,7 +152,11 @@ where
limits: &layout::Limits,
) -> layout::Node {
if self.children.is_empty() {
return layout::Node::new(Size::ZERO);
return layout::Node::new(limits.resolve(
self.width,
self.height,
Size::ZERO,
));
}
let limits = limits.width(self.width).height(self.height);