Codechange: Pass by reference to UpdateWidgetSize. (#12457)
These parameters are always provided and not optional.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user