mirror of
https://github.com/scratchfoundation/Gestouch.git
synced 2024-11-27 01:35:40 -05:00
Fixed initial offset calculation for PanGesture
This commit is contained in:
parent
696b6367f2
commit
62fa492d66
1 changed files with 4 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue