Fix #11515: Zoom level could wrap around when changing interface scale. (#11615)

This happened due to converting the new value to unsigned before clamping instead of after.
This commit is contained in:
Peter Nelson 2023-12-22 15:23:42 +00:00 committed by GitHub
parent c1afbc9415
commit fd0aa3dd19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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));
}
}