From 3175e7b7adc75b0093f7ff4a9e75d513ecb48f24 Mon Sep 17 00:00:00 2001 From: adrien Date: Thu, 24 Apr 2025 20:41:33 +0200 Subject: [PATCH] mouse event only on sceneDiv --- js/app.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/app.js b/js/app.js index 5d45995..fdbd7a2 100644 --- a/js/app.js +++ b/js/app.js @@ -268,7 +268,7 @@ let rY0 = 0 let clientX0 = 0 let clientY0 = 0 -document.onmousedown = function(event) { +sceneDiv.onmousedown = function(event) { mousedown = true rX0 = parseInt(getComputedStyle(screenRow).getPropertyValue("--rX")) dy0 = parseInt(getComputedStyle(screenRow).getPropertyValue("--rY")) @@ -276,7 +276,7 @@ document.onmousedown = function(event) { clientY0 = event.clientY } -document.onmousemove = function(event) { +sceneDiv.onmousemove = function(event) { if (mousedown) { event.preventDefault() event.stopPropagation() @@ -301,11 +301,11 @@ document.onmousemove = function(event) { } } -document.onmouseup = document.onmouseleave = function(event) { +sceneDiv.onmouseup = document.onmouseleave = function(event) { mousedown = false } -document.onwheel = function(event) { +sceneDiv.onwheel = function(event) { event.preventDefault() event.stopPropagation() let tZ = parseInt(getComputedStyle(screenRow).getPropertyValue("--tZ"))