From 4851ba8b5c477354bd1bc500b53b17b8a02350f3 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Wed, 5 Mar 2014 01:10:03 -0800 Subject: [PATCH] Fix movement calculations. --- guacamole-common-js/src/main/webapp/modules/Mouse.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/guacamole-common-js/src/main/webapp/modules/Mouse.js b/guacamole-common-js/src/main/webapp/modules/Mouse.js index 506fea4e7..18fe96e96 100644 --- a/guacamole-common-js/src/main/webapp/modules/Mouse.js +++ b/guacamole-common-js/src/main/webapp/modules/Mouse.js @@ -849,8 +849,8 @@ Guacamole.Mouse.Touchscreen = function(element) { */ function move_mouse(x, y) { guac_touchscreen.currentState.fromClientPosition(element, x, y); - if (guac_touchscreen.onmousemove) - guac_touchscreen.onmousemove(guac_touchscreen.currentState); + if (guac_touchscreen.onmousemove) + guac_touchscreen.onmousemove(guac_touchscreen.currentState); } /** @@ -864,8 +864,9 @@ Guacamole.Mouse.Touchscreen = function(element) { */ function finger_moved(e) { var touch = e.touches[0] || e.changedTouches[0]; - return Math.abs(touch.clientX - gesture_start_x) >= guac_touchscreen.clickMoveThreshold - && Math.abs(touch.clientY - gesture_start_y) >= guac_touchscreen.clickMoveThreshold; + var delta_x = touch.clientX - gesture_start_x; + var delta_y = touch.clientY - gesture_start_y; + return Math.sqrt(delta_x*delta_x + delta_y*delta_y) >= guac_touchscreen.clickMoveThreshold; } /**