From 660d5d5d9beb54f18fed01d09a2c69f6644fe03d Mon Sep 17 00:00:00 2001 From: Kapyt Hone Date: Mon, 24 Apr 2017 12:10:30 -0400 Subject: [PATCH 1/2] Fix mouse event on high resolution screens --- mesh.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesh.js b/mesh.js index 9e90c8c..88da6ba 100644 --- a/mesh.js +++ b/mesh.js @@ -764,7 +764,7 @@ proto.pick = function(pickData) { var data = closestPoint( simplex, - [pickData.coord[0], this._resolution[1]-pickData.coord[1]], + [window.devicePixelRatio * pickData.coord[0], this._resolution[1] - window.devicePixelRatio * pickData.coord[1]], this._model, this._view, this._projection, From 6e04ffba95d16f06dcd04f2aaed095ab5460321e Mon Sep 17 00:00:00 2001 From: Kapyt Hone Date: Mon, 24 Apr 2017 15:36:08 -0400 Subject: [PATCH 2/2] use local pixelRatio --- mesh.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesh.js b/mesh.js index 88da6ba..9651948 100644 --- a/mesh.js +++ b/mesh.js @@ -764,7 +764,7 @@ proto.pick = function(pickData) { var data = closestPoint( simplex, - [window.devicePixelRatio * pickData.coord[0], this._resolution[1] - window.devicePixelRatio * pickData.coord[1]], + [this.pixelRatio * pickData.coord[0], this._resolution[1] - this.pixelRatio * pickData.coord[1]], this._model, this._view, this._projection,