mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-05 19:08:13 +00:00
Make raylib/raygui work better on touchscreen (#3728)
* Fix that touch doesn't work for click/drag/raygui * Add comments * comments update
This commit is contained in:
@@ -1646,6 +1646,13 @@ static EM_BOOL EmscriptenTouchCallback(int eventType, const EmscriptenTouchEvent
|
|||||||
else if (eventType == EMSCRIPTEN_EVENT_TOUCHEND) CORE.Input.Touch.currentTouchState[i] = 0;
|
else if (eventType == EMSCRIPTEN_EVENT_TOUCHEND) CORE.Input.Touch.currentTouchState[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update mouse position if we detect a single touch.
|
||||||
|
if (CORE.Input.Touch.pointCount == 1)
|
||||||
|
{
|
||||||
|
CORE.Input.Mouse.currentPosition.x = CORE.Input.Touch.position[0].x;
|
||||||
|
CORE.Input.Mouse.currentPosition.y = CORE.Input.Touch.position[0].y;
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(SUPPORT_GESTURES_SYSTEM)
|
#if defined(SUPPORT_GESTURES_SYSTEM)
|
||||||
GestureEvent gestureEvent = {0};
|
GestureEvent gestureEvent = {0};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user