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

Re-sizing only works with CSS "object-fit: fill" (not contain or cover) #87

Open
hkrausmisc opened this issue Feb 12, 2022 · 1 comment

Comments

@hkrausmisc
Copy link

hkrausmisc commented Feb 12, 2022

When using "contain" or "cover" the resizer is not able to maintain the hot spots over the target areas.
The image will not change aspect ratio for contain or cover, and If you re-size the viewport to mismatch the image ratio (leaving empty space at top or sides) then the resizer no longer works correctly.

https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit

Really nice utility by the way, thank you for providing it to the community.
Thanks!

Edit: I just noticed there was a previous GitHub Issue #85 submitted which is very similar to the one here, just less specific (object-fit defaults to "fill" which does work correctly). Didn't mean to cause any duplication.

@davidjbradshaw
Copy link
Owner

Any ideas on how to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants