Skip to content

Commit

Permalink
stop swipe from triggering after multitouch gesture
Browse files Browse the repository at this point in the history
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 #806
Closes #669
  • Loading branch information
annam authored and arschmitz committed Aug 8, 2015
1 parent 963fe69 commit 711d8a1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,18 @@ function computeInputData(manager, input) {

computeDeltaXY(session, input);
input.offsetDirection = getDirection(input.deltaX, input.deltaY);

var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);
input.overallVelocityX = overallVelocity.x;
input.overallVelocityY = overallVelocity.y;
input.overallVelocity = (abs(overallVelocity.x) > abs(overallVelocity.y)) ? overallVelocity.x : overallVelocity.y;

input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;

input.maxPointers = !session.prevInput ? input.pointers.length : ((input.pointers.length >
session.prevInput.maxPointers) ? input.pointers.length : session.prevInput.maxPointers);

computeIntervalInputData(session, input);

// find the correct target
Expand Down

0 comments on commit 711d8a1

Please sign in to comment.