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

@@ -78,7 +78,7 @@ struct EnginePreviewWindow : Window {
this->flags |= WF_STICKY;
}
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_EP_QUESTION) return;
@@ -98,11 +98,11 @@ struct EnginePreviewWindow : Window {
}
this->vehicle_space = std::max<int>(ScaleSpriteTrad(40), y - y_offs);
size->width = std::max(size->width, x + std::abs(x_offs));
size.width = std::max(size.width, x + std::abs(x_offs));
SetDParam(0, GetEngineCategoryName(engine));
size->height = GetStringHeight(STR_ENGINE_PREVIEW_MESSAGE, size->width) + WidgetDimensions::scaled.vsep_wide + GetCharacterHeight(FS_NORMAL) + this->vehicle_space;
size.height = GetStringHeight(STR_ENGINE_PREVIEW_MESSAGE, size.width) + WidgetDimensions::scaled.vsep_wide + GetCharacterHeight(FS_NORMAL) + this->vehicle_space;
SetDParam(0, engine);
size->height += GetStringHeight(GetEngineInfoString(engine), size->width);
size.height += GetStringHeight(GetEngineInfoString(engine), size.width);
}
void DrawWidget(const Rect &r, WidgetID widget) const override