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
Inherited from
Properties
_subpaths
_subpaths:
Point
[][]
Inherited from
Source
currentPath
protected
currentPath:Point
[]
Inherited from
Source
linePresentations
linePresentations:
LinePresentation
[] =[]
Colors and widths of lines in the path.
Source
lineWidth
lineWidth:
number
=Constants.DEFAULT_PATH_LINE_WIDTH
Line width to be applied to subsequent lines.
Source
strokeColor
strokeColor:
RgbaColor
=Constants.DEFAULT_PATH_STROKE_COLOR
Stroke color to be applied to subsequent lines.
Source
Accessors
subpaths
get
subpaths():Point
[][]
The subpath that compose up the path
Returns
Point
[][]
Source
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
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
clear()
clear():
void
Removes all subpaths from the shape and resets the stroke color and line width to their default values.
Returns
void
Overrides
Source
duplicate()
duplicate():
ColorfulMutablePath
Makes a deep copy.
Returns
a deep copy
Overrides
Source
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
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