Home > Enterprise >  Antd ImgCrop when minZoom below 1 always get cropped like zoom 1
Antd ImgCrop when minZoom below 1 always get cropped like zoom 1

Time:09-19

I am using antd imgCrop for cropping image. I want to make the image not cropped when zoom below 1.

The example is below:

When i zoom out like that i want the image have a white space like the screenshot with red border. enter image description here

original image enter image description here but the result my image get cropped enter image description here

is there a way so my image not getting cropped when zoom below 1? so the output is image with whitespace. https://codesandbox.io/s/antd-img-crop-forked-x8j16z?file=/src/index.js

Thank you before

CodePudding user response:

I have found the solution by Adding Cropperprops and set restric position to false

<ImgCrop
   cropperProps={{ restrictPosition: false }}
>
  • Related