#[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,
}Expand description
An axis-aligned rectangle with optional rounded corners.
Fields§
§width: f32§height: f32§x: f32§y: f32§radius_top_left: f32§radius_top_right: f32§radius_bottom_left: f32§radius_bottom_right: f32Implementations§
Source§impl SvgRect
impl SvgRect
Sourcepub fn union_with(&mut self, other: &SvgRect)
pub fn union_with(&mut self, other: &SvgRect)
Expands this rect to also contain other.
Sourcepub fn contains_point(&self, point: SvgPoint) -> bool
pub fn contains_point(&self, point: SvgPoint) -> 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
Sourcepub fn get_center(&self) -> SvgPoint
pub fn get_center(&self) -> SvgPoint
Returns the center point of the rect.
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 UnsafeUnpin 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 more