Skip to content

Commit 711d8a1

Browse files
annamarschmitz
authored andcommitted
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
1 parent 963fe69 commit 711d8a1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/input.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,18 @@ function computeInputData(manager, input) {
173173

174174
computeDeltaXY(session, input);
175175
input.offsetDirection = getDirection(input.deltaX, input.deltaY);
176-
176+
177177
var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);
178178
input.overallVelocityX = overallVelocity.x;
179179
input.overallVelocityY = overallVelocity.y;
180180
input.overallVelocity = (abs(overallVelocity.x) > abs(overallVelocity.y)) ? overallVelocity.x : overallVelocity.y;
181-
181+
182182
input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
183183
input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;
184184

185+
input.maxPointers = !session.prevInput ? input.pointers.length : ((input.pointers.length >
186+
session.prevInput.maxPointers) ? input.pointers.length : session.prevInput.maxPointers);
187+
185188
computeIntervalInputData(session, input);
186189

187190
// find the correct target

0 commit comments

Comments
 (0)