pub enum ImageFit {
Contain,
Cover,
Fill,
None,
}Expand description
How an image scales into its widget bounds.
Every mode centers its result; None draws at the image’s natural size
(one image pixel per device-independent pixel) and clips to the widget.
Variants§
Contain
Scale uniformly so both axes fit (letterbox on the shorter axis).
Cover
Scale uniformly to fill both axes, center-cropping the overflow.
Fill
Stretch non-uniformly to both axes (no crop, no letterbox).
None
Draw at the image’s natural size, centered and clipped.
Implementations§
Trait Implementations§
impl Copy for ImageFit
impl Eq for ImageFit
impl StructuralPartialEq for ImageFit
Auto Trait Implementations§
impl Forget for ImageFit
impl Freeze for ImageFit
impl Move 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