Closed frantic0 closed 3 years ago
Here's the change that corrects the bug.
// const x = e.offsetX/window.innerWidth; // const y = e.offsetY/window.innerHeight; const x = e.pageX/window.innerWidth; const y = e.pageY/window.innerHeight;
From https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent
MouseEvent.offsetX – The X coordinate of the mouse pointer relative to the position of the padding edge of the target node.
MouseEvent.pageX – The X coordinate of the mouse pointer relative to the whole document.
Here's the change that corrects the bug.
From https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent
MouseEvent.offsetX – The X coordinate of the mouse pointer relative to the position of the padding edge of the target node.
MouseEvent.pageX – The X coordinate of the mouse pointer relative to the whole document.