pax
pax copied to clipboard
Image fit attribute
This adds an optional parameter "fit" to images that allows for different modes of sizing to bounds:
/// Image fit/layout options
#[pax]
pub enum ImageFit {
/// Scale the image to perfectly fit within it's bounds vertically
FillVertical,
/// Scale the image to perfectly fit within it's bounds horizontally
FillHorizontal,
/// Scale the image to perfectly fit within it's bounds, choosing vertical or horizontal
/// based on which of them makes it fill the container, possibly clipping parts of the image
Fill,
/// Scale the image to perfectly fit within it's bounds, without clipping the image, possibly leaving some
/// of the available container area embty.
#[default]
Fit,
/// Stretch the image to fit the container
Stretch,
}