Name
CanvasRenderingContext2D.bezierCurveTo( ): add a cubic Bézier curve to the current subpath
Synopsis
void bezierCurveTo(floatcpX1
, floatcpY1
, floatcpX2
, floatcpY2
, floatx
, floaty
)
Arguments
-
cpX1, cpX2
The coordinates of the control point associated with the curveâs start point (the current position).
-
cpX2, cpY2
The coordinates of the control point associated with the curveâs end point.
-
x, y
The coordinates of the curveâs end point.
Description
bezierCurveTo( )
adds a
cubic Bézier curve to the current subpath of a canvas. The start
point of the curve is the current point of the canvas, and the end
point is (x,y)
. The two Bezier
control points (cpX1, cpY1)
and
(cpX2, cpY2)
define the shape of
the curve. When this method returns, the current position is
(x,y)
.
See Also
CanvasRenderingContext2D.quadraticCurveTo(
)
Get JavaScript: The Definitive Guide, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.