summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ui.cpp8
1 files 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;