summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorubkp <[email protected]>2023-07-10 13:58:56 -0300
committerGitHub <[email protected]>2023-07-10 18:58:56 +0200
commit4b6cbd234040312091e24085ee929a7cec60faac (patch)
tree71ab38cb12980eaf263221ae754810e64ddd4c45
parent91e4eea52d1b92e1408fd129ca7b638f9cd4531d (diff)
downloadraylib-4b6cbd234040312091e24085ee929a7cec60faac.tar.gz
raylib-4b6cbd234040312091e24085ee929a7cec60faac.zip
Fix Touch pointCount for web (#3163)
-rw-r--r--src/rcore.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rcore.c b/src/rcore.c
index 6ef25c0b..833400fc 100644
--- a/src/rcore.c
+++ b/src/rcore.c
@@ -6139,6 +6139,9 @@ static EM_BOOL EmscriptenTouchCallback(int eventType, const EmscriptenTouchEvent
// Gesture data is sent to gestures system for processing
ProcessGestureEvent(gestureEvent);
+
+ // Reset the pointCount for web, if it was the last Touch End event
+ if (eventType == EMSCRIPTEN_EVENT_TOUCHEND && CORE.Input.Touch.pointCount == 1) CORE.Input.Touch.pointCount = 0;
#endif
return 1; // The event was consumed by the callback handler