Codechange: Pass by reference to UpdateWidgetSize. (#12457)
These parameters are always provided and not optional.
This commit is contained in:
@@ -189,16 +189,16 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_EM_MESSAGE: {
|
||||
CopyInDParam(this->params);
|
||||
if (this->textref_stack_size > 0) StartTextRefStackUsage(this->textref_stack_grffile, this->textref_stack_size, this->textref_stack);
|
||||
|
||||
this->height_summary = GetStringHeight(this->summary_msg, size->width);
|
||||
this->height_detailed = (this->detailed_msg == INVALID_STRING_ID) ? 0 : GetStringHeight(this->detailed_msg, size->width);
|
||||
this->height_extra = (this->extra_msg == INVALID_STRING_ID) ? 0 : GetStringHeight(this->extra_msg, size->width);
|
||||
this->height_summary = GetStringHeight(this->summary_msg, size.width);
|
||||
this->height_detailed = (this->detailed_msg == INVALID_STRING_ID) ? 0 : GetStringHeight(this->detailed_msg, size.width);
|
||||
this->height_extra = (this->extra_msg == INVALID_STRING_ID) ? 0 : GetStringHeight(this->extra_msg, size.width);
|
||||
|
||||
if (this->textref_stack_size > 0) StopTextRefStackUsage();
|
||||
|
||||
@@ -206,11 +206,11 @@ public:
|
||||
if (this->detailed_msg != INVALID_STRING_ID) panel_height += this->height_detailed + WidgetDimensions::scaled.vsep_wide;
|
||||
if (this->extra_msg != INVALID_STRING_ID) panel_height += this->height_extra + WidgetDimensions::scaled.vsep_wide;
|
||||
|
||||
size->height = std::max(size->height, panel_height);
|
||||
size.height = std::max(size.height, panel_height);
|
||||
break;
|
||||
}
|
||||
case WID_EM_FACE:
|
||||
*size = maxdim(*size, GetScaledSpriteSize(SPR_GRADIENT));
|
||||
size = maxdim(size, GetScaledSpriteSize(SPR_GRADIENT));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user