浏览代码

Fix touch count reset (#4488)

pull/4489/head
Asdqwe 3 天前
committed by GitHub
父节点
当前提交
700e2c5e5d
找不到此签名对应的密钥 GPG 密钥 ID: B5690EEEBB952194
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. +6
    -3
      src/platforms/rcore_web.c

+ 6
- 3
src/platforms/rcore_web.c 查看文件

@ -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
}

正在加载...
取消
保存