diff --git a/distribution/changelog.txt b/distribution/changelog.txt index dbc69c99e6..7666eae8f7 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,5 +1,6 @@ 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. 0.4.15 (2024-10-06) diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index c67fcca795..03e48f1409 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -934,16 +934,16 @@ void WindowZoomSet(WindowBase& w, ZoomLevel zoomLevel, bool atCursor) while (v->zoom > zoomLevel) { v->zoom--; - w.savedViewPos.x += v->ViewWidth() / 4; - w.savedViewPos.y += v->ViewHeight() / 4; + w.savedViewPos.x += v->ViewWidth() / 2; + w.savedViewPos.y += v->ViewHeight() / 2; } // Zoom out while (v->zoom < zoomLevel) { v->zoom++; - w.savedViewPos.x -= v->ViewWidth() / 2; - w.savedViewPos.y -= v->ViewHeight() / 2; + w.savedViewPos.x -= v->ViewWidth() / 4; + w.savedViewPos.y -= v->ViewHeight() / 4; } // Zooming to cursor? Centre around the tile we were hovering over just now.