UNPKG

fit-dimensions

Version:

A tiny utility function to fit a source rectangle within a target rectangle using popular object-fit modes (contain, cover, fill, none, scale-down). Maintains aspect ratio as needed. Useful for images, videos, UI elements, and more.

5 files
1.07 kB
3.38 kB
892 B
2.44 kB
1.75 kB