Function

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.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free
Source set: Common

Added in 1.11.0-rc01

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.

Source set: Common

Added in 1.11.0-rc01

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.

Source set: Common

Added in 1.11.0-rc01

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.

Source set: Common

Added in 1.11.0-rc01

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.

Source set: Common

Added in 1.11.0-rc01

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