mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-19 12:39:11 +00:00
Codechange: Remove deferred nested_array initialization path. (#11640)
Having two ways (`FillNestedArray` and `SetupSmallestSize`) to initialize `Window::nested_array` introduces confusion. Instead, make `FillNestedArray` the canonical way, always call it, and remove init_array from `SetupSmallestSize`.
This commit is contained in:
@@ -106,7 +106,7 @@ public:
|
||||
this->Add(leaf);
|
||||
}
|
||||
|
||||
void SetupSmallestSize(Window *w, bool init_array) override
|
||||
void SetupSmallestSize(Window *w) override
|
||||
{
|
||||
this->smallest_y = 0; // Biggest child.
|
||||
this->fill_x = 1;
|
||||
@@ -116,7 +116,7 @@ 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);
|
||||
child_wid->SetupSmallestSize(w);
|
||||
this->smallest_y = std::max(this->smallest_y, child_wid->smallest_y + child_wid->padding.Vertical());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user