# RoundRect

Artifact: [androidx.compose.ui:ui-geometry](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/geometry/RoundRect.kt+class:androidx.compose.ui.geometry.RoundRect) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Common/All
- Cmn

  ```
  data class RoundRect
  ```

*** ** * ** ***

An immutable rounded rectangle with custom radii for all four corners.

## Summary

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#Zero()` A rounded rectangle with all the values set to zero. | Cmn |

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#RoundRect(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,androidx.compose.ui.geometry.CornerRadius,androidx.compose.ui.geometry.CornerRadius,androidx.compose.ui.geometry.CornerRadius,androidx.compose.ui.geometry.CornerRadius)( left: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, top: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, right: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, bottom: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, topLeftCornerRadius: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius, topRightCornerRadius: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius, bottomRightCornerRadius: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius, bottomLeftCornerRadius: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius )` | Cmn |

| ### Public functions |
|---|---|---|
| `operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#contains(androidx.compose.ui.geometry.Offset)(point: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset)` Whether the point specified by the given offset (which is assumed to be relative to the origin) lies inside the rounded rectangle. | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#toString()()` | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#bottom()` The offset of the bottom edge of this rectangle from the y axis | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#bottomLeftCornerRadius()` The bottom-left radius | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#bottomRightCornerRadius()` The bottom-right radius | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#height()` The distance between the top and bottom edges of this rectangle. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#left()` The offset of the left edge of this rectangle from the x axis | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#right()` The offset of the right edge of this rectangle from the x axis | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#top()` The offset of the top edge of this rectangle from the y axis | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#topLeftCornerRadius()` The top-left radius | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/CornerRadius` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#topRightCornerRadius()` The top-right radius | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#width()` The distance between the left and right edges of this rectangle. | Cmn |

| ### Extension functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect.https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#(androidx.compose.ui.geometry.RoundRect).translate(androidx.compose.ui.geometry.Offset)(offset: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset)` Returns a new `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect` translated by the given offset. | Cmn |

| ### Extension properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect.https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#(androidx.compose.ui.geometry.RoundRect).boundingRect()` The bounding box of this rounded rectangle (the rectangle with no rounded corners). | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect.https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#(androidx.compose.ui.geometry.RoundRect).center()` The offset to the point halfway between the left and right and the top and bottom edges of this rectangle. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect.https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#(androidx.compose.ui.geometry.RoundRect).isCircle()` Whether this rounded rectangle would draw as a circle. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect.https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#(androidx.compose.ui.geometry.RoundRect).isEllipse()` Whether this rounded rectangle has no side with a straight section. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect.https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#(androidx.compose.ui.geometry.RoundRect).isEmpty()` Whether this rounded rectangle encloses a non-zero area. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect.https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#(androidx.compose.ui.geometry.RoundRect).isFinite()` Whether all coordinates of this rounded rectangle are finite. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect.https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#(androidx.compose.ui.geometry.RoundRect).isRect()` Whether this rounded rectangle is a simple rectangle with zero corner radii. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect.https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#(androidx.compose.ui.geometry.RoundRect).isSimple()` Returns `true` if the rounded rectangle have the same radii in both the horizontal and vertical direction for all corners. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect.https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#(androidx.compose.ui.geometry.RoundRect).maxDimension()` | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect.https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#(androidx.compose.ui.geometry.RoundRect).minDimension()` The lesser of the magnitudes of the `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#width()` and the `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#height()` of this rounded rectangle. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect.https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#(androidx.compose.ui.geometry.RoundRect).safeInnerRect()` The non-rounded rectangle that is constrained by the smaller of the two diagonals, with each diagonal traveling through the middle of the curve corners. | Cmn |

## Public companion properties

### Zero

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val Zero: RoundRect
```

A rounded rectangle with all the values set to zero.

## Public constructors

### RoundRect

Cmn Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.9.0)

```
RoundRect(
    left: Float,
    top: Float,
    right: Float,
    bottom: Float,
    topLeftCornerRadius: CornerRadius = CornerRadius.Zero,
    topRightCornerRadius: CornerRadius = CornerRadius.Zero,
    bottomRightCornerRadius: CornerRadius = CornerRadius.Zero,
    bottomLeftCornerRadius: CornerRadius = CornerRadius.Zero
)
```

## Public functions

### contains

Cmn Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.10.0)

```
operator fun contains(point: Offset): Boolean
```

Whether the point specified by the given offset (which is assumed to be relative to the origin) lies inside the rounded rectangle.

This method may allocate (and cache) a copy of the object with normalized radii the first time it is called on a particular `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect` instance. When using this method, prefer to reuse existing `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect`s rather than recreating the object each time.

### toString

Cmn

```
open fun toString(): String
```

## Public properties

### bottom

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val bottom: Float
```

