Skip to content

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

@hkrausmisc

Description

@hkrausmisc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions