advanced-cropper / vue-advanced-cropper

The advanced vue cropper library that gives you opportunity to create your own croppers suited for any website design
https://advanced-cropper.github.io/vue-advanced-cropper/
Other
931 stars 130 forks source link

pls disregard, answer found ..stencil area always smaller than image by default #203

Closed MarisKay closed 1 year ago

MarisKay commented 1 year ago

Pls disregard, already found an answer in example codes. Thank you!

Hello, i use the cropper with the following code <cropper v-show="imageInCanvas" ref="cropper" class="cropper" :src="image.src" :min-width="minWidth" :stencil-component="stencilComponent" :stencil-props="{ minAspectRatio: minAspectRatio, maxAspectRatio: maxAspectRatio, movable: true, resizable: true

        }"
    />

once i select the image and cropping stencil appears, stencil default area is always smaller than the image. In other words, if i want to upload full sized image (which satisfies my min and max aspect ratios), i always have to drag stencil area bigger to the boundaries of my image. Question - is it possible (and how?) to make stencil area maximum possible by default (taking into account min and max aspect ratios?) so user doesn't have to drag stencil to fit full image? At the same time - stencil still has to be modifyable, setting stencilSize is not the answer since it doesn't allow me to resize it anymore. Thank you!

DavidGheorghe commented 1 year ago

@MarisKay do you remember what you did to make it work? I have the same issue but for the circular stencil.

EDIT: I have found the solution as well. For anyone who is having the same issue, check setCoordinates method.