|
@@ -614,14 +614,18 @@ var RFB;
|
|
if (this._viewportDragging) {
|
|
if (this._viewportDragging) {
|
|
var deltaX = this._viewportDragPos.x - x;
|
|
var deltaX = this._viewportDragPos.x - x;
|
|
var deltaY = this._viewportDragPos.y - y;
|
|
var deltaY = this._viewportDragPos.y - y;
|
|
- this._viewportDragPos = {'x': x, 'y': y};
|
|
|
|
|
|
|
|
- // if there is actually viewport move, set the HasMoved flag to true
|
|
|
|
- if (deltaX != 0 || deltaY != 0) {
|
|
|
|
- this._viewportHasMoved = true;
|
|
|
|
- }
|
|
|
|
|
|
+ // 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;
|
|
|
|
|
|
- this._display.viewportChangePos(deltaX, deltaY);
|
|
|
|
|
|
+ if (this._viewportHasMoved || (Math.abs(deltaX) > dragThreshold ||
|
|
|
|
+ Math.abs(deltaY) > dragThreshold)) {
|
|
|
|
+ this._viewportHasMoved = true;
|
|
|
|
+
|
|
|
|
+ this._viewportDragPos = {'x': x, 'y': y};
|
|
|
|
+ this._display.viewportChangePos(deltaX, deltaY);
|
|
|
|
+ }
|
|
|
|
|
|
// Skip sending mouse events
|
|
// Skip sending mouse events
|
|
return;
|
|
return;
|