Fix crash with large positive sprite x offset in engine preview window

pull/678/head
Jonathan G Rennison 1 month ago
parent 1532c96ca7
commit 8066309074

@ -97,7 +97,7 @@ struct EnginePreviewWindow : Window {
}
this->vehicle_space = std::max<int>(ScaleSpriteTrad(40), y - y_offs);
size->width = std::max(size->width, x - 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;
SetDParam(0, engine);

Loading…
Cancel
Save