Fix #9630: intro game could zoom in/out more than allowed by settings (#9633)

Also fixes #9622
This commit is contained in:
Loïc Guilloux 2021-10-20 22:08:08 +02:00 committed by GitHub
parent b043d58b92
commit bc1b84cbbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -161,11 +161,11 @@ void FixTitleGameZoom(int zoom_adjust)
/* Adjust the zoom in/out. /* Adjust the zoom in/out.
* Can't simply add, since operator+ is not defined on the ZoomLevel type. */ * Can't simply add, since operator+ is not defined on the ZoomLevel type. */
vp->zoom = _gui_zoom; vp->zoom = _gui_zoom;
while (zoom_adjust < 0 && vp->zoom != ZOOM_LVL_MIN) { while (zoom_adjust < 0 && vp->zoom != _settings_client.gui.zoom_min) {
vp->zoom--; vp->zoom--;
zoom_adjust++; zoom_adjust++;
} }
while (zoom_adjust > 0 && vp->zoom != ZOOM_LVL_MAX) { while (zoom_adjust > 0 && vp->zoom != _settings_client.gui.zoom_max) {
vp->zoom++; vp->zoom++;
zoom_adjust--; zoom_adjust--;
} }