reverse

Function

Common
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

Returns

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.