Croppr.js icon indicating copy to clipboard operation
Croppr.js copied to clipboard

aspectRatio and minSize not working correctly

Open CapnMarius opened this issue 6 years ago • 1 comments

The combination of aspectRatio and minSize is buggy when the ratio is vertical.

cropper with aspectRatio: 1.3333333333333333 minSize: [ 300, 400, "px" ] startSize: [ 1200, 675, "px" ]

The minimum crop result should be 300 * 400 But the cropper "snaps" from 400 * 533 to 300 * 533

CapnMarius avatar Oct 23 '19 11:10 CapnMarius

I fixed it. The constrainToSize function in box.js has a bug on line 212.

minHeight = minHeight * ratio; must be minHeight = minWidth * ratio;

CapnMarius avatar Oct 28 '19 10:10 CapnMarius