Function

toPolygonShape

Converts a RoundedCornerShape to a PolygonShape.

toPolygonShape

Source set: Common
public fun RoundedCornerShape.toPolygonShape(): PolygonShape

Converts a RoundedCornerShape to a PolygonShape.

Note: Approximates RoundedCornerShape using cubic Bézier curves and is not pixel-identical.

toPolygonShape

Source set: Common
public fun AbsoluteRoundedCornerShape.toPolygonShape(): PolygonShape

Converts an AbsoluteRoundedCornerShape to a PolygonShape.

Corners do not swap with the layout direction.

Note: The resulting outline closely approximates the original shape, but is not pixel-identical because PolygonShape and AbsoluteRoundedCornerShape use different geometry and curve calculations. Avoid comparing them for 1:1 pixel equivalence.

toPolygonShape

Source set: Common
public fun CutCornerShape.toPolygonShape(): PolygonShape

Converts a CutCornerShape to a PolygonShape.

Note: The resulting outline closely approximates the original shape, but is not pixel-identical because PolygonShape and CutCornerShape use different geometry and curve calculations. Avoid comparing them for 1:1 pixel equivalence.

toPolygonShape

Source set: Common
public fun AbsoluteCutCornerShape.toPolygonShape(): PolygonShape

Converts an AbsoluteCutCornerShape to a PolygonShape.

Corners do not swap with the layout direction.

Note: The resulting outline closely approximates the original shape, but is not pixel-identical because PolygonShape and AbsoluteCutCornerShape use different geometry and curve calculations. Avoid comparing them for 1:1 pixel equivalence.

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: