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

Add objectFit: "auto-cover" #378

Closed
vassbence opened this issue May 2, 2022 · 1 comment · Fixed by #379
Closed

Add objectFit: "auto-cover" #378

vassbence opened this issue May 2, 2022 · 1 comment · Fixed by #379
Labels
enhancement New feature or request PR-welcome help is welcomed for this issue released This issue/pull request has been released.

Comments

@vassbence
Copy link
Contributor

Some people already started discussing this at #186

The idea would be to create a new objectFit value which would automatically find the best fit based on the images width/height.

This can be done in user land like so:

... calculated the width and height of the image ...

<Cropper
  ...
  objectFit={width > height ? 'vertical-cover' : 'horizontal-cover'}
/>

but it would be nice if the package itself contined it as it is a fairly common use case.

@vassbence vassbence changed the title Add objectFit: "auto-fit" Add objectFit: "auto-cover" May 2, 2022
@ValentinH ValentinH added enhancement New feature or request PR-welcome help is welcomed for this issue labels May 2, 2022
@github-actions
Copy link

github-actions bot commented May 3, 2022

🚀 Issue was released in v4.2.0 🚀

@github-actions github-actions bot added the released This issue/pull request has been released. label May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PR-welcome help is welcomed for this issue released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants