Fix for repetitive touch move

This commit is contained in:
Pavel fljot 2013-01-06 19:14:49 +02:00
parent 4c20d1444d
commit 4398712f0c
2 changed files with 14 additions and 4 deletions

View file

@ -49,10 +49,13 @@ package org.gestouch.core
_time = time;
_beginTime = time;
}
gestouch_internal function updateLocation(x:Number, y:Number, time:uint):void
gestouch_internal function updateLocation(x:Number, y:Number, time:uint):Boolean
{
if (_location)
{
if (_location.x == x && _location.y == y)
return false;
_previousLocation.x = _location.x;
_previousLocation.y = _location.y;
_location.x = x;
@ -63,6 +66,8 @@ package org.gestouch.core
{
setLocation(x, y, time);
}
return true;
}

View file

@ -161,9 +161,14 @@ package org.gestouch.core
if (!touch)
return;// touch with specified ID isn't registered
touch.updateLocation(x, y, getTimer());
_gesturesManager.onTouchMove(touch);
if (touch.updateLocation(x, y, getTimer()))
{
// NB! It appeared that native TOUCH_MOVE event is dispatched also when
// the location is the same, but size has changed. We are only interested
// in location at the moment, so we shall ignore irrelevant calls.
_gesturesManager.onTouchMove(touch);
}
}