Fix object detection under mouse.
This commit is contained in:
parent
00c2f14dfa
commit
7b7a989b1e
@ -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;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user