You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from my understanding of the docs:
offsetDirection: Direction moved from it's starting point. Matches the DIRECTION constants.
offsetDirection should return the overall direction that we have moved/swiped
eg if i've panned 100px to the left and then 50px to the right, while direction should return right, the offsetdirection should return left.
more importantly and a simpler test case, if i've panned 100px to the left then both direction and offsetdirection should return left. offsetdirection in this case returns right.
in fact, looking at the code it seems that the direction test is reversed:
function getDirection(x, y) {
return x > 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
}
if x is negative then the direction should be left, not the other way around.
then, it seems that the simple direction check is wrong:
function computeIntervalInputData(session, input) {
var deltaX = last.deltaX - input.deltaX;
var deltaY = last.deltaY - input.deltaY;
direction = getDirection(deltaX, deltaY);
}
deltaX should be calculated as input.deltaX - last.deltaX (so that if we've moved to the left, this will return to a negative value).
changing both this and the direction test above should return the correct direction for both direction and offset direction
The text was updated successfully, but these errors were encountered:
if after pinch/rotate, one finger touchends before the other, swipe is
incorrectly triggered because the last gesture is a single-touch
gesture. this checked for maximum pointers in gesture
Fixes#640
Ref #639
Ref #806Closes#669
Hi Jorik,
from my understanding of the docs:
offsetDirection: Direction moved from it's starting point. Matches the DIRECTION constants.
offsetDirection should return the overall direction that we have moved/swiped
eg if i've panned 100px to the left and then 50px to the right, while direction should return right, the offsetdirection should return left.
more importantly and a simpler test case, if i've panned 100px to the left then both direction and offsetdirection should return left. offsetdirection in this case returns right.
in fact, looking at the code it seems that the direction test is reversed:
function getDirection(x, y) {
return x > 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
}
if x is negative then the direction should be left, not the other way around.
then, it seems that the simple direction check is wrong:
function computeIntervalInputData(session, input) {
var deltaX = last.deltaX - input.deltaX;
var deltaY = last.deltaY - input.deltaY;
direction = getDirection(deltaX, deltaY);
}
deltaX should be calculated as input.deltaX - last.deltaX (so that if we've moved to the left, this will return to a negative value).
changing both this and the direction test above should return the correct direction for both direction and offset direction
The text was updated successfully, but these errors were encountered: