From c4c5bc70634943a617fd9cecba3db61ec39cc930 Mon Sep 17 00:00:00 2001 From: HF Date: Thu, 10 Feb 2022 03:02:01 +0100 Subject: [PATCH] improve EvenListeners (they can be a bit junky) --- src/controls/PixelPainterControls.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controls/PixelPainterControls.js b/src/controls/PixelPainterControls.js index 8d05432..ce9a618 100644 --- a/src/controls/PixelPainterControls.js +++ b/src/controls/PixelPainterControls.js @@ -77,7 +77,7 @@ class PixelPlainterControls { viewport.addEventListener('mousedown', this.onMouseDown, false); viewport.addEventListener('mousemove', this.onMouseMove, false); viewport.addEventListener('mouseup', this.onMouseUp, false); - viewport.addEventListener('wheel', this.onWheel, false); + viewport.addEventListener('wheel', this.onWheel, { passive: true }); viewport.addEventListener('touchstart', this.onTouchStart, false); viewport.addEventListener('touchend', this.onTouchEnd, false); viewport.addEventListener('touchmove', this.onTouchMove, false); @@ -347,7 +347,7 @@ class PixelPlainterControls { } onWheel(event: MouseEvent) { - event.preventDefault(); + //event.preventDefault(); document.activeElement.blur(); const { deltaY } = event;