# RectangleGeometry

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

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

```rust
struct RectangleGeometry
```

Represents the geometry of a rectangle.

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`radius_x_property`](#function-radius_x_property)
- [`radius_y_property`](#function-radius_y_property)
- [`rect_property`](#function-rect_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`with_rect`](#function-with_rect)
- [`with_rect_and_radii`](#function-with_rect_and_radii)
- [`radius_x`](#function-radius_x)
- [`set_radius_x`](#function-set_radius_x)
- [`radius_y`](#function-radius_y)
- [`set_radius_y`](#function-set_radius_y)
- [`rect`](#function-rect)
- [`set_rect`](#function-set_rect)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

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

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

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<RectangleGeometry>
```

Returns a strong reference to this object.

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

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

### radius_x_property

```rust
fn radius_x_property() -> &'static StyledProperty<f64>
```



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

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

### radius_y_property

```rust
fn radius_y_property() -> &'static StyledProperty<f64>
```



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

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

### rect_property

```rust
fn rect_property() -> &'static StyledProperty<Rect>
```



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

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

### construct

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

Creates the class data.

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

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

### new

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



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

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

### with_rect

```rust
fn with_rect(rect: Rect) -> Ref<Self>
```

Creates a rectangle geometry with the given bounds.

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

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

### with_rect_and_radii

```rust
fn with_rect_and_radii(rect: Rect, radius_x: f64, radius_y: f64) -> Ref<Self>
```

Creates a rectangle geometry with the given bounds and corner radii.

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

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

### radius_x

```rust
fn radius_x(self: &Self) -> f64
```

The x-axis radius of the ellipse that is used to round the corners of the rectangle. Corner radii are represented by an ellipse so this is the horizontal axis width of the ellipse.

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

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

### set_radius_x

```rust
fn set_radius_x(self: &Self, value: f64)
```



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

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

### radius_y

```rust
fn radius_y(self: &Self) -> f64
```

The y-axis radius of the ellipse that is used to round the corners of the rectangle. Corner radii are represented by an ellipse so this is the vertical axis height of the ellipse.

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

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

### set_radius_y

```rust
fn set_radius_y(self: &Self, value: f64)
```



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

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

### rect

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

The bounds of the rectangle.

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

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

### set_rect

```rust
fn set_rect(self: &Self, value: Rect)
```



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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`GeometryImplExt`](/docs/0.5.0/api/ferroui-base/media/trait-geometryimplext/)
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<RectangleGeometry>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`GeometryImpl`](/docs/0.5.0/api/ferroui-base/media/trait-geometryimpl/)

## Availability

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