summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-04-27 06:08:30 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-04-27 06:08:30 +0200
commitbb9244107c8fee78f9b77f5ab0e4c2c31456d6c4 (patch)
treec8f8805b1c652df3416fe0f1f7a4481082b597a3
parentce12231e22372eea0369f99b8fdfe26aa1240c57 (diff)
downloadiced-bb9244107c8fee78f9b77f5ab0e4c2c31456d6c4.tar.gz
iced-bb9244107c8fee78f9b77f5ab0e4c2c31456d6c4.tar.bz2
iced-bb9244107c8fee78f9b77f5ab0e4c2c31456d6c4.zip
Respect `width` and `height` properties when `Stack` is empty
-rw-r--r--widget/src/stack.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/widget/src/stack.rs b/widget/src/stack.rs
index 8a0ea2eb..2774d035 100644
--- a/widget/src/stack.rs
+++ b/widget/src/stack.rs
@@ -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);