react-easy-crop
react-easy-crop copied to clipboard
CropArea won't fill parent when using rotated images
Describe the bug
The crop area is small than it's parent when using a rotation of 90 degrees. I expect the crop area to be the same size as the parent element. I've added a codesandbox for this issue https://codesandbox.io/s/elated-ritchie-ig1bgy
The image isn't rotated in the sandbox. Could you please update it t actually show the issue?
I forgot to save the sandbox, it should work now.
I see.
The thing is that the crop area size is also limited by the image size. The layout logic of the cropper works like this:
- the image is displayed with scale = 1 (no zoom)
- the image is rotated using a transform
- the crop area size is set in order to take the maximum space between the container size and the image size.
In your example, the rotated image behaves like a "portrait" one so the only way to have the crop area filling the parent would be for the crop area to also be "portrait" (3/4) for example.
@ValentinH, is there any way to get the expected output?
I don't think so.
Closing as there was no answer for a while. Comment to re-open 😉