satori
satori copied to clipboard
feat: Add limited support for objectPosition property on images
Currently any image that has objectFit
property will be centered without any way to control this behavior.
This PR adds a limited support for objectPosition
for images, by tweaking what is being passed to preserveAspectRatio
property.
By limited I mean you need to pass both X and Y, and for both of them you can pass only three keyword values:
- for X: left, center, right
- for Y: top, center, bottom
It is still something more than always center, so I hope it is useful enough to get merged.
I am marking this as draft, because I am not sure what is the preferred way of testing it. Should I convert the test cases to use snapshots?