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

Force not less than width or height #35

Open
ruhy99 opened this issue Dec 31, 2017 · 2 comments
Open

Force not less than width or height #35

ruhy99 opened this issue Dec 31, 2017 · 2 comments

Comments

@ruhy99
Copy link

ruhy99 commented Dec 31, 2017

How to force to imageview to not be reduced less than width and height of the CropperView at the same time? I have tried to use isMakeSquare and then setting up back to the initial position but it's not clear. Please help! I try too with setMinZoom(0)

@jayrambhia
Copy link
Owner

setMinZoom(0) will not work.

From what I understand about what you're trying to achieve, you need to set a correct min zoom value.

minZoom = Math.min(width, height)/Math.max(width, height)

Set this value as min zoom. This value will make sure that the smallest side (width or height) will always be greater or equal to the size of the cropper view.

Alternatively, you can try this

minZoom = Math.max(width, height)/Math.min(width, height)

This min zoom will make sure that the biggest side (width or height) is always equal or greater than the size of the cropper view.

@matteinn
Copy link

Hey @jayrambhia , after setting a minZoom value I'm still able to zoom out so I guess it's not working as intended. Can you confirm, please?

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

3 participants