mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-12 17:19:09 +00:00
Fix #11515: Zoom level could wrap around when changing interface scale.
This happened due to converting the new value to unsigned before clamping instead of after.
This commit is contained in:
@@ -2005,7 +2005,7 @@ bool AdjustGUIZoom(bool automatic)
|
||||
w->top = (w->top * _gui_scale) / old_scale;
|
||||
}
|
||||
if (w->viewport != nullptr) {
|
||||
w->viewport->zoom = Clamp(ZoomLevel(w->viewport->zoom - zoom_shift), _settings_client.gui.zoom_min, _settings_client.gui.zoom_max);
|
||||
w->viewport->zoom = static_cast<ZoomLevel>(Clamp(w->viewport->zoom - zoom_shift, _settings_client.gui.zoom_min, _settings_client.gui.zoom_max));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user