May 18, 2019 at 12:55 am #288059
I have a parent element that is animating its shape from landscape to portrait and vice versa.
The parent element contains an image, which as its parent changes shape, is getting distorted.
I want the image to maintain correct proportions, staying in the middle of the parent while being cutoff at the edges for example.
This is similar to how an image maintains proportions using object-fit, but I can’t use that here because the parent is animated using transforms to avoid layout thrashing.
A simplified example of my problem => https://codepen.io/alexpi/pen/wbeXVXMay 19, 2019 at 4:34 am #288080
The only way I am aware of is to reverse scale the child at the same rate as the parent is scaled.May 20, 2019 at 6:39 am #288095
You must be logged in to reply to this topic.