Class

PolygonShapeGeometry

Defines a polygon's vertices, center, and corner rounding.

Source set: Common
public class PolygonShapeGeometry internal constructor(
    public val vertices: List<Offset>,
    public val center: Offset,
    public val rounding: CornerRounding,
    @get:Suppress("NullableCollection") public val perVertexRounding: List<CornerRounding>?,
    internal val roundingReference: Size? = null,
)

Defines a polygon's vertices, center, and corner rounding.

Coordinates are in layout pixels ((0f, 0f) to (size.width, size.height)). You can also define vertices in a custom coordinate space (such as a `0f, 1f unit square) and scale them to the layout bounds using PolygonShapeTransformScope.scaleToFit. Because custom vertices do not have a circle radius, CornerRounding.fraction sets the corner radius as a fraction of the polygon's smaller dimension (min(width, height)`).

Functions

equals

Source set: Common
override fun equals(other: Any?): Boolean

hashCode

Source set: Common
override fun hashCode(): Int

toString

Source set: Common
override fun toString(): String

Content updated: