pr changes

This commit is contained in:
Hamza Tatheer 2022-11-12 16:32:45 +05:00
parent cb2fbe9b50
commit 6540a57aa9
2 changed files with 4 additions and 2 deletions

View File

@ -411,7 +411,7 @@
* The "zoom distance" per mouse scroll or touch pinch. <em><strong>Note:</strong> Setting this to 1.0 effectively disables the mouse-wheel zoom feature (also see gestureSettings[Mouse|Touch|Pen].scrollToZoom}).</em> * The "zoom distance" per mouse scroll or touch pinch. <em><strong>Note:</strong> Setting this to 1.0 effectively disables the mouse-wheel zoom feature (also see gestureSettings[Mouse|Touch|Pen].scrollToZoom}).</em>
* *
* @property {Number} [zoomPerDblClickDrag=1.2] * @property {Number} [zoomPerDblClickDrag=1.2]
* The "zoom distance" per mouse drag. <em><strong>Note:</strong> Setting this to 1.0 effectively disables the double-click-drag-to-Zoom feature (also see gestureSettings[Mouse|Touch|Pen].dblClickDragToZoom).</em> * The "zoom distance" per double-click mouse drag. <em><strong>Note:</strong> Setting this to 1.0 effectively disables the double-click-drag-to-Zoom feature (also see gestureSettings[Mouse|Touch|Pen].dblClickDragToZoom).</em>
* *
* @property {Number} [zoomPerSecond=1.0] * @property {Number} [zoomPerSecond=1.0]
* Sets the zoom amount per second when zoomIn/zoomOut buttons are pressed and held. * Sets the zoom amount per second when zoomIn/zoomOut buttons are pressed and held.

View File

@ -215,6 +215,7 @@ $.Viewer = function( options ) {
onfullscreenchange: null, onfullscreenchange: null,
lastClickTime: null, lastClickTime: null,
draggingToZoom: false, draggingToZoom: false,
dblClickTimeThreshold: 1000
}; };
this._sequenceIndex = 0; this._sequenceIndex = 0;
@ -3200,6 +3201,7 @@ function onCanvasPress( event ) {
gestureSettings = this.gestureSettingsByDeviceType( event.pointerType ); gestureSettings = this.gestureSettingsByDeviceType( event.pointerType );
if ( gestureSettings.dblClickDragToZoom ){ if ( gestureSettings.dblClickDragToZoom ){
var dblClickTimeThreshold = THIS[ this.hash ].dblClickTimeThreshold;
var lastClickTime = THIS[ this.hash ].lastClickTime; var lastClickTime = THIS[ this.hash ].lastClickTime;
var currClickTime = $.now(); var currClickTime = $.now();
@ -3207,7 +3209,7 @@ function onCanvasPress( event ) {
return; return;
} }
if ((currClickTime - lastClickTime) < 2000) { if ((currClickTime - lastClickTime) < dblClickTimeThreshold) {
THIS[ this.hash ].draggingToZoom = true; THIS[ this.hash ].draggingToZoom = true;
} }