pub enum SvgFit {
Contain,
Cover,
Stretch,
}Available on crate feature
svg-import only.Expand description
How the SVG’s own coordinate box is placed in the destination rectangle.
An enum rather than a preserve_aspect: bool, because the three answers
are genuinely different placements and the caller is choosing between
them, not toggling one off.
Variants§
Contain
Scale uniformly until the SVG fits inside the rectangle, and centre
what is left over. The default, and what preserveAspectRatio’s own
default xMidYMid meet means.
Cover
Scale uniformly until the SVG covers the rectangle, centred; the overflow is clipped to the rectangle.
Stretch
Scale each axis independently so the SVG exactly fills the rectangle,
distorting it. preserveAspectRatio="none".
Trait Implementations§
impl Copy for SvgFit
impl Eq for SvgFit
impl StructuralPartialEq for SvgFit
Auto Trait Implementations§
impl Freeze for SvgFit
impl RefUnwindSafe for SvgFit
impl Send for SvgFit
impl Sync for SvgFit
impl Unpin for SvgFit
impl UnsafeUnpin for SvgFit
impl UnwindSafe for SvgFit
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