From 7d6437b2cdda2a901a4a1180b779924c446ee296 Mon Sep 17 00:00:00 2001 From: Joe DF <3848219+joedf@users.noreply.github.com> Date: Wed, 18 May 2022 10:48:58 -0400 Subject: [PATCH] Revert "apply only zoom constraint by default for scroll events" This reverts commit a6d147213467f33635987ac2bf52a73b4c065477. --- src/viewer.js | 2 +- src/viewport.js | 19 ------------------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/src/viewer.js b/src/viewer.js index a1f965f8..ab779142 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -3371,7 +3371,7 @@ function onCanvasScroll( event ) { factor, gestureSettings.zoomToRefPoint ? this.viewport.pointFromPixel( event.position, true ) : null ); - this.viewport.applyZoomConstraints(); + this.viewport.applyConstraints(); } } diff --git a/src/viewport.js b/src/viewport.js index a8a53fa2..be350af9 100644 --- a/src/viewport.js +++ b/src/viewport.js @@ -591,25 +591,6 @@ $.Viewport.prototype = { return this; }, - /** - * Enforces the minZoom, maxZoom constraints by zooming to the closest acceptable zoom. - * @function - * @param {Boolean} [immediately=false] - * @return {OpenSeadragon.Viewport} Chainable. - * @fires OpenSeadragon.Viewer.event:constrain - */ - applyZoomConstraints: function(immediately) { - var actualZoom = this.getZoom(); - var constrainedZoom = this._applyZoomConstraints(actualZoom); - - if (actualZoom !== constrainedZoom) { - this.zoomTo(constrainedZoom, this.zoomPoint, immediately); - } - - this._raiseConstraintsEvent(immediately); - return this; - }, - /** * Equivalent to {@link OpenSeadragon.Viewport#applyConstraints} * @function