Add fallback value for devicePixelRatio

In IE 10 for example, devicePixelRatio doesn't exist which caused the
code to fail by setting the thresholds to zero.
This commit is contained in:
samhed
2016-05-12 16:43:19 +02:00
parent 057cfc7cb4
commit f52105bc88
2 changed files with 4 additions and 3 deletions

View File

@@ -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)) {