From a3d277e3274a2a8e098c17e9f2609244eb573848 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 22 Mar 2012 17:28:24 -0700 Subject: [PATCH] Use screenX/screenY for touch. --- src/main/resources/mouse.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/resources/mouse.js b/src/main/resources/mouse.js index a193f67..547f517 100644 --- a/src/main/resources/mouse.js +++ b/src/main/resources/mouse.js @@ -223,8 +223,8 @@ Guacamole.Mouse = function(element) { // Record touch location and time var starting_touch = e.touches[0]; - last_touch_x = starting_touch.pageX; - last_touch_y = starting_touch.pageY; + last_touch_x = starting_touch.screenX; + last_touch_y = starting_touch.screenY; last_touch_time = new Date().getTime(); pixels_moved = 0; @@ -243,8 +243,8 @@ Guacamole.Mouse = function(element) { // Get change in touch location var touch = e.touches[0]; - var delta_x = touch.pageX - last_touch_x; - var delta_y = touch.pageY - last_touch_y; + var delta_x = touch.screenX - last_touch_x; + var delta_y = touch.screenY - last_touch_y; // Track pixels moved pixels_moved += Math.abs(delta_x) + Math.abs(delta_y); @@ -270,8 +270,8 @@ Guacamole.Mouse = function(element) { guac_mouse.onmousemove(guac_mouse.currentState); // Update touch location - last_touch_x = touch.pageX; - last_touch_y = touch.pageY; + last_touch_x = touch.screenX; + last_touch_y = touch.screenY; } -- 1.7.10.4