summaryrefslogtreecommitdiffstats
path: root/native/src/widget/container.rs
diff options
context:
space:
mode:
Diffstat (limited to 'native/src/widget/container.rs')
-rw-r--r--native/src/widget/container.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/native/src/widget/container.rs b/native/src/widget/container.rs
index 2afad3f2..cc886dcb 100644
--- a/native/src/widget/container.rs
+++ b/native/src/widget/container.rs
@@ -293,11 +293,13 @@ pub fn layout<Renderer>(
.max_width(max_width)
.max_height(max_height)
.width(width)
- .height(height)
- .pad(padding);
+ .height(height);
- let mut content = layout_content(renderer, &limits.loose());
- let size = limits.resolve(content.size());
+ let mut content = layout_content(renderer, &limits.pad(padding).loose());
+
+ let padding = padding.constrain(content.size(), limits.max());
+
+ let size = limits.pad(padding).resolve(content.size());
content.move_to(Point::new(padding.left.into(), padding.top.into()));
content.align(