Android 12 Developer Preview is here! Try it out, and give us your feedback!

Path

interface Path
androidx.compose.ui.graphics.Path

Summary

Public methods
abstract Unit
addArc(oval: Rect, startAngleDegrees: Float, sweepAngleDegrees: Float)

Adds a new subpath with one arc segment that consists of the arc that follows the edge of the oval bounded by the given rectangle, from startAngle degrees around the oval up to startAngle + sweepAngle degrees around the oval, with zero degrees being the point on the right hand side of the oval that crosses the horizontal line that intersects the center of the rectangle and with positive angles going clockwise around the oval.

abstract Unit
addArcRad(oval: Rect, startAngleRadians: Float, sweepAngleRadians: Float)

Adds a new subpath with one arc segment that consists of the arc that follows the edge of the oval bounded by the given rectangle, from startAngle radians around the oval up to startAngle + sweepAngle radians around the oval, with zero radians being the point on the right hand side of the oval that crosses the horizontal line that intersects the center of the rectangle and with positive angles going clockwise around the oval.

abstract Unit
addOval(oval: Rect)

Adds a new subpath that consists of a curve that forms the ellipse that fills the given rectangle.

abstract Unit
addPath(path: Path, offset: Offset = Offset.Zero)

Adds a new subpath that consists of the given path offset by the given offset.

abstract Unit
addRect(rect: Rect)

Adds a new subpath that consists of four lines that outline the given rectangle.

abstract Unit
addRoundRect(roundRect: RoundRect)

Add a round rectangle shape to the path from the given RoundRect

abstract Unit
arcTo(rect: Rect, startAngleDegrees: Float, sweepAngleDegrees: Float, forceMoveTo: Boolean)

If the forceMoveTo argument is false, adds a straight line segment and an arc segment.

open Unit
arcToRad(rect: Rect, startAngleRadians: Float, sweepAngleRadians: Float, forceMoveTo: Boolean)

If the forceMoveTo argument is false, adds a straight line segment and an arc segment.

abstract Unit

Closes the last subpath, as if a straight line had been drawn from the current point to the first point of the subpath.

abstract Unit
cubicTo(x1: Float, y1: Float, x2: Float, y2: Float, x3: Float, y3: Float)

Adds a cubic bezier segment that curves from the current point to the given point (x3, y3), using the control points (x1, y1) and (x2, y2).

abstract Rect

Compute the bounds of the control points of the path, and write the answer into bounds.

abstract Unit
lineTo(x: Float, y: Float)

Adds a straight line segment from the current point to the given point

abstract Unit
moveTo(x: Float, y: Float)

Starts a new subpath at the given coordinate

abstract Boolean
op(path1: Path, path2: Path, operation: PathOperation)

Set this path to the result of applying the Op to the two specified paths.

abstract Unit
quadraticBezierTo(x1: Float, y1: Float, x2: Float, y2: Float)

Adds a quadratic bezier segment that curves from the current point to the given point (x2, y2), using the control point (x1, y1).

abstract Unit