Skip to content

Commit 65f2551

Browse files
authored
Merge pull request #20 from gl-vis/hover-fix4533
Fix gl-mesh3d hover for different pixelRatios
2 parents 4cc672a + 29f562a commit 65f2551

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mesh.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,9 +837,12 @@ proto.pick = function(pickData) {
837837
simplex[i] = positions[cell[i]]
838838
}
839839

840+
var x = pickData.coord[0] * this.pixelRatio
841+
var y = pickData.coord[1] * this.pixelRatio
842+
840843
var data = closestPoint(
841844
simplex,
842-
[pickData.coord[0], this._resolution[1]-pickData.coord[1]],
845+
[x, this._resolution[1] - y],
843846
this._model,
844847
this._view,
845848
this._projection,

0 commit comments

Comments
 (0)