Skip to content

Commit

Permalink
Use Limits::resolve in Stack widget
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Apr 25, 2024
1 parent 99434b3 commit 5acda41
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions widget/src/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,15 @@ where
return layout::Node::new(Size::ZERO);
}

let limits = limits.width(self.width).height(self.height);

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

let size = base.size();
let size = limits.resolve(self.width, self.height, base.size());
let limits = layout::Limits::new(Size::ZERO, size);

let nodes = std::iter::once(base)
Expand Down

0 comments on commit 5acda41

Please sign in to comment.