The offset of the bottom edge of this rectangle from the y axis

### bottomLeftCornerRadius

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val bottomLeftCornerRadius: CornerRadius
```

The bottom-left radius

### bottomRightCornerRadius

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val bottomRightCornerRadius: CornerRadius
```

The bottom-right radius

### height

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val height: Float
```

The distance between the top and bottom edges of this rectangle.

### left

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val left: Float
```

The offset of the left edge of this rectangle from the x axis

### right

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val right: Float
```

The offset of the right edge of this rectangle from the x axis

### top

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val top: Float
```

The offset of the top edge of this rectangle from the y axis

### topLeftCornerRadius

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val topLeftCornerRadius: CornerRadius
```

The top-left radius

### topRightCornerRadius

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val topRightCornerRadius: CornerRadius
```

The top-right radius

### width

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val width: Float
```

The distance between the left and right edges of this rectangle.

## Extension functions

### RoundRect.translate

Cmn Artifact: [androidx.compose.ui:ui-geometry](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/geometry/RoundRect.kt+function:translate)

```
fun RoundRect.translate(offset: Offset): RoundRect
```

Returns a new `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect` translated by the given offset.

## Extension properties

### RoundRect.boundingRect

Cmn Artifact: [androidx.compose.ui:ui-geometry](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/geometry/RoundRect.kt+symbol:boundingRect) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val RoundRect.boundingRect: Rect
```

The bounding box of this rounded rectangle (the rectangle with no rounded corners).

### RoundRect.center

Cmn Artifact: [androidx.compose.ui:ui-geometry](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/geometry/RoundRect.kt+symbol:center) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val RoundRect.center: Offset
```

The offset to the point halfway between the left and right and the top and bottom edges of this rectangle.

### RoundRect.isCircle

Cmn Artifact: [androidx.compose.ui:ui-geometry](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/geometry/RoundRect.kt+symbol:isCircle) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val RoundRect.isCircle: Boolean
```

Whether this rounded rectangle would draw as a circle.

### RoundRect.isEllipse

Cmn Artifact: [androidx.compose.ui:ui-geometry](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/geometry/RoundRect.kt+symbol:isEllipse) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val RoundRect.isEllipse: Boolean
```

Whether this rounded rectangle has no side with a straight section.

### RoundRect.isEmpty

Cmn Artifact: [androidx.compose.ui:ui-geometry](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/geometry/RoundRect.kt+symbol:isEmpty) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val RoundRect.isEmpty: Boolean
```

Whether this rounded rectangle encloses a non-zero area. Negative areas are considered empty.

### RoundRect.isFinite

Cmn Artifact: [androidx.compose.ui:ui-geometry](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/geometry/RoundRect.kt+symbol:isFinite) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val RoundRect.isFinite: Boolean
```

Whether all coordinates of this rounded rectangle are finite.

### RoundRect.isRect

Cmn Artifact: [androidx.compose.ui:ui-geometry](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/geometry/RoundRect.kt+symbol:isRect) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val RoundRect.isRect: Boolean
```

Whether this rounded rectangle is a simple rectangle with zero corner radii.

### RoundRect.isSimple

Cmn Artifact: [androidx.compose.ui:ui-geometry](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/geometry/RoundRect.kt+symbol:isSimple) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val RoundRect.isSimple: Boolean
```

Returns `true` if the rounded rectangle have the same radii in both the horizontal and vertical direction for all corners.

### RoundRect.maxDimension

Cmn Artifact: [androidx.compose.ui:ui-geometry](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/geometry/RoundRect.kt+symbol:maxDimension) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val RoundRect.maxDimension: Float
```

### RoundRect.minDimension

Cmn Artifact: [androidx.compose.ui:ui-geometry](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/geometry/RoundRect.kt+symbol:minDimension) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val RoundRect.minDimension: Float
```

The lesser of the magnitudes of the `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#width()` and the `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/RoundRect#height()` of this rounded rectangle.

### RoundRect.safeInnerRect

Cmn Artifact: [androidx.compose.ui:ui-geometry](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/geometry/RoundRect.kt+symbol:safeInnerRect) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val RoundRect.safeInnerRect: Rect
```

The non-rounded rectangle that is constrained by the smaller of the two diagonals, with each diagonal traveling through the middle of the curve corners. The middle of a corner is the intersection of the curve with its respective quadrant bisector.