We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 87dfccc commit 8e1a5a4Copy full SHA for 8e1a5a4
src/core/nodes/UI.js
@@ -168,9 +168,12 @@ export class UI extends Node {
168
const canvas = this.canvas
169
const world = this.ctx.world
170
const onPointerEnter = e => {
171
+ const rect = canvas.getBoundingClientRect()
172
+ const x = (e.clientX - rect.left) * this._res
173
+ const y = (e.clientY - rect.top) * this._res
174
hit = {
175
node: this,
- coords: new THREE.Vector3(0, 0, 0),
176
+ coords: new THREE.Vector3(x, y, 0),
177
}
178
world.pointer.setScreenHit(hit)
179
0 commit comments