ContourBuilder

class ContourBuilder(multipleContours: Boolean)

Functions

arcTo
Link copied to clipboard
common
fun arcTo(crx: Double, cry: Double, angle: Double, largeArcFlag: Boolean, sweepFlag: Boolean, end: Vector2)
fun arcTo(crx: Double, cry: Double, angle: Double, largeArcFlag: Boolean, sweepFlag: Boolean, tx: Double, ty: Double)
circularArcTo
Link copied to clipboard
common
fun circularArcTo(through: Vector2, end: Vector2)
close
Link copied to clipboard
common
fun close()

Closes the contour, adds a line segment to anchor when needed

continueTo
Link copied to clipboard
common
fun continueTo(end: Vector2, tangentScale: Double = 1.0)
fun continueTo(x: Double, y: Double, tangentScale: Double = 1.0)
fun continueTo(control: Vector2, end: Vector2, tangentScale: Double = 1.0)
fun continueTo(cx: Double, cy: Double, x: Double, y: Double, tangentScale: Double = 1.0)
copy
Link copied to clipboard
common
fun copy(source: ShapeContour)
curveTo
Link copied to clipboard
common
fun curveTo(control: Vector2, position: Vector2)
fun curveTo(cx: Double, cy: Double, x: Double, y: Double)

Quadratic curve to

fun curveTo(control0: Vector2, control1: Vector2, position: Vector2)
fun curveTo(c0x: Double, c0y: Double, c1x: Double, c1y: Double, x: Double, y: Double)

Cubic curve to

lineTo
Link copied to clipboard
common
fun lineTo(position: Vector2)
fun lineTo(x: Double, y: Double)

Line to

moveOrCurveTo
Link copied to clipboard
common
fun moveOrCurveTo(control: Vector2, position: Vector2)
fun moveOrCurveTo(control0: Vector2, control1: Vector2, position: Vector2)
fun moveOrCurveTo(cx: Double, cy: Double, x: Double, y: Double)
fun moveOrCurveTo(c0x: Double, c0y: Double, c1x: Double, c1y: Double, x: Double, y: Double)
moveOrLineTo
Link copied to clipboard
common
fun moveOrLineTo(position: Vector2)
fun moveOrLineTo(x: Double, y: Double)

Move the pen or draw a line to the given coordinates. The pen is moved without drawing when to prior moveTo instructions have been given.

moveTo
Link copied to clipboard
common
fun moveTo(position: Vector2)

Move pen without drawing

fun moveTo(x: Double, y: Double)

Move the pen to the given coordinates without drawing

reverse
Link copied to clipboard
common
fun reverse()

Reverse all segments

segment
Link copied to clipboard
common
fun segment(segment: Segment)
undo
Link copied to clipboard
common
fun undo(): Segment?

Properties

anchor
Link copied to clipboard
common
var anchor: Vector2
cursor
Link copied to clipboard
common
var cursor: Vector2
lastSegment
Link copied to clipboard
common
val lastSegment: Segment?
result
Link copied to clipboard
common
val result: List<ShapeContour>
segments
Link copied to clipboard
common
val segments: MutableList<Segment>