Skip to content

Commit

Permalink
Set proper size boundaries for limits in Stack::layout
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Apr 27, 2024
1 parent bb92441 commit c58155a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion widget/src/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ where
renderer: &Renderer,
limits: &layout::Limits,
) -> layout::Node {
let limits = limits.width(self.width).height(self.height);

if self.children.is_empty() {
return layout::Node::new(limits.resolve(
self.width,
Expand All @@ -159,7 +161,6 @@ where
));
}

let limits = limits.width(self.width).height(self.height);
let base = self.children[0].as_widget().layout(
&mut tree.children[0],
renderer,
Expand Down

0 comments on commit c58155a

Please sign in to comment.