From b7e469cf331b559c9536b0357f1eeede53ae359a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= Date: Sun, 26 Jul 2020 00:27:40 +0200 Subject: [PATCH] Fix #11623: Erratic zoom behavior when pointing outside of the map --- distribution/changelog.txt | 1 + src/openrct2/interface/Window.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 3eb54ce027..580ec9fb88 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -37,6 +37,7 @@ - Fix: [#11405] Building a path through walls does not always remove the walls. - Fix: [#11450] Rides with unsuitable track can't be opened even with "Enable all drawable track pieces" cheat. - Fix: [#11455] Object Selection window cuts off scenery names. +- Fix: [#11623] Erratic zoom behavior when pointing outside of the map. - Fix: [#11640] Objects with a blank description in one language do not fall back to other languages anymore. - Fix: [#11676] Spiral Roller Coaster has regular lift hill available. - Fix: [#11695] Mechanics walk to tile 0, 0 at entrance only stations when trying to fix them. diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 485e3cb122..c2efe1b31e 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -953,8 +953,8 @@ void window_viewport_get_map_coords_by_cursor( auto mouseCoords = context_get_cursor_position_scaled(); // Compute map coordinate by mouse position. - CoordsXY mapCoords; - get_map_coordinates_from_pos(mouseCoords, VIEWPORT_INTERACTION_MASK_NONE, mapCoords, nullptr, nullptr, nullptr); + auto viewportPos = screen_coord_to_viewport_coord(w->viewport, mouseCoords); + auto mapCoords = viewport_coord_to_map_coord(viewportPos, 0); *map_x = mapCoords.x; *map_y = mapCoords.y;