mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
Fix movement calculations.
This commit is contained in:
@@ -849,8 +849,8 @@ Guacamole.Mouse.Touchscreen = function(element) {
|
|||||||
*/
|
*/
|
||||||
function move_mouse(x, y) {
|
function move_mouse(x, y) {
|
||||||
guac_touchscreen.currentState.fromClientPosition(element, x, y);
|
guac_touchscreen.currentState.fromClientPosition(element, x, y);
|
||||||
if (guac_touchscreen.onmousemove)
|
if (guac_touchscreen.onmousemove)
|
||||||
guac_touchscreen.onmousemove(guac_touchscreen.currentState);
|
guac_touchscreen.onmousemove(guac_touchscreen.currentState);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -864,8 +864,9 @@ Guacamole.Mouse.Touchscreen = function(element) {
|
|||||||
*/
|
*/
|
||||||
function finger_moved(e) {
|
function finger_moved(e) {
|
||||||
var touch = e.touches[0] || e.changedTouches[0];
|
var touch = e.touches[0] || e.changedTouches[0];
|
||||||
return Math.abs(touch.clientX - gesture_start_x) >= guac_touchscreen.clickMoveThreshold
|
var delta_x = touch.clientX - gesture_start_x;
|
||||||
&& Math.abs(touch.clientY - gesture_start_y) >= guac_touchscreen.clickMoveThreshold;
|
var delta_y = touch.clientY - gesture_start_y;
|
||||||
|
return Math.sqrt(delta_x*delta_x + delta_y*delta_y) >= guac_touchscreen.clickMoveThreshold;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user