pex-gl/pex-gui

Mouse coords are relative to window not canvas

Opened this issue · 1 comments

vorg commented

I can't click correctly if e.g. body has padding

Do you have a repro case? Is it related to this commented part:

let mx = e.offsetX // ? e.offsetX : e.pageX - this._ctx.gl.canvas.offsetLeft
let my = e.offsetY // ? e.offsetY : e.pageY - this._ctx.gl.canvas.offsetTop