Name
CanvasRenderingContext2D.translate( ): translate the user coordinate system of the canvas
Synopsis
void translate(floatdx
, floatdy
)
Arguments
-
dx, dy
The amounts to translate in the X and Y dimensions.
Description
translate( )
adds
horizontal and vertical offsets to the transformation matrix of the
canvas. The arguments dx
and
dy
are added to all points in any
subsequently defined paths.
See Also
CanvasRenderingContext2D.rotate(
)
, CanvasRenderingContext2D.scale( )
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.