From 6540a57aa95029a73dcae22dae644893e66dd9cb Mon Sep 17 00:00:00 2001 From: Hamza Tatheer <> Date: Sat, 12 Nov 2022 16:32:45 +0500 Subject: [PATCH] pr changes --- src/openseadragon.js | 2 +- src/viewer.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/openseadragon.js b/src/openseadragon.js index daf77046..45e4c8e7 100644 --- a/src/openseadragon.js +++ b/src/openseadragon.js @@ -411,7 +411,7 @@ * The "zoom distance" per mouse scroll or touch pinch. Note: Setting this to 1.0 effectively disables the mouse-wheel zoom feature (also see gestureSettings[Mouse|Touch|Pen].scrollToZoom}). * * @property {Number} [zoomPerDblClickDrag=1.2] - * The "zoom distance" per mouse drag. Note: Setting this to 1.0 effectively disables the double-click-drag-to-Zoom feature (also see gestureSettings[Mouse|Touch|Pen].dblClickDragToZoom). + * The "zoom distance" per double-click mouse drag. Note: Setting this to 1.0 effectively disables the double-click-drag-to-Zoom feature (also see gestureSettings[Mouse|Touch|Pen].dblClickDragToZoom). * * @property {Number} [zoomPerSecond=1.0] * Sets the zoom amount per second when zoomIn/zoomOut buttons are pressed and held. diff --git a/src/viewer.js b/src/viewer.js index 3108d034..10cf5240 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -215,6 +215,7 @@ $.Viewer = function( options ) { onfullscreenchange: null, lastClickTime: null, draggingToZoom: false, + dblClickTimeThreshold: 1000 }; this._sequenceIndex = 0; @@ -3200,6 +3201,7 @@ function onCanvasPress( event ) { gestureSettings = this.gestureSettingsByDeviceType( event.pointerType ); if ( gestureSettings.dblClickDragToZoom ){ + var dblClickTimeThreshold = THIS[ this.hash ].dblClickTimeThreshold; var lastClickTime = THIS[ this.hash ].lastClickTime; var currClickTime = $.now(); @@ -3207,7 +3209,7 @@ function onCanvasPress( event ) { return; } - if ((currClickTime - lastClickTime) < 2000) { + if ((currClickTime - lastClickTime) < dblClickTimeThreshold) { THIS[ this.hash ].draggingToZoom = true; }