Skip to main content

Class: ColorfulMutablePath

Multi-color subpaths and methods for creating them.

Remarks

Subpaths are an array of lines that are drawn together.

Extends

Constructors

new ColorfulMutablePath()

new ColorfulMutablePath(): ColorfulMutablePath

Returns

ColorfulMutablePath

Inherited from

MutablePath.constructor

Properties

_subpaths

_subpaths: Point[][]

Inherited from

MutablePath._subpaths

Source

MutablePath.ts:10


currentPath

protected currentPath: Point[]

Inherited from

MutablePath.currentPath

Source

MutablePath.ts:20


linePresentations

linePresentations: LinePresentation[] = []

Colors and widths of lines in the path.

Source

ColorfulMutablePath.ts:18


lineWidth

lineWidth: number = Constants.DEFAULT_PATH_LINE_WIDTH

Line width to be applied to subsequent lines.

Source

ColorfulMutablePath.ts:16


strokeColor

strokeColor: RgbaColor = Constants.DEFAULT_PATH_STROKE_COLOR

Stroke color to be applied to subsequent lines.

Source

ColorfulMutablePath.ts:14

Accessors

subpaths

get subpaths(): Point[][]

The subpath that compose up the path

Returns

Point[][]

Source

MutablePath.ts:12

Methods

addLine()

addLine(point): void

Adds a straight line to the current subpath

Parameters

point: Point

location where the line will end

Returns

void

Overrides

MutablePath.addLine

Remarks

The line is added from the last point in the current subpath to the given point, with the current stroke color and line width.

Source

ColorfulMutablePath.ts:28


clear()

clear(): void

Removes all subpaths from the shape and resets the stroke color and line width to their default values.

Returns

void

Overrides

MutablePath.clear

Source

ColorfulMutablePath.ts:63


duplicate()

duplicate(): ColorfulMutablePath

Makes a deep copy.

Returns

ColorfulMutablePath

a deep copy

Overrides

MutablePath.duplicate

Source

ColorfulMutablePath.ts:76


isNewLinePresentation()

private isNewLinePresentation(): boolean

Checks if the current line presentation (stroke color and line width) is different from the last line presentation.

Returns

boolean

true if the current line presentation is different from the last

Source

ColorfulMutablePath.ts:46


move()

move(point): void

Starts a new subpath at a given point.

Parameters

point: Point

location at which to start the new subpath

Returns

void

Inherited from

MutablePath.move

Source

MutablePath.ts:27