Given two boxes of different aspect ratios, calculates the values in order to make the child cover the parent. This acts similar to background: cover of css.
Imagine the following:
-------p--------| || ----- || | C | || ----- || |----------------- Copy
-------p--------| || ----- || | C | || ----- || |-----------------
This case, c would have to scale up to cover the parent. It would return something like:
Note on xOffset and yOffset, this algo assumes that the child will scale from the top left corner of the box and is positioned to the top left.
The parent element dimensions
The child elment dimensions
backgroundCoverBox The dimensions required to transform the child element to background cover.
Given two boxes of different aspect ratios, calculates the values in order to make the child cover the parent. This acts similar to background: cover of css.
Imagine the following:
This case, c would have to scale up to cover the parent. It would return something like:
Note on xOffset and yOffset, this algo assumes that the child will scale from the top left corner of the box and is positioned to the top left.