pub enum BackgroundImageFit {
Stretch,
Cover,
}Expand description
How a background_image fills its container rect when the image’s intrinsic
aspect ratio differs from the styled box.
Variants§
Stretch
Map the full texture over the rect (uv 0→1 on both axes). Distorts if
aspect ratios differ — equivalent to CSS background-size: 100% 100%.
Cover
Scale to cover the box, cropping overflow. Preserves aspect ratio —
equivalent to CSS background-size: cover. Requires the texture to be
loaded; on the loading frame the image is not painted.
Trait Implementations§
Source§impl Clone for BackgroundImageFit
impl Clone for BackgroundImageFit
Source§fn clone(&self) -> BackgroundImageFit
fn clone(&self) -> BackgroundImageFit
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for BackgroundImageFit
Source§impl Debug for BackgroundImageFit
impl Debug for BackgroundImageFit
Source§impl Default for BackgroundImageFit
impl Default for BackgroundImageFit
Source§fn default() -> BackgroundImageFit
fn default() -> BackgroundImageFit
Returns the “default value” for a type. Read more
impl Eq for BackgroundImageFit
Source§impl PartialEq for BackgroundImageFit
impl PartialEq for BackgroundImageFit
Source§fn eq(&self, other: &BackgroundImageFit) -> bool
fn eq(&self, other: &BackgroundImageFit) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for BackgroundImageFit
Auto Trait Implementations§
impl Freeze for BackgroundImageFit
impl RefUnwindSafe for BackgroundImageFit
impl Send for BackgroundImageFit
impl Sync for BackgroundImageFit
impl Unpin for BackgroundImageFit
impl UnsafeUnpin for BackgroundImageFit
impl UnwindSafe for BackgroundImageFit
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