From 95df149804c5c6b941be6ccc5f9d4361d4f77187 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sat, 21 May 2022 09:39:13 +0200 Subject: [PATCH] Fix: Ghosts and tooltips move when panning the viewport by right-click dragging Co-authored-by: Hielke Morsink --- distribution/changelog.txt | 1 + src/openrct2-ui/input/MouseInput.cpp | 2 +- src/openrct2-ui/windows/MapTooltip.cpp | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index c0d3ef7bae..edf11f9fea 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -21,6 +21,7 @@ - Fix: [#17104] Changing map size does not invalidate park size. - Fix: [#17197] Segfault when extracting files from the GOG installer. - Fix: [#17205] Map generator sometimes crashes when not all standard terrain objects are available. +- Fix: [#17221] Object ghosts and tooltips follow invisible cursor when moving the viewport by right-click dragging. 0.4.0 (2022-04-25) ------------------------------------------------------------------------ diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index 16a147f208..b3c7018472 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -1175,7 +1175,7 @@ void ProcessMouseTool(const ScreenCoordsXY& screenCoords) if (w == nullptr) tool_cancel(); - else + else if (input_get_state() != InputState::ViewportRight) window_event_tool_update_call(w, gCurrentToolWidget.widget_index, screenCoords); } } diff --git a/src/openrct2-ui/windows/MapTooltip.cpp b/src/openrct2-ui/windows/MapTooltip.cpp index 7eba3f6195..0e140cf57a 100644 --- a/src/openrct2-ui/windows/MapTooltip.cpp +++ b/src/openrct2-ui/windows/MapTooltip.cpp @@ -71,7 +71,8 @@ void WindowMapTooltipUpdateVisibility() // Check for cursor movement _cursorHoldDuration++; - if (abs(cursorChange.x) > 5 || abs(cursorChange.y) > 5 || (input_test_flag(INPUT_FLAG_5))) + if (abs(cursorChange.x) > 5 || abs(cursorChange.y) > 5 || (input_test_flag(INPUT_FLAG_5)) + || input_get_state() == InputState::ViewportRight) _cursorHoldDuration = 0; _lastCursor = cursor;