Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aspectRatio and minSize not working correctly #44

Open
CapnMarius opened this issue Oct 23, 2019 · 1 comment
Open

aspectRatio and minSize not working correctly #44

CapnMarius opened this issue Oct 23, 2019 · 1 comment

Comments

@CapnMarius
Copy link

CapnMarius commented Oct 23, 2019

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
Copy link
Author

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant