From f0e36715c9d34a2dfdbf8c86b4eed7ddb4786b68 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Fri, 30 Mar 2012 22:59:46 -0700 Subject: [PATCH] Check for last touch by verifying touch length 0, not 1. Fix wrong use of max() (should be min). --- src/main/resources/mouse.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/mouse.js b/src/main/resources/mouse.js index f7cfb12..066c65b 100644 --- a/src/main/resources/mouse.js +++ b/src/main/resources/mouse.js @@ -161,7 +161,7 @@ Guacamole.Mouse = function(element) { element.addEventListener("touchend", function(e) { // If we're handling a gesture AND this is the last touch - if (gesture_in_progress && e.touches.length == 1) { + if (gesture_in_progress && e.touches.length == 0) { cancelEvent(e); @@ -217,7 +217,7 @@ Guacamole.Mouse = function(element) { element.addEventListener("touchstart", function(e) { // Track number of touches, but no more than three - touch_count = Math.max(e.touches.length, 3); + touch_count = Math.min(e.touches.length, 3); // Record initial touch location and time for touch movement // and tap gestures -- 1.7.10.4