#[repr(C)]pub struct SvgRect {
pub width: f32,
pub height: f32,
pub x: f32,
pub y: f32,
pub radius_top_left: f32,
pub radius_top_right: f32,
pub radius_bottom_left: f32,
pub radius_bottom_right: f32,
}
Fields§
§width: f32
§height: f32
§x: f32
§y: f32
§radius_top_left: f32
§radius_top_right: f32
§radius_bottom_left: f32
§radius_bottom_right: f32
Implementations§
Source§impl SvgRect
impl SvgRect
pub fn union_with(&mut self, other: &SvgRect)
Sourcepub fn contains_point(&self, x: f32, y: f32) -> bool
pub fn contains_point(&self, x: f32, y: f32) -> bool
Note: does not incorporate rounded edges! Origin of x and y is assumed to be the top left corner
Sourcepub fn expand(
&self,
padding_top: f32,
padding_bottom: f32,
padding_left: f32,
padding_right: f32,
) -> SvgRect
pub fn expand( &self, padding_top: f32, padding_bottom: f32, padding_left: f32, padding_right: f32, ) -> SvgRect
Expands the rect with a certain amount of padding
pub fn get_center(&self) -> SvgPoint
Trait Implementations§
Source§impl PartialOrd for SvgRect
impl PartialOrd for SvgRect
impl Copy for SvgRect
impl StructuralPartialEq for SvgRect
Auto Trait Implementations§
impl Freeze for SvgRect
impl RefUnwindSafe for SvgRect
impl Send for SvgRect
impl Sync for SvgRect
impl Unpin for SvgRect
impl UnwindSafe for SvgRect
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IsDefault for T
impl<T> IsDefault for T
Source§fn is_default(&self) -> bool
fn is_default(&self) -> bool
Checks that type has a default value.