RelativePathBuilder

abstract class RelativePathBuilder<P> : PathBuilder<P>

Handles relative path building when the underlying output type can't.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
data class State(val closeToX: Float = 0.0f, val closeToY: Float = 0.0f, val lastX: Float = 0.0f, val lastY: Float = 0.0f)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun arcTo(left: Float, top: Float, right: Float, bottom: Float, startAngle: Float, sweepAngle: Float, forceMoveTo: Boolean)

Append the specified arc to the path as a new contour. startAngle and sweepAngle are both given in degrees.

Link copied to clipboard
abstract fun build(): P

Returns the path built by previous function calls. If P is mutable, then future builder calls should not modify it and multiple calls to build must not return the same instance.

Link copied to clipboard
open override fun close()

Close the current contour.

Link copied to clipboard
open override fun cubicTo(beginControlX: Float, beginControlY: Float, endControlX: Float, endControlY: Float, endX: Float, endY: Float)

Add a cubic bezier from the last point, approaching control points beginControlX, beginControlY and endControlX, endControlY, and ending at point endX, endY.

Link copied to clipboard
open override fun lineTo(x: Float, y: Float)

Add a line from the last point to the specified point x, y.

Link copied to clipboard
open override fun moveTo(x: Float, y: Float)

Set the beginning of the next contour to the point x, y.

Link copied to clipboard
open override fun quadraticTo(controlX: Float, controlY: Float, endX: Float, endY: Float)

Add a quadratic bezier from the last point, approaching control point controlX, controlY, and ending at point endX, endY.

Link copied to clipboard
open override fun relativeCubicTo(beginControlX: Float, beginControlY: Float, endControlX: Float, endControlY: Float, endX: Float, endY: Float)

Same as cubicTo, except coordinates are relative to the current location.

Link copied to clipboard
open override fun relativeLineTo(x: Float, y: Float)

Same as lineTo, except coordinates are relative to the current location.

Link copied to clipboard
open override fun relativeMoveTo(x: Float, y: Float)

Same as moveTo, except coordinates are relative to the current location.

Link copied to clipboard
open override fun relativeQuadraticTo(controlX: Float, controlY: Float, endX: Float, endY: Float)

Same as quadraticTo, except coordinates are relative to the current location.

Link copied to clipboard
open override fun reset()

Start over!