function SnapZoom(parent, options) {
        _classCallCheck(this, SnapZoom);

        var _this = _possibleConstructorReturn(this, (SnapZoom.__proto__ || Object.getPrototypeOf(SnapZoom)).call(this, parent));

        options = options || {};
        _this.width = options.width;
        _this.height = options.height;
        if (_this.width > 0) {
            _this.x_scale = parent._screenWidth / _this.width;
        }
        if (_this.height > 0) {
            _this.y_scale = parent._screenHeight / _this.height;
        }
        _this.xIndependent = utils.exists(_this.x_scale);
        _this.yIndependent = utils.exists(_this.y_scale);
        _this.x_scale = _this.xIndependent ? _this.x_scale : _this.y_scale;
        _this.y_scale = _this.yIndependent ? _this.y_scale : _this.x_scale;

        _this.time = utils.defaults(options.time, 1000);
        _this.ease = utils.ease(options.ease, 'easeInOutSine');
        _this.center = options.center;
        _this.noMove = options.noMove;
        _this.stopOnResize = options.stopOnResize;
        _this.removeOnInterrupt = options.removeOnInterrupt;
        _this.removeOnComplete = utils.defaults(options.removeOnComplete, true);
        _this.interrupt = utils.defaults(options.interrupt, true);
        if (_this.time === 0) {
            parent.container.scale.x = _this.x_scale;
            parent.container.scale.y = _this.y_scale;
            if (_this.removeOnComplete) {
                _this.parent.removePlugin('snap-zoom');
            }
        } else if (options.forceStart) {
            _this.createSnapping();
        }
        return _this;
    }
function SnapZoom(parent, options) {
        _classCallCheck(this, SnapZoom);

        var _this = _possibleConstructorReturn(this, (SnapZoom.__proto__ || Object.getPrototypeOf(SnapZoom)).call(this, parent));

        options = options || {};
        _this.width = options.width;
        _this.height = options.height;
        if (_this.width > 0) {
            _this.x_scale = parent._screenWidth / _this.width;
        }
        if (_this.height > 0) {
            _this.y_scale = parent._screenHeight / _this.height;
        }
        _this.xIndependent = utils.exists(_this.x_scale);
        _this.yIndependent = utils.exists(_this.y_scale);
        _this.x_scale = _this.xIndependent ? _this.x_scale : _this.y_scale;
        _this.y_scale = _this.yIndependent ? _this.y_scale : _this.x_scale;

        _this.time = utils.defaults(options.time, 1000);
        _this.ease = utils.ease(options.ease, 'easeInOutSine');
        _this.center = options.center;
        _this.noMove = options.noMove;
        _this.stopOnResize = options.stopOnResize;
        _this.removeOnInterrupt = options.removeOnInterrupt;
        _this.removeOnComplete = utils.defaults(options.removeOnComplete, true);
        _this.interrupt = utils.defaults(options.interrupt, true);
        if (_this.time === 0) {
            parent.container.scale.x = _this.x_scale;
            parent.container.scale.y = _this.y_scale;
            if (_this.removeOnComplete) {
                _this.parent.removePlugin('snap-zoom');
            }
        } else if (options.forceStart) {
            _this.createSnapping();
        }
        return _this;
    }
function SnapZoom ( parent , options ) { _classCallCheck ( this , SnapZoom ) ; var _this = _possibleConstructorReturn ( this , ( SnapZoom . __proto__ || Object . getPrototypeOf ( SnapZoom ) ) . call ( this , parent ) ) ; options = options || { } ; _this . width = options . width ; _this . height = options . height ; if ( _this . width > 0 ) { _this . x_scale = parent . _screenWidth / _this . width ; } if ( _this . height > 0 ) { _this . y_scale = parent . _screenHeight / _this . height ; } _this . xIndependent = utils . exists ( _this . x_scale ) ; _this . yIndependent = utils . exists ( _this . y_scale ) ; _this . x_scale = _this . xIndependent ? _this . x_scale : _this . y_scale ; _this . y_scale = _this . yIndependent ? _this . y_scale : _this . x_scale ; _this . time = utils . defaults ( options . time , 1000 ) ; _this . ease = utils . ease ( options . ease , 'easeInOutSine' ) ; _this . center = options . center ; _this . noMove = options . noMove ; _this . stopOnResize = options . stopOnResize ; _this . removeOnInterrupt = options . removeOnInterrupt ; _this . removeOnComplete = utils . defaults ( options . removeOnComplete , true ) ; _this . interrupt = utils . defaults ( options . interrupt , true ) ; if ( _this . time === 0 ) { parent . container . scale . x = _this . x_scale ; parent . container . scale . y = _this . y_scale ; if ( _this . removeOnComplete ) { _this . parent . removePlugin ( 'snap-zoom' ) ; } } else if ( options . forceStart ) { _this . createSnapping ( ) ; } return _this ; }
@private
@param {Viewport} parent
@param {object} [options]
@param {number} [options.width] the desired width to snap (to maintain aspect ratio, choose only width or height)
@param {number} [options.height] the desired height to snap (to maintain aspect ratio, choose only width or height)
@param {number} [options.time=1000]
@param {string|function} [options.ease=easeInOutSine] ease function or name (see http://easings.net/ for supported names)
@param {PIXI.Point} [options.center] place this point at center during zoom instead of center of the viewport
@param {boolean} [options.interrupt=true] pause snapping with any user input on the viewport
@param {boolean} [options.removeOnComplete] removes this plugin after snapping is complete
@param {boolean} [options.removeOnInterrupt] removes this plugin if interrupted by any user input
@param {boolean} [options.forceStart] starts the snap immediately regardless of whether the viewport is at the desired zoom
@param {boolean} [options.noMove] zoom but do not move

@event snap-zoom-start(Viewport) emitted each time a fit animation starts
@event snap-zoom-end(Viewport) emitted each time fit reaches its target
@event snap-zoom-end(Viewport) emitted each time fit reaches its target
@private @param { Viewport } parent @param { object } [ options ] @param { number } [ options . width ] the desired width to snap ( to maintain aspect ratio choose only width or height ) @param { number } [ options . height ] the desired height to snap ( to maintain aspect ratio choose only width or height ) @param { number } [ options . time = 1000 ] @param { string|function } [ options . ease = easeInOutSine ] ease function or name ( see http : // easings . net / for supported names ) @param { PIXI . Point } [ options . center ] place this point at center during zoom instead of center of the viewport @param { boolean } [ options . interrupt = true ] pause snapping with any user input on the viewport @param { boolean } [ options . removeOnComplete ] removes this plugin after snapping is complete @param { boolean } [ options . removeOnInterrupt ] removes this plugin if interrupted by any user input @param { boolean } [ options . forceStart ] starts the snap immediately regardless of whether the viewport is at the desired zoom @param { boolean } [ options . noMove ] zoom but do not move