Is it possible to control how much vertical space is left between the crop selection region and the inactive area? #530
Answered
by
ValentinH
KevinJHall-Launchpad
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
ValentinH
Apr 19, 2024
Replies: 2 comments 1 reply
-
What do you expect to do to "equalize"? I don't really understand what result you are looking for. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to compute the aspect ratio of the image selected by the user and then modify the Cropper container to have this ratio. Indeed, the cropper just fills its parent so it's the parent component responsibility to have the right dimensions.
If your user is selecting the image from disk, you can get inspiration from this example to learn how to read the image.
Otherwise, you can use the
onMediaLoaded
prop to get the image dimensions once it's loaded to then compute the aspect ratio.