Skip to content

Commit

Permalink
Fix touch count reset (#4488)
Browse files Browse the repository at this point in the history
  • Loading branch information
asdqwe authored Nov 14, 2024
1 parent 8af7985 commit 700e2c5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/platforms/rcore_web.c
Original file line number Diff line number Diff line change
Expand Up @@ -1778,11 +1778,14 @@ 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

if (eventType == EMSCRIPTEN_EVENT_TOUCHEND)
{
CORE.Input.Touch.pointCount--;
if (CORE.Input.Touch.pointCount < 0) CORE.Input.Touch.pointCount = 0;
}

return 1; // The event was consumed by the callback handler
}

Expand Down

0 comments on commit 700e2c5

Please sign in to comment.