fit
Places content in a container like CSS object-fit and object-position, e.g. to show a
design frame in a viewport of another size.
The result is the matrix from content coordinates to container coordinates: a and d are
the scales, e and f the position of the content’s top-left corner. Map points with
Matrix::apply, combine it with Matrix::multiply, or write it with
Matrix::to_css. Sizes are expected to be positive.
Import
Section titled “Import”Cargo feature geometry (enabled by default). To compile only this module:
or in Cargo.toml:
Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
content | Size | The size of the content. |
container | Size | The size of the container. |
mode | FitMode | How to size the content. |
align | FitAlign | Where to place it. |
Returns
Section titled “Returns”Matrix — The content-to-container matrix.
