Class: SvgPathStream
Defined in: src/sdk/graphics/svg/SvgPathStream.ts:9
A path stream which builds SVG path strings from its input path commands.
Implements
Constructors
Constructor
new SvgPathStream(
precision):SvgPathStream
Defined in: src/sdk/graphics/svg/SvgPathStream.ts:24
Constructor.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
precision | number | 0 | The precision of this stream. All coordinates will be rounded to this stream's precision when building the SVG path string. A value of 0 indicates infinite precision. Defaults to 0. |
Returns
SvgPathStream
Methods
arc()
arc(
x,y,radius,startAngle,endAngle,counterClockwise?):void
Defined in: src/sdk/graphics/svg/SvgPathStream.ts:123
Paths an arc.
Parameters
| Parameter | Type | Description |
|---|---|---|
x | number | The x-coordinate of the center of the circle containing the arc. |
y | number | The y-coordinate of the center of the circle containing the arc. |
radius | number | The radius of the arc. |
startAngle | number | The angle of the start of the arc, in radians. |
endAngle | number | The angle of the end of the arc, in radians. |
counterClockwise? | boolean | Whether the arc should be drawn counterclockwise. False by default. |
Returns
void
Implementation of
beginPath()
beginPath():
void
Defined in: src/sdk/graphics/svg/SvgPathStream.ts:59
Begins a path. Erases all previous path state.
Returns
void
Implementation of
bezierCurveTo()
bezierCurveTo(
cp1x,cp1y,cp2x,cp2y,x,y):void
Defined in: src/sdk/graphics/svg/SvgPathStream.ts:93
Paths a cubic Bezier curve from the current point to a specified point.
Parameters
| Parameter | Type | Description |
|---|---|---|
cp1x | number | The x-coordinate of the first control point. |
cp1y | number | The y-coordinate of the first control point. |
cp2x | number | The x-coordinate of the second control point. |
cp2y | number | The y-coordinate of the second control point. |
x | number | The x-coordinate of the end point. |
y | number | The y-coordinate of the end point. |
Returns
void
Implementation of
closePath()
closePath():
void
Defined in: src/sdk/graphics/svg/SvgPathStream.ts:172
Paths a line from the current point to the first point defined by the current path.
Returns
void
Implementation of
getPrecision()
getPrecision():
number
Defined in: src/sdk/graphics/svg/SvgPathStream.ts:44
Gets the precision of this stream. All coordinates will be rounded to this stream's precision when building the
SVG path string. A value of 0 indicates infinite precision.
Returns
number
The precision of this stream.
getSvgPath()
getSvgPath():
string
Defined in: src/sdk/graphics/svg/SvgPathStream.ts:35
Gets the SVG path string describing all path commands consumed by this stream since the last call to
beginPath().
Returns
string
The SVG path string describing all path commands consumed by this stream since the last call to
beginPath().
lineTo()
lineTo(
x,y):void
Defined in: src/sdk/graphics/svg/SvgPathStream.ts:78
Paths a straight line from the current point to a specified point.
Parameters
| Parameter | Type | Description |
|---|---|---|
x | number | The x-coordinate of the end point. |
y | number | The y-coordinate of the end point. |
Returns
void
Implementation of
moveTo()
moveTo(
x,y):void
Defined in: src/sdk/graphics/svg/SvgPathStream.ts:64
Moves to a specified point.
Parameters
| Parameter | Type | Description |
|---|---|---|
x | number | The x-coordinate of the point to which to move. |
y | number | The y-coordinate of the point to which to move. |
Returns
void
Implementation of
quadraticCurveTo()
quadraticCurveTo(
cpx,cpy,x,y):void
Defined in: src/sdk/graphics/svg/SvgPathStream.ts:108
Paths a quadrative Bezier curve from the current point to a specified point.
Parameters
| Parameter | Type | Description |
|---|---|---|
cpx | number | The x-coordinate of the control point. |
cpy | number | The y-coordinate of the control point. |
x | number | The x-coordinate of the end point. |
y | number | The y-coordinate of the end point. |
Returns
void
Implementation of
setPrecision()
setPrecision(
precision):void
Defined in: src/sdk/graphics/svg/SvgPathStream.ts:53
Sets the precision of this stream. All coordinates will be rounded to this stream's precision when building the
SVG path string. A value of 0 indicates infinite precision.
Parameters
| Parameter | Type | Description |
|---|---|---|
precision | number | The precision of this stream. Negative numbers will be converted to their absolute values. |
Returns
void