fengyuanchen / cropper

⚠️ [Deprecated] No longer maintained, please use https://github.com/fengyuanchen/jquery-cropper
MIT License
7.75k stars 1.74k forks source link

Cropper container width and height is not equal canvas width and height #1088

Closed anishjana closed 4 years ago

anishjana commented 4 years ago

image

I am creating cropper on top of a canvas whose width and height is 500 and 225 resp but the cropper container width and height is 200 and 100 respectively (image attached for ref)

image

Below is the initialisation:

var cropper = new Cropper(cropper_canvas, {
    background: false,
    aspectRatio: cropper_ratio,
    viewMode: 1,
    dragMode: "move",
    responsive: true,
    cropBoxResizable: true,
    toggleDragModeOnDblclick: false,
    rounded: true
  });
fengyuanchen commented 4 years ago

You should set size on the parent element:

#crop-container {
  width: 500px;
  height: 400px;
}