pub enum ImageFit {
Fill,
Contain,
Cover,
None,
}Expand description
Controls how the image is scaled to fit the widget’s bounding box.
Variants§
Fill
Stretch to fill the target rect exactly (may distort aspect ratio).
Contain
Scale uniformly to fit within the rect, preserving aspect ratio (letterbox).
Cover
Scale uniformly to cover the rect, cropping edges (center crop).
None
Natural size — no scaling (may be clipped if larger than the widget).
Trait Implementations§
impl StructuralPartialEq for ImageFit
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