PathScope

class PathScope

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun add(src: Path, transform: Transform = Transform.IDENTITY)

Adds a copy of src path to the current path, transformed by transformModel.

Link copied to clipboard
fun arc(center: Point, radius: Float, startDegrees: Float, endDegrees: Float, clockwise: Boolean = true)

Adds the specified arc to the path as a new contour.

Link copied to clipboard
fun circle(center: Point, radius: Float)

Adds a closed circle contour to the contour.

Link copied to clipboard
fun close()

Closes the current contour. If the current point is not equal to the first point of the contour, a line segment is automatically added.

Link copied to clipboard
fun createModel(fillRule: FillRule, block: PathScope.() -> Unit): CanvasPathModel

Creates the PathModel described by the operations invoked in PathScope.

Link copied to clipboard
fun cubicTo(controlPoint1: Point, controlPoint2: Point, endPoint: Point)

Adds a cubic bezier from the last point, approaching control points (controlPoint1.x,controlPoint1.y) and (controlPoint2.x,controlPoint2.y), and ending at (endPoint.x,endPoint.y). If no moveTo children has been added to this Path, then the first point is automatically set to (0,0).

Link copied to clipboard
fun ellipse(topLeft: Point, size: Size)

Adds closed oval contour to the contour.

Link copied to clipboard
fun lineTo(point: Point)

Adds a line from the last point to the specified point (x,y). If no moveTo children has been added to this Path, then the first point is automatically set to (0,0).

Link copied to clipboard
fun moveTo(point: Point)

Sets the beginning of the next contour to the point (x,y).

Link copied to clipboard
fun quadTo(controlPoint: Point, endPoint: Point)

Adds a quadratic bezier from the last point, approaching control point (controlPoint.x,controlPoint.y), and ending at (endPoint.x,endPoint.y). If no moveTo children has been added to this Path, then the first point is automatically set to (0,0).

Link copied to clipboard
fun rect(topLeft: Point, size: Size, cornerRadius: Float = 0.0f)

Adds a closed (optionally) round-rectangle contour.