From cd04bcdee1d9e3f29e1689cdc8d09206b90e49f6 Mon Sep 17 00:00:00 2001 From: ubkp <118854183+ubkp@users.noreply.github.com> Date: Fri, 8 Dec 2023 01:18:44 -0300 Subject: [PATCH] Complement note and optimization --- src/platforms/rcore_desktop_sdl.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index 17d32425505a..4dc853920904 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -1253,8 +1253,7 @@ void PollInputEvents(void) gestureEvent.pointCount = 1; // Register touch points position, only one point registered - if (realTouch) gestureEvent.position[0] = CORE.Input.Touch.position[0]; - else if (touchAction == 2) gestureEvent.position[0] = CORE.Input.Touch.position[0]; + if (touchAction == 2 || realTouch) gestureEvent.position[0] = CORE.Input.Touch.position[0]; else gestureEvent.position[0] = GetMousePosition(); // Normalize gestureEvent.position[0] for CORE.Window.screen.width and CORE.Window.screen.height @@ -1417,7 +1416,7 @@ int InitPlatform(void) // Disable mouse events being interpreted as touch events // NOTE: This is wanted because there are SDL_FINGER* events available which provide unique data - // Due to the way rgestures.h is currently implemented, setting this doesn't break SUPPORT_MOUSE_GESTURES + // Due to the way PollInputEvents() and rgestures.h are currently implemented, setting this won't break SUPPORT_MOUSE_GESTURES SDL_SetHint(SDL_HINT_TOUCH_MOUSE_EVENTS, "0"); SDL_EventState(SDL_DROPFILE, SDL_ENABLE);