🌈 Create new beautiful Compose Gradients with our new wesite ->
Function

reverse

Reverses the segments of this path into the specified destination, turning a clockwise path into a counter-clockwise path and vice-versa.

reverse

Source set: Common
public fun Path.reverse(destination: Path = Path()): Path

Reverses the segments of this path into the specified destination, turning a clockwise path into a counter-clockwise path and vice-versa. Each contour in the path is reversed independently, and the contours appear in the destination in reverse order.

This method preserves the general structure of this path as much as possible:

  • Lines become lines
  • Quadratic BĂ©zier curves become quadratic BĂ©zier curves
  • Cubic BĂ©zier curves become cubic BĂ©zier curves
  • Close and move commands remain close and move commands
  • Conic segments become quadratic BĂ©zier curves

Return

A Path containing the reverse of this Path. The returned path is either a newly allocated Path if the destination parameter was left unspecified, or the destination parameter.