Permalink
Browse files

stop swipe from triggering after multitouch gesture

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 Sep 17, 2014
1 parent 963fe69 commit 711d8a1df1aa5057ecb536454a36257e3c0d6d91
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/input.js
View
@@ -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

0 comments on commit 711d8a1

Please sign in to comment.