src/viewport.js
function(contentSize) {
        $.console.assert(contentSize, "[Viewport.resetContentSize] contentSize is required");
        $.console.assert(contentSize instanceof $.Point, "[Viewport.resetContentSize] contentSize must be an OpenSeadragon.Point");
        $.console.assert(contentSize.x > 0, "[Viewport.resetContentSize] contentSize.x must be greater than 0");
        $.console.assert(contentSize.y > 0, "[Viewport.resetContentSize] contentSize.y must be greater than 0");

        this._setContentBounds(new $.Rect(0, 0, 1, contentSize.y / contentSize.x), contentSize.x);
        return this;
    }
function(contentSize) {
        $.console.assert(contentSize, "[Viewport.resetContentSize] contentSize is required");
        $.console.assert(contentSize instanceof $.Point, "[Viewport.resetContentSize] contentSize must be an OpenSeadragon.Point");
        $.console.assert(contentSize.x > 0, "[Viewport.resetContentSize] contentSize.x must be greater than 0");
        $.console.assert(contentSize.y > 0, "[Viewport.resetContentSize] contentSize.y must be greater than 0");

        this._setContentBounds(new $.Rect(0, 0, 1, contentSize.y / contentSize.x), contentSize.x);
        return this;
    }
function ( contentSize ) { $ . console . assert ( contentSize , "[Viewport.resetContentSize] contentSize is required" ) ; $ . console . assert ( contentSize instanceof $ . Point , "[Viewport.resetContentSize] contentSize must be an OpenSeadragon.Point" ) ; $ . console . assert ( contentSize . x > 0 , "[Viewport.resetContentSize] contentSize.x must be greater than 0" ) ; $ . console . assert ( contentSize . y > 0 , "[Viewport.resetContentSize] contentSize.y must be greater than 0" ) ; this . _setContentBounds ( new $ . Rect ( 0 , 0 , 1 , contentSize . y / contentSize . x ) , contentSize . x ) ; return this ; }
Updates the viewport's home bounds and constraints for the given content size.
@function
@param {OpenSeadragon.Point} contentSize - size of the content in content units
@return {OpenSeadragon.Viewport} Chainable.
@fires OpenSeadragon.Viewer.event:reset-size
Updates the viewport s home bounds and constraints for the given content size .