[rcore][android] Fix GESTURE_NONE not being reported when touch point…
This commit is contained in:
parent
8bc889380a
commit
548c4a134d
|
|
@ -370,7 +370,10 @@ void ProcessGestureEvent(GestureEvent event)
|
|||
}
|
||||
else if (event.touchAction == TOUCH_ACTION_MOVE)
|
||||
{
|
||||
GESTURES.Pinch.distance = rgVector2Distance(GESTURES.Touch.moveDownPositionA, GESTURES.Touch.moveDownPositionB);
|
||||
GESTURES.Pinch.distance = rgVector2Distance(
|
||||
GESTURES.Touch.moveDownPositionA,
|
||||
GESTURES.Touch.moveDownPositionB
|
||||
);
|
||||
|
||||
GESTURES.Touch.moveDownPositionA = event.position[0];
|
||||
GESTURES.Touch.moveDownPositionB = event.position[1];
|
||||
|
|
@ -378,10 +381,18 @@ void ProcessGestureEvent(GestureEvent event)
|
|||
GESTURES.Pinch.vector.x = GESTURES.Touch.moveDownPositionB.x - GESTURES.Touch.moveDownPositionA.x;
|
||||
GESTURES.Pinch.vector.y = GESTURES.Touch.moveDownPositionB.y - GESTURES.Touch.moveDownPositionA.y;
|
||||
|
||||
if ((rgVector2Distance(GESTURES.Touch.previousPositionA, GESTURES.Touch.moveDownPositionA) >= MINIMUM_PINCH) || (rgVector2Distance(GESTURES.Touch.previousPositionB, GESTURES.Touch.moveDownPositionB) >= MINIMUM_PINCH))
|
||||
if ((rgVector2Distance(GESTURES.Touch.previousPositionA, GESTURES.Touch.moveDownPositionA) >= MINIMUM_PINCH) ||
|
||||
(rgVector2Distance(GESTURES.Touch.previousPositionB, GESTURES.Touch.moveDownPositionB) >= MINIMUM_PINCH))
|
||||
{
|
||||
if ( rgVector2Distance(GESTURES.Touch.previousPositionA, GESTURES.Touch.previousPositionB) > rgVector2Distance(GESTURES.Touch.moveDownPositionA, GESTURES.Touch.moveDownPositionB) ) GESTURES.current = GESTURE_PINCH_IN;
|
||||
else GESTURES.current = GESTURE_PINCH_OUT;
|
||||
if (rgVector2Distance(GESTURES.Touch.previousPositionA, GESTURES.Touch.previousPositionB) >
|
||||
rgVector2Distance(GESTURES.Touch.moveDownPositionA, GESTURES.Touch.moveDownPositionB))
|
||||
{
|
||||
GESTURES.current = GESTURE_PINCH_IN;
|
||||
}
|
||||
else
|
||||
{
|
||||
GESTURES.current = GESTURE_PINCH_OUT;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -390,7 +401,10 @@ void ProcessGestureEvent(GestureEvent event)
|
|||
}
|
||||
|
||||
// NOTE: Angle should be inverted in Y
|
||||
GESTURES.Pinch.angle = 360.0f - rgVector2Angle(GESTURES.Touch.moveDownPositionA, GESTURES.Touch.moveDownPositionB);
|
||||
GESTURES.Pinch.angle = 360.0f - rgVector2Angle(
|
||||
GESTURES.Touch.moveDownPositionA,
|
||||
GESTURES.Touch.moveDownPositionB
|
||||
);
|
||||
}
|
||||
else if (event.touchAction == TOUCH_ACTION_UP)
|
||||
{
|
||||
|
|
@ -400,7 +414,6 @@ void ProcessGestureEvent(GestureEvent event)
|
|||
GESTURES.Touch.pointCount = 0;
|
||||
|
||||
GESTURES.current = GESTURE_NONE;
|
||||
}
|
||||
}
|
||||
else if (GESTURES.Touch.pointCount == 0) // No touch points
|
||||
{
|
||||
|
|
@ -410,7 +423,6 @@ void ProcessGestureEvent(GestureEvent event)
|
|||
{
|
||||
// TODO: Process gesture events for more than two points
|
||||
}
|
||||
}
|
||||
|
||||
// Update gestures detected (must be called every frame)
|
||||
void UpdateGestures(void)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user