From 8730c3b2dbcb1da51f81a80bb643702146eb3f87 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Tue, 19 Oct 2021 21:55:33 +0200 Subject: [PATCH] [touch] Ignore irelevant input when in the inventory --- Source/controls/touch/event_handlers.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Source/controls/touch/event_handlers.cpp b/Source/controls/touch/event_handlers.cpp index ee0b4e8e4..8b2ce17cf 100644 --- a/Source/controls/touch/event_handlers.cpp +++ b/Source/controls/touch/event_handlers.cpp @@ -8,6 +8,7 @@ #include "diablo.h" #include "engine.h" #include "gmenu.h" +#include "inv.h" #include "scrollrt.h" #include "stores.h" #include "utils/ui_fwd.h" @@ -30,9 +31,13 @@ Point ScaleToScreenCoordinates(float x, float y) void SimulateMouseMovement(const SDL_Event &event) { - float x = event.tfinger.x; - float y = event.tfinger.y; - MousePosition = ScaleToScreenCoordinates(x, y); + Point position = ScaleToScreenCoordinates(event.tfinger.x, event.tfinger.y); + + if (!spselflag && invflag && !MainPanel.Contains(position) && !RightPanel.Contains(position)) + return; + + MousePosition = position; + sgbControllerActive = false; InvalidateInventorySlot(); }