Skip to content

Commit

Permalink
Yale-27 fix: Fix bug on mouse coordinates onSelection
Browse files Browse the repository at this point in the history
  • Loading branch information
afonsobspinto committed Sep 19, 2023
1 parent ba11a57 commit e0e40a0
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions geppetto.js/geppetto-ui/src/3d-canvas/threeDEngine/ThreeDEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -728,19 +728,19 @@ export default class ThreeDEngine {
}

that.mouse.y
= -(
(event.clientY
- that.renderer.domElement.getBoundingClientRect().top) * window.devicePixelRatio
/ that.renderer.domElement.getBoundingClientRect().height
)
= -(
(event.clientY
- that.renderer.domElement.getBoundingClientRect().top) * window.devicePixelRatio
/ that.renderer.domElement.height
)
* 2
+ 1;
+ 1;
that.mouse.x
= ((event.clientX
- that.renderer.domElement.getBoundingClientRect().left) * window.devicePixelRatio
/ that.renderer.domElement.getBoundingClientRect().width)
= ((event.clientX
- that.renderer.domElement.getBoundingClientRect().left) * window.devicePixelRatio
/ that.renderer.domElement.width)
* 2
- 1;
- 1;

if (that.pickingEnabled) {
const intersects = that.getIntersectedObjects();
Expand Down Expand Up @@ -804,7 +804,7 @@ export default class ThreeDEngine {
}
}
that.requestFrame();
onSelection(that.selectionStrategy(selectedMap), that.mouse.x, that.mouse.y, event)
onSelection(that.selectionStrategy(selectedMap), event)
}
}
}
Expand Down

0 comments on commit e0e40a0

Please sign in to comment.