[−][src]Struct kurbo::RoundedRect
A rectangle with equally rounded corners.
By construction the rounded rectangle will have non-negative dimensions and radius clamped to half size of the rect.
Methods
impl RoundedRect
[src]
pub fn new(x0: f64, y0: f64, x1: f64, y1: f64, radius: f64) -> RoundedRect
[src]
A new rectangle from minimum and maximum coordinates.
The result will have non-negative width, height and radius.
pub fn from_rect(rect: Rect, radius: f64) -> RoundedRect
[src]
A new rounded rectangle from a rectangle and corner radius.
The result will have non-negative width, height and radius.
pub fn from_points(p0: Point, p1: Point, radius: f64) -> RoundedRect
[src]
A new rectangle from two points.
The result will have non-negative width, height and radius.
pub fn from_origin_size(origin: Point, size: Vec2, radius: f64) -> RoundedRect
[src]
A new rectangle from origin and size.
The result will have non-negative width, height and radius.
pub fn width(&self) -> f64
[src]
The width of the rectangle.
pub fn height(&self) -> f64
[src]
The height of the rectangle.
pub fn radius(&self) -> f64
[src]
Radius of the rounded corners. #[inline]
pub fn rect(&self) -> Rect
[src]
The (non-rounded) rectangle.
pub fn origin(&self) -> Point
[src]
The origin of the rectangle.
This is the top left corner in a y-down space.
pub fn center(&self) -> Point
[src]
The center point of the rectangle.
Trait Implementations
impl Shape for RoundedRect
[src]
type BezPathIter = RoundedRectPathIter
The iterator resulting from to_bez_path
.
fn to_bez_path(&self, tolerance: f64) -> RoundedRectPathIter
[src]
fn area(&self) -> f64
[src]
fn perimeter(&self, _accuracy: f64) -> f64
[src]
fn winding(&self, pt: Point) -> i32
[src]
fn bounding_box(&self) -> Rect
[src]
fn as_rounded_rect(&self) -> Option<RoundedRect>
[src]
fn into_bez_path(self, tolerance: f64) -> BezPath
[src]
fn as_line(&self) -> Option<Line>
[src]
fn as_rect(&self) -> Option<Rect>
[src]
fn as_circle(&self) -> Option<Circle>
[src]
fn as_path_slice(&self) -> Option<&[PathEl]>
[src]
impl Clone for RoundedRect
[src]
fn clone(&self) -> RoundedRect
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for RoundedRect
[src]
impl Default for RoundedRect
[src]
fn default() -> RoundedRect
[src]
impl Debug for RoundedRect
[src]
impl Mul<RoundedRect> for TranslateScale
[src]
type Output = RoundedRect
The resulting type after applying the *
operator.
fn mul(self, other: RoundedRect) -> RoundedRect
[src]
Auto Trait Implementations
impl Send for RoundedRect
impl Sync for RoundedRect
impl Unpin for RoundedRect
impl UnwindSafe for RoundedRect
impl RefUnwindSafe for RoundedRect
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,