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

Defined in​

m2c2kit/packages/core/src/MutablePath.ts:10


currentPath​

protected currentPath: Point[]

Inherited from​

MutablePath.currentPath

Defined in​

m2c2kit/packages/core/src/MutablePath.ts:20


linePresentations​

linePresentations: LinePresentation[] = []

Colors and widths of lines in the path.

Defined in​

m2c2kit/packages/core/src/ColorfulMutablePath.ts:18


lineWidth​

lineWidth: number = Constants.DEFAULT_PATH_LINE_WIDTH

Line width to be applied to subsequent lines.

Defined in​

m2c2kit/packages/core/src/ColorfulMutablePath.ts:16


strokeColor​

strokeColor: RgbaColor = Constants.DEFAULT_PATH_STROKE_COLOR

Stroke color to be applied to subsequent lines.

Defined in​

m2c2kit/packages/core/src/ColorfulMutablePath.ts:14

Accessors​

subpaths​

Get Signature​

get subpaths(): Point[][]

The subpath that compose up the path

Returns​

Point[][]

The subpath that compose up the path

Inherited from​

MutablePath.subpaths

Defined in​

m2c2kit/packages/core/src/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

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.

Overrides​

MutablePath.addLine

Defined in​

m2c2kit/packages/core/src/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

Defined in​

m2c2kit/packages/core/src/ColorfulMutablePath.ts:63


duplicate()​

duplicate(): ColorfulMutablePath

Makes a deep copy.

Returns​

ColorfulMutablePath

a deep copy

Overrides​

MutablePath.duplicate

Defined in​

m2c2kit/packages/core/src/ColorfulMutablePath.ts:76


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

Defined in​

m2c2kit/packages/core/src/MutablePath.ts:27