Function

PolygonShape

Creates a PolygonShape from geometry returned by builder.

PolygonShape

Source set: Common
public fun PolygonShape(builder: PolygonShapeScope.() -> PolygonShapeGeometry): PolygonShape

Creates a PolygonShape from geometry returned by builder.

    PolygonShapeScope.size, PolygonShapeScope.layoutDirection, and Density.

  • Runs builder in PolygonShapeScope on each resolution with the resolved
  • returned PolygonShapeGeometry changes.

  • Re-reads captured state inside builder on each resolution and rebuilds the outline when the
  • (size.width, size.height) at the bottom-right). Call PolygonShapeTransformScope.scaleToFit inside PolygonShape.transform to scale custom coordinates (such as a `0f, 1f` unit square) to fit the layout bounds.

  • Interprets PolygonShapeGeometry coordinates in layout pixels ((0f, 0f) at the top-left to

Parameters

builder lambda run in PolygonShapeScope returning the shape's PolygonShapeGeometry

Content updated: