diff --git a/source/viewer/viewer.js b/source/viewer/viewer.js index abd2798..15c76d4 100644 --- a/source/viewer/viewer.js +++ b/source/viewer/viewer.js @@ -347,7 +347,13 @@ OV.Viewer = class GetMeshUserDataUnderMouse (mouseCoords) { - let mesh = this.geometry.GetModelMeshUnderMouse (mouseCoords, this.camera, this.canvas.width, this.canvas.height); + let width = this.canvas.width; + let height = this.canvas.height; + if (window.devicePixelRatio) { + width /= window.devicePixelRatio; + height /= window.devicePixelRatio; + } + let mesh = this.geometry.GetModelMeshUnderMouse (mouseCoords, this.camera, width, height); if (mesh === null) { return null; }