dist/js/cropjs.js
function (event) {
            var delta = Math.max(-1, Math.min(1, (event.wheelDelta || -event.detail)));
            var zoom = 0;

            if (delta < 0 && this._zoomLevel < this._zoomMax) {
                // Zoom in
                zoom = this._zoomLevel < 1 ? 0.01 : 0.03;
            }
            else if (delta > 0 && this._zoomLevel > this._zoomMin) {
                // Zoom out
                zoom = this._zoomLevel < 1 ? -0.01 : -0.03;
            }
            else {
                return;
            }

            // Calculate middle point change for zoom change
            var x = ((this._image.w / 2) + this._image.x) * zoom;
            var y = ((this._image.h / 2) + this._image.y) * zoom;

            // Adjust zoom
            this._zoomLevel += zoom;

            // Then move back to old middle point
            this._image.move({
              x: -x / this._zoomLevel,
              y: -y / this._zoomLevel
            });

            this.redraw();
        }
function (event) {
            var delta = Math.max(-1, Math.min(1, (event.wheelDelta || -event.detail)));
            var zoom = 0;

            if (delta < 0 && this._zoomLevel < this._zoomMax) {
                // Zoom in
                zoom = this._zoomLevel < 1 ? 0.01 : 0.03;
            }
            else if (delta > 0 && this._zoomLevel > this._zoomMin) {
                // Zoom out
                zoom = this._zoomLevel < 1 ? -0.01 : -0.03;
            }
            else {
                return;
            }

            // Calculate middle point change for zoom change
            var x = ((this._image.w / 2) + this._image.x) * zoom;
            var y = ((this._image.h / 2) + this._image.y) * zoom;

            // Adjust zoom
            this._zoomLevel += zoom;

            // Then move back to old middle point
            this._image.move({
              x: -x / this._zoomLevel,
              y: -y / this._zoomLevel
            });

            this.redraw();
        }
function ( event ) { var delta = Math . max ( - 1 , Math . min ( 1 , ( event . wheelDelta || - event . detail ) ) ) ; var zoom = 0 ; if ( delta < 0 && this . _zoomLevel < this . _zoomMax ) { // Zoom in zoom = this . _zoomLevel < 1 ? 0.01 : 0.03 ; } else if ( delta > 0 && this . _zoomLevel > this . _zoomMin ) { // Zoom out zoom = this . _zoomLevel < 1 ? - 0.01 : - 0.03 ; } else { return ; } // Calculate middle point change for zoom change var x = ( ( this . _image . w / 2 ) + this . _image . x ) * zoom ; var y = ( ( this . _image . h / 2 ) + this . _image . y ) * zoom ; // Adjust zoom this . _zoomLevel += zoom ; // Then move back to old middle point this . _image . move ( { x : - x / this . _zoomLevel , y : - y / this . _zoomLevel } ) ; this . redraw ( ) ; }
On mouse wheel event handler.

@fixme Fix code for calculating offsets based on current mouse point

@param event
On mouse wheel event handler .