added documentation to getConstrainedBounds

This commit is contained in:
Tom 2022-12-02 18:46:57 -05:00
parent ac18d5629d
commit aede32c335

View File

@ -616,7 +616,7 @@ $.Viewport.prototype = {
* @function * @function
* @param {Boolean} [immediately=false] * @param {Boolean} [immediately=false]
* @returns {OpenSeadragon.Viewport} Chainable. * @returns {OpenSeadragon.Viewport} Chainable.
* @fires OpenSeadragon.Viewer.event:constrain * @fires OpenSeadragon.Viewer.event:constrain if the
*/ */
applyConstraints: function(immediately) { applyConstraints: function(immediately) {
var actualZoom = this.getZoom(); var actualZoom = this.getZoom();
@ -627,10 +627,10 @@ $.Viewport.prototype = {
} }
var constrainedBounds = this.getConstrainedBounds(false); var constrainedBounds = this.getConstrainedBounds(false);
this._raiseConstraintsEvent(immediately);
if(constrainedBounds.constraintApplied){ if(constrainedBounds.constraintApplied){
this.fitBounds(constrainedBounds, immediately); this.fitBounds(constrainedBounds, immediately);
this._raiseConstraintsEvent(immediately);
} }
return this; return this;
@ -794,7 +794,9 @@ $.Viewport.prototype = {
* Returns bounds taking constraints into account * Returns bounds taking constraints into account
* Added to improve constrained panning * Added to improve constrained panning
* @param {Boolean} current - Pass true for the current location; defaults to false (target location). * @param {Boolean} current - Pass true for the current location; defaults to false (target location).
* @returns {OpenSeadragon.Viewport} Chainable. * @returns {OpenSeadragon.Rect} The bounds after applying constraints. The returned $.Rect contains additonal
* properties xConstrained, yConstrained, constraintsApplied indicating the status
* of the constraining operation; x and y are in the viewer element coordinate system.
*/ */
getConstrainedBounds: function(current) { getConstrainedBounds: function(current) {
var bounds, var bounds,