# RoundedRect

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

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

```rust
struct RoundedRect
```

Represents a rectangle with per-corner radii.

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

## Members

- [`rect`](#struct_field-rect)
- [`radii_top_left`](#struct_field-radii_top_left)
- [`radii_top_right`](#struct_field-radii_top_right)
- [`radii_bottom_left`](#struct_field-radii_bottom_left)
- [`radii_bottom_right`](#struct_field-radii_bottom_right)
- [`new`](#function-new)
- [`from_radii`](#function-from_radii)
- [`from_uniform_radii`](#function-from_uniform_radii)
- [`from_radius_xy`](#function-from_radius_xy)
- [`from_radius`](#function-from_radius)
- [`from_rect`](#function-from_rect)
- [`from_corner_radius`](#function-from_corner_radius)
- [`equals`](#function-equals)
- [`is_rounded`](#function-is_rounded)
- [`is_uniform`](#function-is_uniform)
- [`inflate`](#function-inflate)
- [`deflate`](#function-deflate)
- [`is_empty`](#function-is_empty)
- [`contains_exclusive`](#function-contains_exclusive)

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

### rect

```rust
rect: crate::Rect
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rounded_rect.rs#L9)

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

### radii_top_left

```rust
radii_top_left: crate::Vector
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rounded_rect.rs#L10)

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

### radii_top_right

```rust
radii_top_right: crate::Vector
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rounded_rect.rs#L11)

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

### radii_bottom_left

```rust
radii_bottom_left: crate::Vector
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rounded_rect.rs#L12)

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

### radii_bottom_right

```rust
radii_bottom_right: crate::Vector
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rounded_rect.rs#L13)

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

### new

```rust
const fn new(rect: Rect, radii_top_left: Vector, radii_top_right: Vector, radii_bottom_right: Vector, radii_bottom_left: Vector) -> Self
```

Initializes a `RoundedRect` from elliptical corner radii, clockwise from the top left.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rounded_rect.rs#L19)

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

### from_radii

```rust
const fn from_radii(rect: Rect, radius_top_left: f64, radius_top_right: f64, radius_bottom_right: f64, radius_bottom_left: f64) -> Self
```

Initializes a `RoundedRect` from circular corner radii, clockwise from the top left.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rounded_rect.rs#L37)

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

### from_uniform_radii

```rust
const fn from_uniform_radii(rect: Rect, radii: Vector) -> Self
```

Initializes a `RoundedRect` with the same elliptical radii on every corner.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rounded_rect.rs#L55)

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

### from_radius_xy

```rust
const fn from_radius_xy(rect: Rect, radius_x: f64, radius_y: f64) -> Self
```

Initializes a `RoundedRect` with the same X and Y radius on every corner.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rounded_rect.rs#L61)

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

### from_radius

```rust
const fn from_radius(rect: Rect, radius: f64) -> Self
```

Initializes a `RoundedRect` with the same circular radius on every corner.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rounded_rect.rs#L67)

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

### from_rect

```rust
const fn from_rect(rect: Rect) -> Self
```

Initializes a `RoundedRect` without rounded corners.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rounded_rect.rs#L73)

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

### from_corner_radius

```rust
const fn from_corner_radius(bounds: Rect, radius: CornerRadius) -> Self
```

Initializes a `RoundedRect` from bounds and a `CornerRadius`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rounded_rect.rs#L79)

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

### equals

```rust
fn equals(self: &Self, other: RoundedRect) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rounded_rect.rs#L90)

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

### is_rounded

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

Gets a value indicating whether any corner has a non-zero radius.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rounded_rect.rs#L96)

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

### is_uniform

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

Gets a value indicating whether all corners have the same radii.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rounded_rect.rs#L105)

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

### inflate

```rust
fn inflate(self: &Self, dx: f64, dy: f64) -> RoundedRect
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rounded_rect.rs#L112)

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

### deflate

```rust
fn deflate(self: &Self, dx: f64, dy: f64) -> RoundedRect
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rounded_rect.rs#L116)

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

### is_empty

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

This method should be used internally to check for the rect emptiness.
Once a dedicated "empty" value exists this is the single place to update.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rounded_rect.rs#L172)

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

### contains_exclusive

```rust
fn contains_exclusive(self: &Self, p: Point) -> bool
```

Determines whether a point is inside the rounded rectangle, exclusive of the
bottom/right edge. Elliptical corners are approximated by circles using the
smaller of the two radii.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rounded_rect.rs#L184)

## 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`
- `BatchValue`
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)
- [`ValueTypeRegistration`](/docs/0.5.0/api/ferroui-base/data/core/trait-valuetyperegistration/)
- `Clone`
- `Copy`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Default`
- `From<Rect>`

## Availability

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