Struct kurbo::RoundedRect[][src]

pub struct RoundedRect { /* fields omitted */ }
Expand description

A rectangle with equally rounded corners.

By construction the rounded rectangle will have non-negative dimensions and radii 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.

use kurbo::{RoundedRect, RoundedRectRadii};

// Create a rounded rectangle with a single radius for all corners:
RoundedRect::new(0.0, 0.0, 10.0, 10.0, 5.0);

// Or, specify different radii for each corner, clockwise from the top-left:
RoundedRect::new(0.0, 0.0, 10.0, 10.0, (1.0, 2.0, 3.0, 4.0));

Implementations

A new rectangle from minimum and maximum coordinates.

The result will have non-negative width, height and radii.

A new rounded rectangle from a rectangle and corner radii.

The result will have non-negative width, height and radii.

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

A new rectangle from two Points.

The result will have non-negative width, height and radius.

A new rectangle from origin and size.

The result will have non-negative width, height and radius.

The width of the rectangle.

The height of the rectangle.

Radii of the rounded corners.

The (non-rounded) rectangle.

The origin of the rectangle.

This is the top left corner in a y-down space.

The center point of the rectangle.

Is this rounded rectangle finite?

Is this rounded rectangle NaN?

Trait Implementations

The resulting type after applying the + operator.

Performs the + operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

The name of the generated JSON Schema. Read more

Generates a JSON Schema for this type. Read more

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

The iterator returned by the path_elements method. Read more

Returns an iterator over this shape expressed as PathEls; that is, as Bézier path elements. Read more

Signed area. Read more

Total length of perimeter.

The winding number of a point. Read more

The smallest rectangle that encloses the shape.

If the shape is a rounded rectangle, make it available.

Convert to a Bézier path. Read more

Convert into a Bézier path. Read more

Returns an iterator over this shape expressed as Bézier path segments (PathSegs). Read more

Returns true if the Point is inside this shape. Read more

If the shape is a line, make it available.

If the shape is a rectangle, make it available.

If the shape is a circle, make it available.

If the shape is stored as a slice of path elements, make that available. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.