From ae7824be86ecc53752a3bee1038c0677ac203cf7 Mon Sep 17 00:00:00 2001 From: quou Date: Tue, 31 Dec 2024 14:00:37 +1100 Subject: correct the container layout --- ui.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ui.cpp b/ui.cpp index 327d577..2ed1c7b 100644 --- a/ui.cpp +++ b/ui.cpp @@ -763,11 +763,13 @@ UI::Rect UI::Container::layout(const Rect& avail) { clip = avail; clip.clip(ui->area); for (child = children; child; child = child->next) { + int h; Rect r = child->layout(area); - area.y += r.h + padding; - area.h -= r.h; + h = r.h + padding; + area.y += h; + area.h -= h; if (r.w > used.w) used.w = r.w; - used.h += r.h; + used.h += h; } bound = used; return used; -- cgit v1.2.3-54-g00ecf