diff options
author | quou <quou@disroot.org> | 2024-12-31 14:00:37 +1100 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-12-31 14:00:37 +1100 |
commit | ae7824be86ecc53752a3bee1038c0677ac203cf7 (patch) | |
tree | 05008d81f598ac12448d136bc64a05953b620a95 /ui.cpp | |
parent | 92c41a7f7c5c96d07476f04a3bded2a8d04d2204 (diff) |
correct the container layout
Diffstat (limited to 'ui.cpp')
-rw-r--r-- | ui.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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; |