Path2D
Declares a path that can then be used on a CanvasRenderingContext2D
object.
The path methods of the CanvasRenderingContext2D
interface are also present on this interface, which gives you
the convenience of being able to retain and replay your path whenever desired.
See
https://developer.mozilla.org/docs/Web/API/Path2D
Implements
Constructors
new Path2D()
new Path2D(path
?): Path2D
Parameters
Parameter | Type |
---|---|
path ? | string | Path2D |
Returns
Methods
addPath()
addPath(path
): void
Adds to the path the path given by the argument.
Parameters
Parameter | Type |
---|---|
path | Path2D |
Returns
void
Implementation of
globalThis.Path2D.addPath
arc()
arc(x
, y
, r
, start
, end
, ccw
): void
Parameters
Parameter | Type |
---|---|
x | number |
y | number |
r | number |
start | number |
end | number |
ccw | boolean |
Returns
void
Implementation of
globalThis.Path2D.arc
arcTo()
arcTo(x1
, y1
, x2
, y2
, r
): void
Parameters
Parameter | Type |
---|---|
x1 | number |
y1 | number |
x2 | number |
y2 | number |
r | number |
Returns
void
Implementation of
globalThis.Path2D.arcTo
bezierCurveTo()
bezierCurveTo(cp1x
, cp1y
, cp2x
, cp2y
, x
, y
): void
Parameters
Parameter | Type |
---|---|
cp1x | number |
cp1y | number |
cp2x | number |
cp2y | number |
x | number |
y | number |
Returns
void
Implementation of
globalThis.Path2D.bezierCurveTo
closePath()
closePath(): void
Returns
void
Implementation of
globalThis.Path2D.closePath
ellipse()
ellipse(x
, y
, rx
, ry
, angle
, start
, end
, ccw
): void
Parameters
Parameter | Type |
---|---|
x | number |
y | number |
rx | number |
ry | number |
angle | number |
start | number |
end | number |
ccw | boolean |
Returns
void
Implementation of
globalThis.Path2D.ellipse
lineTo()
lineTo(x
, y
): void
Parameters
Parameter | Type |
---|---|
x | number |
y | number |
Returns
void
Implementation of
globalThis.Path2D.lineTo
moveTo()
moveTo(x
, y
): void
Parameters
Parameter | Type |
---|---|
x | number |
y | number |
Returns
void
Implementation of
globalThis.Path2D.moveTo
quadraticCurveTo()
quadraticCurveTo(cpx
, cpy
, x
, y
): void
Parameters
Parameter | Type |
---|---|
cpx | number |
cpy | number |
x | number |
y | number |
Returns
void
Implementation of
globalThis.Path2D.quadraticCurveTo
rect()
rect(x
, y
, width
, height
): void
Parameters
Parameter | Type |
---|---|
x | number |
y | number |
width | number |
height | number |
Returns
void
Implementation of
globalThis.Path2D.rect
roundRect()
roundRect(x
, y
, width
, height
, radii
?): void
Parameters
Parameter | Type |
---|---|
x | number |
y | number |
width | number |
height | number |
radii ? | number | number [] |
Returns
void
Implementation of
globalThis.Path2D.roundRect