From e4d9dcdd03406821ca2f7775d187080bdb24f312 Mon Sep 17 00:00:00 2001 From: Hamza Tatheer Date: Sun, 30 Oct 2022 01:27:56 +0500 Subject: [PATCH] Triple Click Bug Fix --- src/viewer.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/viewer.js b/src/viewer.js index 47a4108d..b7c4f08c 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -2912,9 +2912,16 @@ function onCanvasClick( event ) { this.viewport.applyConstraints(); } - if( gestureSettings.dblClickDragToZoom ) { - THIS[ this.hash ].lastClickTime = $.now(); + if( gestureSettings.dblClickDragToZoom){ + if(THIS[ this.hash ].draggingToZoom === true){ + THIS[ this.hash ].lastClickTime = null; + THIS[ this.hash ].draggingToZoom = false; + } + else{ + THIS[ this.hash ].lastClickTime = $.now(); + } } + } } @@ -3211,9 +3218,6 @@ function onCanvasPress( event ) { } function onCanvasRelease( event ) { - - var gestureSettings; - /** * Raised when the primary mouse button is released or touch ends on the {@link OpenSeadragon.Viewer#canvas} element. * @@ -3237,12 +3241,6 @@ function onCanvasRelease( event ) { insideElementReleased: event.insideElementReleased, originalEvent: event.originalEvent }); - - - gestureSettings = this.gestureSettingsByDeviceType( event.pointerType ); - if( gestureSettings.dblClickDragToZoom && THIS[ this.hash ].draggingToZoom === true ){ - THIS[ this.hash ].draggingToZoom = false; - } } function onCanvasNonPrimaryPress( event ) {