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
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: