From 810987210c069876d2ba98a603086affc3244710 Mon Sep 17 00:00:00 2001 From: Christophe Avenel Date: Wed, 25 Oct 2023 09:26:48 +0200 Subject: [PATCH] Fix zoom out when wheel event.deltaY is zero Don't apply zoom in or zoom out when deltaY is zero on wheel events. Should fix https://github.com/openseadragon/openseadragon/issues/947 and not make OpenSeadragon zoom out when scrolling horizontally on a touchpad --- src/mousetracker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mousetracker.js b/src/mousetracker.js index 20200b31..57d89d5b 100644 --- a/src/mousetracker.js +++ b/src/mousetracker.js @@ -2070,7 +2070,7 @@ // y-index scrolling. // event.deltaMode: 0=pixel, 1=line, 2=page // TODO: Deltas in pixel mode should be accumulated then a scroll value computed after $.DEFAULT_SETTINGS.pixelsPerWheelLine threshold reached - nDelta = event.deltaY < 0 ? 1 : -1; + nDelta = event.deltaY ? (event.deltaY < 0 ? 1 : -1) : 0; eventInfo = { originalEvent: event,