pub enum ImageFit {
Fill,
Contain,
Cover,
ScaleDown,
None,
}Expand description
Controls how an image fills its layout bounds.
Variants§
Fill
Stretch to fill the bounds, ignoring aspect ratio.
Contain
Scale uniformly to fit within the bounds, preserving aspect ratio.
Cover
Scale uniformly to cover the bounds, clipping if necessary.
ScaleDown
Like Contain, but never upscales below natural size.
None
Render at the image’s natural pixel size; no scaling.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ImageFit
impl RefUnwindSafe for ImageFit
impl Send for ImageFit
impl Sync for ImageFit
impl Unpin for ImageFit
impl UnsafeUnpin for ImageFit
impl UnwindSafe for ImageFit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more