From 696b6367f2e12ff7e3efc9b6153db89409dcf4d7 Mon Sep 17 00:00:00 2001 From: Pavel fljot Date: Mon, 2 Apr 2012 17:16:48 +0300 Subject: [PATCH 1/2] Fixed location for TapGesture --- src/org/gestouch/gestures/TapGesture.as | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/gestouch/gestures/TapGesture.as b/src/org/gestouch/gestures/TapGesture.as index fc5881b..fbdcf25 100644 --- a/src/org/gestouch/gestures/TapGesture.as +++ b/src/org/gestouch/gestures/TapGesture.as @@ -106,6 +106,7 @@ package org.gestouch.gestures if (touchesCount == numTouchesRequired) { _numTouchesRequiredReached = true; + updateLocation(); } } @@ -136,7 +137,6 @@ package org.gestouch.gestures if (_tapCounter == numTapsRequired) { - updateLocation(); if (setState(GestureState.RECOGNIZED) && hasEventListener(TapGestureEvent.GESTURE_TAP)) { dispatchEvent(new TapGestureEvent(TapGestureEvent.GESTURE_TAP, false, false, GestureState.RECOGNIZED, From 62fa492d663c45972e6f232c9dc2a4daa4328fd0 Mon Sep 17 00:00:00 2001 From: Pavel fljot Date: Mon, 2 Apr 2012 17:17:48 +0300 Subject: [PATCH 2/2] Fixed initial offset calculation for PanGesture --- src/org/gestouch/gestures/PanGesture.as | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/org/gestouch/gestures/PanGesture.as b/src/org/gestouch/gestures/PanGesture.as index ddf74bf..d864b74 100644 --- a/src/org/gestouch/gestures/PanGesture.as +++ b/src/org/gestouch/gestures/PanGesture.as @@ -136,6 +136,10 @@ package org.gestouch.gestures if (state == GestureState.POSSIBLE) { + prevLocationX = _location.x; + prevLocationY = _location.y; + updateLocation(); + // Check if finger moved enough for gesture to be recognized var locationOffset:Point = touch.locationOffset; if (direction == PanGestureDirection.VERTICAL) @@ -149,9 +153,6 @@ package org.gestouch.gestures if (locationOffset.length > slop || slop != slop)//faster isNaN(slop) { - prevLocationX = _location.x; - prevLocationY = _location.y; - updateLocation(); offsetX = _location.x - prevLocationX; offsetY = _location.y - prevLocationY; // acummulate begin offsets for the case when this gesture recognition is delayed by requireGestureToFail