diff --git a/include/input.js b/include/input.js index 5d9e209e..fa6ba44a 100644 --- a/include/input.js +++ b/include/input.js @@ -212,7 +212,7 @@ var Keyboard, Mouse; // Touch device // When two touches occur within 500 ms of each other and are - // closer than 20 pixels together a double click is triggered. + // close enough together a double click is triggered. if (down == 1) { if (this._doubleClickTimer === null) { this._lastTouchPos = pos; @@ -229,7 +229,8 @@ var Keyboard, Mouse; // The goal is to trigger on a certain physical width, the // devicePixelRatio brings us a bit closer but is not optimal. - if (d < 20 * window.devicePixelRatio) { + var threshold = 20 * (window.devicePixelRatio || 1); + if (d < threshold) { pos = this._lastTouchPos; } } diff --git a/include/rfb.js b/include/rfb.js index 3e9344bb..48fa5a8c 100644 --- a/include/rfb.js +++ b/include/rfb.js @@ -617,7 +617,7 @@ var RFB; // The goal is to trigger on a certain physical width, the // devicePixelRatio brings us a bit closer but is not optimal. - var dragThreshold = 10 * window.devicePixelRatio; + var dragThreshold = 10 * (window.devicePixelRatio || 1); if (this._viewportHasMoved || (Math.abs(deltaX) > dragThreshold || Math.abs(deltaY) > dragThreshold)) {