RoundRect

Function

Common
fun RoundRect(
    left: Float,
    top: Float,
    right: Float,
    bottom: Float,
    radiusX: Float,
    radiusY: Float,
): RoundRect

Construct a rounded rectangle from its left, top, right, and bottom edges, and the same radii along its horizontal axis and its vertical axis.

Common
fun RoundRect(left: Float, top: Float, right: Float, bottom: Float, cornerRadius: CornerRadius) =
    RoundRect(left, top, right, bottom, cornerRadius.x, cornerRadius.y)

Construct a rounded rectangle from its left, top, right, and bottom edges, and the same radius in each corner.

Common
fun RoundRect(rect: Rect, radiusX: Float, radiusY: Float): RoundRect

Construct a rounded rectangle from its bounding box and the same radii along its horizontal axis and its vertical axis.

Common
fun RoundRect(rect: Rect, cornerRadius: CornerRadius): RoundRect

Construct a rounded rectangle from its bounding box and a radius that is the same in each corner.

Common
fun RoundRect(
    rect: Rect,
    topLeft: CornerRadius = CornerRadius.Zero,
    topRight: CornerRadius = CornerRadius.Zero,
    bottomRight: CornerRadius = CornerRadius.Zero,
    bottomLeft: CornerRadius = CornerRadius.Zero,
): RoundRect

Construct a rounded rectangle from its bounding box and topLeft, topRight, bottomRight, and bottomLeft radii.

The corner radii default to CornerRadius.Zero, i.e. right-angled corners