Skip to content

Commit 700e2c5

Browse files
authored
Fix touch count reset (#4488)
1 parent 8af7985 commit 700e2c5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/platforms/rcore_web.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,11 +1778,14 @@ static EM_BOOL EmscriptenTouchCallback(int eventType, const EmscriptenTouchEvent
17781778

17791779
// Gesture data is sent to gestures system for processing
17801780
ProcessGestureEvent(gestureEvent);
1781-
1782-
// Reset the pointCount for web, if it was the last Touch End event
1783-
if (eventType == EMSCRIPTEN_EVENT_TOUCHEND && CORE.Input.Touch.pointCount == 1) CORE.Input.Touch.pointCount = 0;
17841781
#endif
17851782

1783+
if (eventType == EMSCRIPTEN_EVENT_TOUCHEND)
1784+
{
1785+
CORE.Input.Touch.pointCount--;
1786+
if (CORE.Input.Touch.pointCount < 0) CORE.Input.Touch.pointCount = 0;
1787+
}
1788+
17861789
return 1; // The event was consumed by the callback handler
17871790
}
17881791

0 commit comments

Comments
 (0)