[][src]Struct kurbo::RoundedRect

pub struct RoundedRect { /* fields omitted */ }

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.

The easiest way to create a RoundedRect is often to create a Rect, and then call to_rounded_rect.

Implementations

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.

See also Rect::to_rounded_rect, which offers the same utility.

pub fn from_points(
    p0: impl Into<Point>,
    p1: impl Into<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: impl Into<Point>,
    size: impl Into<Size>,
    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.

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 Clone for RoundedRect[src]

impl Copy for RoundedRect[src]

impl Debug for RoundedRect[src]

impl Default for RoundedRect[src]

impl<'de> Deserialize<'de> for RoundedRect[src]

impl Mul<RoundedRect> for TranslateScale[src]

type Output = RoundedRect

The resulting type after applying the * operator.

impl PartialEq<RoundedRect> for RoundedRect[src]

impl Serialize for RoundedRect[src]

impl Shape for RoundedRect[src]

type BezPathIter = RoundedRectPathIter

The iterator resulting from to_bez_path.

impl StructuralPartialEq for RoundedRect[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.