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
This commit is contained in:
Christophe Avenel 2023-10-25 09:26:48 +02:00 committed by GitHub
parent 640526b444
commit 810987210c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2070,7 +2070,7 @@
// y-index scrolling. // y-index scrolling.
// event.deltaMode: 0=pixel, 1=line, 2=page // 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 // 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 = { eventInfo = {
originalEvent: event, originalEvent: event,