mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 13:16:10 +03:00
apply only zoom constraint by default for scroll events
This commit is contained in:
parent
165aaebd4c
commit
a6d1472134
@ -3371,7 +3371,7 @@ function onCanvasScroll( event ) {
|
|||||||
factor,
|
factor,
|
||||||
gestureSettings.zoomToRefPoint ? this.viewport.pointFromPixel( event.position, true ) : null
|
gestureSettings.zoomToRefPoint ? this.viewport.pointFromPixel( event.position, true ) : null
|
||||||
);
|
);
|
||||||
this.viewport.applyConstraints();
|
this.viewport.applyZoomConstraints();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -591,6 +591,25 @@ $.Viewport.prototype = {
|
|||||||
return this;
|
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}
|
* Equivalent to {@link OpenSeadragon.Viewport#applyConstraints}
|
||||||
* @function
|
* @function
|
||||||
|
Loading…
Reference in New Issue
Block a user