pub enum PreserveAspectRatio {
None,
XMinYMin(MeetOrSlice),
XMidYMin(MeetOrSlice),
XMaxYMin(MeetOrSlice),
XMinYMid(MeetOrSlice),
XMidYMid(MeetOrSlice),
XMaxYMid(MeetOrSlice),
XMinYMax(MeetOrSlice),
XMidYMax(MeetOrSlice),
XMaxYMax(MeetOrSlice),
}Expand description
In some cases, typically when using the ‘viewBox’ attribute, i t is desirable that the graphics stretch to fit non-uniformly to take up the entire viewport. In other cases, it is desirable that uniform scaling be used for the purposes of preserving the aspect ratio of the graphics.
Variants§
None
XMinYMin(MeetOrSlice)
Force uniform scaling
Align the <min-x> of the element’s ‘viewBox’ with the smallest X value of the viewport.
Align the <min-y> of the element’s ‘viewBox’ with the smallest Y value of the viewport.
XMidYMin(MeetOrSlice)
Force uniform scaling.
Align the midpoint X value of the element’s ‘viewBox’ with the midpoint X value of the viewport.
Align the <min-y> of the element’s ‘viewBox’ with the smallest Y value of the viewport.
XMaxYMin(MeetOrSlice)
Force uniform scaling.
Align the <min-x>+<width> of the element’s ‘viewBox’ with the maximum X value of the viewport.
Align the <min-y> of the element’s ‘viewBox’ with the smallest Y value of the viewport.
XMinYMid(MeetOrSlice)
Force uniform scaling.
Align the <min-x> of the element’s ‘viewBox’ with the smallest X value of the viewport.
Align the midpoint Y value of the element’s ‘viewBox’ with the midpoint Y value of the viewport.
XMidYMid(MeetOrSlice)
Force uniform scaling(the default).
Align the midpoint X value of the element’s ‘viewBox’ with the midpoint X value of the viewport. Align the midpoint Y value of the element’s ‘viewBox’ with the midpoint Y value of the viewport.
XMaxYMid(MeetOrSlice)
Force uniform scaling.
Align the <min-x>+<width> of the element’s ‘viewBox’ with the maximum X value of the viewport.
Align the midpoint Y value of the element’s ‘viewBox’ with the midpoint Y value of the viewport.
XMinYMax(MeetOrSlice)
Force uniform scaling.
Align the <min-x> of the element’s ‘viewBox’ with the smallest X value of the viewport.
Align the <min-y>+<height> of the element’s ‘viewBox’ with the maximum Y value of the viewport.
XMidYMax(MeetOrSlice)
Force uniform scaling.
Align the midpoint X value of the element’s ‘viewBox’ with the midpoint X value of the viewport.
Align the <min-y>+<height> of the element’s ‘viewBox’ with the maximum Y value of the viewport.
XMaxYMax(MeetOrSlice)
Force uniform scaling.
Align the <min-x>+<width> of the element’s ‘viewBox’ with the maximum X value of the viewport.
Align the <min-y>+<height> of the element’s ‘viewBox’ with the maximum Y value of the viewport.
Trait Implementations§
Source§impl Clone for PreserveAspectRatio
impl Clone for PreserveAspectRatio
Source§fn clone(&self) -> PreserveAspectRatio
fn clone(&self) -> PreserveAspectRatio
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PreserveAspectRatio
impl Debug for PreserveAspectRatio
Source§impl<'de> Deserialize<'de> for PreserveAspectRatio
impl<'de> Deserialize<'de> for PreserveAspectRatio
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Deserialize for PreserveAspectRatio
impl Deserialize for PreserveAspectRatio
type Value = PreserveAspectRatio
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer,
derserializer.Source§impl From<PreserveAspectRatio> for Data
impl From<PreserveAspectRatio> for Data
Source§fn from(value: PreserveAspectRatio) -> Self
fn from(value: PreserveAspectRatio) -> Self
Source§impl FromSvg for PreserveAspectRatio
Available on crate feature svg only.
impl FromSvg for PreserveAspectRatio
svg only.