mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 23:50:25 +00:00
Fix #12305: Crash with large positive sprite x offset in engine preview window
This commit is contained in:
parent
0eaeeaabb6
commit
e42aec5a89
@ -98,7 +98,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…
Reference in New Issue
Block a user