dist/cropper.common.js
function setCanvasData(data) {
    var canvasData = this.canvasData;
    var aspectRatio = canvasData.aspectRatio;

    if (this.ready && !this.disabled && isPlainObject(data)) {
      if (isNumber(data.left)) {
        canvasData.left = data.left;
      }

      if (isNumber(data.top)) {
        canvasData.top = data.top;
      }

      if (isNumber(data.width)) {
        canvasData.width = data.width;
        canvasData.height = data.width / aspectRatio;
      } else if (isNumber(data.height)) {
        canvasData.height = data.height;
        canvasData.width = data.height * aspectRatio;
      }

      this.renderCanvas(true);
    }

    return this;
  }
function setCanvasData(data) {
    var canvasData = this.canvasData;
    var aspectRatio = canvasData.aspectRatio;

    if (this.ready && !this.disabled && isPlainObject(data)) {
      if (isNumber(data.left)) {
        canvasData.left = data.left;
      }

      if (isNumber(data.top)) {
        canvasData.top = data.top;
      }

      if (isNumber(data.width)) {
        canvasData.width = data.width;
        canvasData.height = data.width / aspectRatio;
      } else if (isNumber(data.height)) {
        canvasData.height = data.height;
        canvasData.width = data.height * aspectRatio;
      }

      this.renderCanvas(true);
    }

    return this;
  }
function setCanvasData ( data ) { var canvasData = this . canvasData ; var aspectRatio = canvasData . aspectRatio ; if ( this . ready && ! this . disabled && isPlainObject ( data ) ) { if ( isNumber ( data . left ) ) { canvasData . left = data . left ; } if ( isNumber ( data . top ) ) { canvasData . top = data . top ; } if ( isNumber ( data . width ) ) { canvasData . width = data . width ; canvasData . height = data . width / aspectRatio ; } else if ( isNumber ( data . height ) ) { canvasData . height = data . height ; canvasData . width = data . height * aspectRatio ; } this . renderCanvas ( true ) ; } return this ; }
Set the canvas position and size with new data.
@param {Object} data - The new canvas data.
@returns {Cropper} this
Set the canvas position and size with new data .