1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-22 23:33:04 +01:00

Fix zooming with keyboard moving the view off centre

This commit is contained in:
mrmbernardi
2024-10-08 06:46:09 +11:00
committed by GitHub
parent 85863f000a
commit 1172016264
2 changed files with 5 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
0.4.16 (in development) 0.4.16 (in development)
------------------------------------------------------------------------ ------------------------------------------------------------------------
- Fix: [#22918] Zooming with keyboard moves the view off centre.
- Fix: [#22921] Wooden RollerCoaster flat to steep railings appear in front of track in front of them. - Fix: [#22921] Wooden RollerCoaster flat to steep railings appear in front of track in front of them.
0.4.15 (2024-10-06) 0.4.15 (2024-10-06)

View File

@@ -934,16 +934,16 @@ void WindowZoomSet(WindowBase& w, ZoomLevel zoomLevel, bool atCursor)
while (v->zoom > zoomLevel) while (v->zoom > zoomLevel)
{ {
v->zoom--; v->zoom--;
w.savedViewPos.x += v->ViewWidth() / 4; w.savedViewPos.x += v->ViewWidth() / 2;
w.savedViewPos.y += v->ViewHeight() / 4; w.savedViewPos.y += v->ViewHeight() / 2;
} }
// Zoom out // Zoom out
while (v->zoom < zoomLevel) while (v->zoom < zoomLevel)
{ {
v->zoom++; v->zoom++;
w.savedViewPos.x -= v->ViewWidth() / 2; w.savedViewPos.x -= v->ViewWidth() / 4;
w.savedViewPos.y -= v->ViewHeight() / 2; w.savedViewPos.y -= v->ViewHeight() / 4;
} }
// Zooming to cursor? Centre around the tile we were hovering over just now. // Zooming to cursor? Centre around the tile we were hovering over just now.