Minor performance fix for SwipeGesture

This commit is contained in:
Pavel fljot 2012-02-29 22:20:09 +02:00
parent 3dcc78c267
commit 895e662bd5

View file

@ -102,7 +102,12 @@ package org.gestouch.gestures
var absVel:Number = vel > 0 ? vel : -vel;//faster Math.abs()
// trace(_offset, _offset.length, ".....velocity:", vel);
if (offsetLength > Gesture.DEFAULT_SLOP && absVel < velocityThreshold)
if (offsetLength < Gesture.DEFAULT_SLOP)
{
// no need in processing - we're in the very beginning of movement
return;
}
else if (absVel < velocityThreshold)
{
setState(GestureState.FAILED);
return;