Change: Use RectPadding for widget padding/uz_padding.

This commit is contained in:
Peter Nelson
2022-09-28 19:05:36 +01:00
committed by PeterN
parent 75b222b0d9
commit 04cbe57d2a
5 changed files with 96 additions and 104 deletions

View File

@@ -1354,10 +1354,10 @@ public:
/* First initialise some variables... */
for (NWidgetBase *child_wid = this->head; child_wid != nullptr; child_wid = child_wid->next) {
child_wid->SetupSmallestSize(w, init_array);
this->smallest_y = std::max(this->smallest_y, child_wid->smallest_y + child_wid->padding_top + child_wid->padding_bottom);
this->smallest_y = std::max(this->smallest_y, child_wid->smallest_y + child_wid->padding.top + child_wid->padding.bottom);
if (this->IsButton(child_wid->type)) {
nbuttons++;
this->smallest_x = std::max(this->smallest_x, child_wid->smallest_x + child_wid->padding_left + child_wid->padding_right);
this->smallest_x = std::max(this->smallest_x, child_wid->smallest_x + child_wid->padding.left + child_wid->padding.right);
} else if (child_wid->type == NWID_SPACER) {
this->spacers++;
}