roundRect

fun Canvas.roundRect(x: Int, y: Int, width: Int, height: Int, roundness: Float, segments: Int = 0, color: Color = Color.BLACK)

Draws a rounded rectangle outline on the canvas.

Parameters

x

The X coordinate of the rectangle top-left corner

y

The Y coordinate of the rectangle top-left corner

width

The width of the rectangle

height

The height of the rectangle

roundness

The roundness of the rectangle corners as a percentage (0.0 - 1.0)

segments

The number of segments to use for drawing the rounded corners

color

The color of the rectangle


fun Canvas.roundRect(x: Int, y: Int, width: Int, height: Int, roundness: Float, lineThick: Int, segments: Int = 0, color: Color = Color.BLACK)

Draws a rounded rectangle outline on the canvas.

Parameters

x

The X coordinate of the rectangle top-left corner

y

The Y coordinate of the rectangle top-left corner

width

The width of the rectangle

height

The height of the rectangle

roundness

The roundness of the rectangle corners as a percentage (0.0 - 1.0)

lineThick

The thickness of the rectangle lines

segments

The number of segments to use for drawing the rounded corners

color

The color of the rectangle