src/rectangle.js
function(rect) {
        var thisBoundingBox = this.getBoundingBox();
        var otherBoundingBox = rect.getBoundingBox();

        var left = Math.min(thisBoundingBox.x, otherBoundingBox.x);
        var top = Math.min(thisBoundingBox.y, otherBoundingBox.y);
        var right = Math.max(
            thisBoundingBox.x + thisBoundingBox.width,
            otherBoundingBox.x + otherBoundingBox.width);
        var bottom = Math.max(
            thisBoundingBox.y + thisBoundingBox.height,
            otherBoundingBox.y + otherBoundingBox.height);

        return new $.Rect(
            left,
            top,
            right - left,
            bottom - top);
    }
function(rect) {
        var thisBoundingBox = this.getBoundingBox();
        var otherBoundingBox = rect.getBoundingBox();

        var left = Math.min(thisBoundingBox.x, otherBoundingBox.x);
        var top = Math.min(thisBoundingBox.y, otherBoundingBox.y);
        var right = Math.max(
            thisBoundingBox.x + thisBoundingBox.width,
            otherBoundingBox.x + otherBoundingBox.width);
        var bottom = Math.max(
            thisBoundingBox.y + thisBoundingBox.height,
            otherBoundingBox.y + otherBoundingBox.height);

        return new $.Rect(
            left,
            top,
            right - left,
            bottom - top);
    }
function ( rect ) { var thisBoundingBox = this . getBoundingBox ( ) ; var otherBoundingBox = rect . getBoundingBox ( ) ; var left = Math . min ( thisBoundingBox . x , otherBoundingBox . x ) ; var top = Math . min ( thisBoundingBox . y , otherBoundingBox . y ) ; var right = Math . max ( thisBoundingBox . x + thisBoundingBox . width , otherBoundingBox . x + otherBoundingBox . width ) ; var bottom = Math . max ( thisBoundingBox . y + thisBoundingBox . height , otherBoundingBox . y + otherBoundingBox . height ) ; return new $ . Rect ( left , top , right - left , bottom - top ) ; }
Returns the smallest rectangle that will contain this and the given
rectangle bounding boxes.
@param {OpenSeadragon.Rect} rect
@return {OpenSeadragon.Rect} The new rectangle.
Returns the smallest rectangle that will contain this and the given rectangle bounding boxes .