# RoundedRectKeypoints

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/media/struct-roundedrectkeypoints/

**struct** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
struct RoundedRectKeypoints
```

Represents the keypoints of a rounded rectangle.
These keypoints can be shared between methods and turned into geometry.

A rounded rectangle is the base geometric shape used when drawing borders.
It is a superset of a simple rectangle (which has corner radii set to zero).
These keypoints can be combined together to produce geometries for both background
and border elements.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/geometry_builder.rs#L415)

## Members

- [`left_top`](#struct_field-left_top)
- [`top_left`](#struct_field-top_left)
- [`top_right`](#struct_field-top_right)
- [`right_top`](#struct_field-right_top)
- [`right_bottom`](#struct_field-right_bottom)
- [`bottom_right`](#struct_field-bottom_right)
- [`bottom_left`](#struct_field-bottom_left)
- [`left_bottom`](#struct_field-left_bottom)
- [`new`](#function-new)
- [`from_rounded_rect`](#function-from_rounded_rect)
- [`is_rounded`](#function-is_rounded)
- [`to_rect`](#function-to_rect)
- [`to_rounded_rect`](#function-to_rounded_rect)

<a id="struct_field-left_top"></a>

### left_top

```rust
left_top: crate::Point
```

The topmost point in the left line segment of the rectangle.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/geometry_builder.rs#L417)

<a id="struct_field-top_left"></a>

### top_left

```rust
top_left: crate::Point
```

The leftmost point in the top line segment of the rectangle.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/geometry_builder.rs#L419)

<a id="struct_field-top_right"></a>

### top_right

```rust
top_right: crate::Point
```

The rightmost point in the top line segment of the rectangle.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/geometry_builder.rs#L421)

<a id="struct_field-right_top"></a>

### right_top

```rust
right_top: crate::Point
```

The topmost point in the right line segment of the rectangle.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/geometry_builder.rs#L423)

<a id="struct_field-right_bottom"></a>

### right_bottom

```rust
right_bottom: crate::Point
```

The bottommost point in the right line segment of the rectangle.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/geometry_builder.rs#L425)

<a id="struct_field-bottom_right"></a>

### bottom_right

```rust
bottom_right: crate::Point
```

The rightmost point in the bottom line segment of the rectangle.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/geometry_builder.rs#L427)

<a id="struct_field-bottom_left"></a>

### bottom_left

```rust
bottom_left: crate::Point
```

The leftmost point in the bottom line segment of the rectangle.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/geometry_builder.rs#L429)

<a id="struct_field-left_bottom"></a>

### left_bottom

```rust
left_bottom: crate::Point
```

The bottommost point in the left line segment of the rectangle.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/geometry_builder.rs#L431)

<a id="function-new"></a>

### new

```rust
fn new() -> Self
```

Initializes a new instance of the `RoundedRectKeypoints` struct.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/geometry_builder.rs#L436)

<a id="function-from_rounded_rect"></a>

### from_rounded_rect

```rust
fn from_rounded_rect(rounded_rect: RoundedRect) -> Self
```

Initializes a new instance of the `RoundedRectKeypoints` struct.

* `rounded_rect` - An existing `RoundedRect` to initialize keypoints with.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/geometry_builder.rs#L443)

<a id="function-is_rounded"></a>

### is_rounded

```rust
fn is_rounded(self: &Self) -> bool
```

Gets a value indicating whether the rounded rectangle is actually rounded on
any corner. If false the key points represent a simple rectangle.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/geometry_builder.rs#L465)

<a id="function-to_rect"></a>

### to_rect

```rust
fn to_rect(self: &Self) -> Rect
```

Converts the keypoints into a simple rectangle (with no corners).
This is equivalent to the outer rectangle with zero corner radii.

Warning: This will force the keypoints into a simple rectangle without
any rounded corners. Use `is_rounded` to determine if corner
information is otherwise available.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/geometry_builder.rs#L478)

<a id="function-to_rounded_rect"></a>

### to_rounded_rect

```rust
fn to_rounded_rect(self: &Self) -> RoundedRect
```

Converts the keypoints into a rounded rectangle with elliptical corner radii.

Elliptical corner radius (represented by `Vector`) is more powerful
than circular corner radius (represented by a `CornerRadius`).
Elliptical is a superset of circular.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/geometry_builder.rs#L490)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Copy`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Default`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
