Fixed mouse move bug, where if your cursor is over and UI element it doesn't fire the mouseUp event

This commit is contained in:
NewHappyRabbit
2025-02-19 10:45:04 +02:00
parent 5f26cf72c8
commit 0769710caa
+3 -3
View File
@@ -85,15 +85,15 @@ export class InputHandler {
initialize() {
this.canvas.addEventListener("pointerdown", (e) => this.onPointerDown(e));
this.canvas.addEventListener("pointerup", (e) => this.onPointerUp(e));
window.addEventListener("pointerup", (e) => this.onPointerUp(e));
this.canvas.addEventListener("wheel", (e) => this.onScroll(e), {
passive: false,
});
this.canvas.addEventListener("pointermove", this.onPointerMove.bind(this));
window.addEventListener("pointermove", this.onPointerMove.bind(this));
this.canvas.addEventListener("contextmenu", (e: MouseEvent) => {
this.onContextMenu(e);
});
this.canvas.addEventListener("mousemove", (e) => {
window.addEventListener("mousemove", (e) => {
if (e.movementX == 0 && e.movementY == 0) {
return;
}