pub struct ImageSize {
pub maintain_aspect_ratio: bool,
pub max_size: Vec2,
pub fit: ImageFit,
}Expand description
This type determines the constraints on how the size of an image should be calculated.
Fields§
§maintain_aspect_ratio: boolWhether or not the final size should maintain the original aspect ratio.
This setting is applied last.
This defaults to true.
max_size: Vec2Determines the maximum size of the image.
Defaults to Vec2::INFINITY (no limit).
fit: ImageFitDetermines how the image should shrink/expand/stretch/etc. to fit within its allocated space.
This setting is applied first.
Defaults to ImageFit::Fraction([1, 1])
Implementations§
Trait Implementations§
impl Copy for ImageSize
Auto Trait Implementations§
impl Freeze for ImageSize
impl RefUnwindSafe for ImageSize
impl Send for ImageSize
impl Sync for ImageSize
impl Unpin for ImageSize
impl UnwindSafe for ImageSize
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