[−][src]Struct math2d::RoundedRect
Represents a rectangle with rounded corners described by ellipses that touch the internal edges of the rectangle at the tangent points.
Fields
rect: Rectf
The overall rectangle containing this rounded rectangle
radius_x: f32
The x-radius of the ellipse nested in each corner.
radius_y: f32
The y-radius of the ellipse nested in each corner.
Methods
impl RoundedRect
[src]
pub fn new(
rect: impl Into<Rectf>,
rx: f32,
ry: f32
) -> RoundedRect
[src]
rect: impl Into<Rectf>,
rx: f32,
ry: f32
) -> RoundedRect
Constructs the rounded rectangle from its components
pub fn corner_ellipse(&self, corner: RectCorner) -> Ellipse
[src]
Gets the ellipse that resides in the given corner of the rectangle
pub fn contains_point(
&self,
point: impl Into<Point2f>
) -> bool
[src]
&self,
point: impl Into<Point2f>
) -> bool
Checks if the given point resides within the rounded rectangle, taking care to exclude the parts of the corners that are excluded from the ellipses.
pub fn contains_point_crude(
&self,
point: impl Into<Point2f>
) -> bool
[src]
&self,
point: impl Into<Point2f>
) -> bool
Checks if the point resides within the rectangle without checking the
corner cases of being inside the square rectangle but not inside the
rounded corners. This function may be decently faster than
contains_point
.
Trait Implementations
impl Clone for RoundedRect
[src]
fn clone(&self) -> RoundedRect
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for RoundedRect
[src]
impl PartialEq<RoundedRect> for RoundedRect
[src]
fn eq(&self, other: &RoundedRect) -> bool
[src]
fn ne(&self, other: &RoundedRect) -> bool
[src]
impl Default for RoundedRect
[src]
fn default() -> RoundedRect
[src]
impl<R> From<(R, f32, f32)> for RoundedRect where
R: Into<Rectf>,
[src]
R: Into<Rectf>,
impl From<RoundedRect> for D2D1_ROUNDED_RECT
[src]
fn from(rect: RoundedRect) -> D2D1_ROUNDED_RECT
[src]
impl From<D2D1_ROUNDED_RECT> for RoundedRect
[src]
fn from(rect: D2D1_ROUNDED_RECT) -> RoundedRect
[src]
impl Debug for RoundedRect
[src]
impl Serialize for RoundedRect
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for RoundedRect
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Send for RoundedRect
impl Sync for RoundedRect
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,