Struct kurbo::RoundedRectRadii[][src]

pub struct RoundedRectRadii {
    pub top_left: f64,
    pub top_right: f64,
    pub bottom_right: f64,
    pub bottom_left: f64,
}
Expand description

Radii for each corner of a rounded rectangle.

The use of top as in top_left assumes a y-down coordinate space. Piet (and Druid by extension) uses a y-down coordinate space, but Kurbo also supports a y-up coordinate space, in which case top_left would actually refer to the bottom-left corner, and vice versa. Top may not always actually be the top, but top corners will always have a smaller y-value than bottom corners.

Fields

top_left: f64

The radius of the top-left corner.

top_right: f64

The radius of the top-right corner.

bottom_right: f64

The radius of the bottom-right corner.

bottom_left: f64

The radius of the bottom-left corner.

Implementations

Create a new RoundedRectRadii. This function takes radius values for the four corners. The argument order is “top_left, top_right, bottom_right, bottom_left”, or clockwise starting from top_left.

Create a new RoundedRectRadii from a single radius. The radius argument will be set as the radius for all four corners.

Takes the absolute value of all corner radii.

For each corner, takes the min of that corner’s radius and max.

Returns true if all radius values are finite.

Returns true if any corner radius value is NaN.

If all radii are equal, returns the value of the radii. Otherwise, returns None.

Trait Implementations

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

Performs the conversion.

Performs the conversion.

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

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)

recently added

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.