mirror of
https://github.com/scratchfoundation/Gestouch.git
synced 2025-02-16 23:40:14 -05:00
Fix for repetitive touch move
This commit is contained in:
parent
4c20d1444d
commit
4398712f0c
2 changed files with 14 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue