Codechange: Pass by reference to UpdateWidgetSize. (#12457)

These parameters are always provided and not optional.
This commit is contained in:
Peter Nelson
2024-04-09 08:34:45 +01:00
committed by GitHub
parent b5ad28022d
commit de4e00c93f
55 changed files with 602 additions and 602 deletions

View File

@@ -168,18 +168,18 @@ struct GoalListWindow : public Window {
return num;
}
void UpdateWidgetSize(WidgetID widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override
void UpdateWidgetSize(WidgetID widget, Dimension &size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension &fill, [[maybe_unused]] Dimension &resize) override
{
if (widget != WID_GOAL_LIST) return;
Dimension d = GetStringBoundingBox(STR_GOALS_NONE);
resize->width = 1;
resize->height = d.height;
resize.width = 1;
resize.height = d.height;
d.height *= 5;
d.width += WidgetDimensions::scaled.framerect.Horizontal();
d.height += WidgetDimensions::scaled.framerect.Vertical();
*size = maxdim(*size, d);
size = maxdim(size, d);
}
/**
@@ -388,12 +388,12 @@ struct GoalQuestionWindow : public Window {
}
}
void UpdateWidgetSize(WidgetID widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override
void UpdateWidgetSize(WidgetID widget, Dimension &size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension &fill, [[maybe_unused]] Dimension &resize) override
{
if (widget != WID_GQ_QUESTION) return;
SetDParamStr(0, this->question);
size->height = GetStringHeight(STR_JUST_RAW_STRING, size->width);
size.height = GetStringHeight(STR_JUST_RAW_STRING, size.width);
}
void DrawWidget(const Rect &r, WidgetID widget) const override