mirror of
https://github.com/scratchfoundation/Gestouch.git
synced 2024-11-27 01:35:40 -05:00
DoubleTapGesture condition refactored
to get rid of code duplication
This commit is contained in:
parent
3e74d2883a
commit
dc489ba55d
1 changed files with 2 additions and 10 deletions
|
@ -170,17 +170,9 @@ package org.gestouch.gestures
|
|||
{
|
||||
// double tap combo recognized
|
||||
|
||||
if (moveThreshold > 0)
|
||||
{
|
||||
if (_lastCentralPoint.subtract(_prevCentralPoint).length < moveThreshold)
|
||||
{
|
||||
_reset();
|
||||
_dispatch(new DoubleTapGestureEvent(DoubleTapGestureEvent.GESTURE_DOUBLE_TAP, true, false, GesturePhase.ALL, _lastLocalCentralPoint.x, _lastLocalCentralPoint.y));
|
||||
}
|
||||
}
|
||||
else
|
||||
if ((moveThreshold > 0 && _lastCentralPoint.subtract(_prevCentralPoint).length < moveThreshold)
|
||||
|| isNaN(moveThreshold) || moveThreshold <= 0)
|
||||
{
|
||||
// no moveThreshold defined
|
||||
_reset();
|
||||
_dispatch(new DoubleTapGestureEvent(DoubleTapGestureEvent.GESTURE_DOUBLE_TAP, true, false, GesturePhase.ALL, _lastLocalCentralPoint.x, _lastLocalCentralPoint.y));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue