diff --git a/src/viewport.js b/src/viewport.js index 76becbeb..abdd6892 100644 --- a/src/viewport.js +++ b/src/viewport.js @@ -801,10 +801,10 @@ $.Viewport.prototype = { * Returns bounds taking constraints into account * Added to improve constrained panning * @param {Boolean} current - Pass true for the current location; defaults to false (target location). - * @returns {OpenSeadragon.Rect} The bounds after applying constraints. The returned $.Rect contains additonal - * properties constraintsApplied, xConstrained and yConstrained. These flags indicate - * whether the viewport bounds were modified by the constraints of the viewer rectangle, - * and in which dimension(s). + * @returns {OpenSeadragon.Rect} The bounds in viewport coordinates after applying constraints. The returned $.Rect + * contains additonal properties constraintsApplied, xConstrained and yConstrained. + * These flags indicate whether the viewport bounds were modified by the constraints + * of the viewer rectangle, and in which dimension(s). */ getConstrainedBounds: function(current) { var bounds, diff --git a/test/demo/fitboundswithconstraints.html b/test/demo/fitboundswithconstraints.html index 85ce14bb..d91c52e5 100644 --- a/test/demo/fitboundswithconstraints.html +++ b/test/demo/fitboundswithconstraints.html @@ -12,9 +12,10 @@ border:thin black solid; margin-right:20px; } - - #controls li { - cursor: pointer; + #buttons button{ + width:10em; + text-align:center; + margin:5px; } .layout{ display:grid; @@ -63,7 +64,7 @@ setTimeout(() => viewport.applyConstraints(), 1000);
Pick an overlay above to show the bounds@@ -122,7 +123,8 @@ setTimeout(() => viewport.applyConstraints(), 1000); viewer.currentOverlays.forEach(overlay=>{ var text = $(overlay.element).text(); - $('