diff options
| author | victorfisac <victorfisac@gmail.com> | 2016-03-16 12:40:08 +0100 |
|---|---|---|
| committer | victorfisac <victorfisac@gmail.com> | 2016-03-16 12:40:08 +0100 |
| commit | d72849409982266b99dd00741bf807ef10ba3c6c (patch) | |
| tree | 86098d3d7f0254712ed2fa9f64d43ab98fc54ce3 /src/gestures.c | |
| parent | 78e4772f21cda45c219ce88a713708b6b0680e8f (diff) | |
| parent | 5bcda7bf1526c40f605de3abcde4fd10d81c6cc5 (diff) | |
| download | raylib-d72849409982266b99dd00741bf807ef10ba3c6c.tar.gz raylib-d72849409982266b99dd00741bf807ef10ba3c6c.zip | |
Merge remote-tracking branch 'refs/remotes/raysan5/develop' into develop
Diffstat (limited to 'src/gestures.c')
| -rw-r--r-- | src/gestures.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gestures.c b/src/gestures.c index e615c06d..583b77cd 100644 --- a/src/gestures.c +++ b/src/gestures.c @@ -72,7 +72,7 @@ static Vector2 moveDownPosition2 = { 0.0f, 0.0f }; static int numTap = 0; static int pointCount = 0; -static int touchId = -1; +static int firstTouchId = -1; static double eventTime = 0.0; static double swipeTime = 0.0; @@ -120,9 +120,7 @@ void ProcessGestureEvent(GestureEvent event) pointCount = event.pointCount; // Required on UpdateGestures() if (pointCount < 2) - { - touchId = event.pointerId[0]; - + { if (event.touchAction == TOUCH_DOWN) { numTap++; // Tap counter @@ -145,6 +143,8 @@ void ProcessGestureEvent(GestureEvent event) touchUpPosition = touchDownPosition; eventTime = GetCurrentTime(); + firstTouchId = event.pointerId[0]; + dragVector = (Vector2){ 0.0f, 0.0f }; } else if (event.touchAction == TOUCH_UP) @@ -158,7 +158,7 @@ void ProcessGestureEvent(GestureEvent event) startMoving = false; // Detect GESTURE_SWIPE - if ((dragIntensity > FORCE_TO_SWIPE) && (touchId == 0)) // RAY: why check (touchId == 0)??? + if ((dragIntensity > FORCE_TO_SWIPE) && firstTouchId == event.pointerId[0]) { // NOTE: Angle should be inverted in Y dragAngle = 360.0f - Vector2Angle(touchDownPosition, touchUpPosition); |
