Changeset - r28318:2b59200cbbcd
[Not reviewed]
master
0 1 0
Peter Nelson - 12 months ago 2023-12-22 15:23:42
peter1138@openttd.org
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.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/gfx.cpp
Show inline comments
 
@@ -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));
 
		}
 
	}
 

	
0 comments (0 inline, 0 general)