fengyuanchen / cropper

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

Range for aspectRatio #1062

Closed eugene-g13 closed 5 years ago

eugene-g13 commented 5 years ago

First of all, thank you for great cropper!

My problem is I need cropper box have maximum and minimum constraints. Sides have to be from 1/1 to 1/2.5 (from square to rectangle with sides 1/2.5)

I need fast solution now and good solution after) Good solution is to have properties like aspectRatioFrom and aspectRatioTo, for example. And now I try to event.preventDefault() in cropstart event, but I do not see width and height in event details.

I use react-cropper.

Do you have good idea?

fengyuanchen commented 5 years ago

https://fengyuanchen.github.io/cropperjs/examples/a-range-of-aspect-ratio.html