CropperNoCropper icon indicating copy to clipboard operation
CropperNoCropper copied to clipboard

Force not less than width or height

Open ruhy99 opened this issue 6 years ago • 2 comments

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)

ruhy99 avatar Dec 31 '17 12:12 ruhy99

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.

jayrambhia avatar Dec 31 '17 15:12 jayrambhia

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?

matteinn avatar Apr 17 '18 16:04 matteinn