Using Paths to Create Lines
Paths are a method we can use to draw any shape on the canvas. A
path is simply a list of points, and lines to be drawn
between those points. A Canvas context can have only a single “current”
path, which is not stored as part of the current drawing state
when the context.save()
method is
called.
Context for paths is a critical concept to understand, because it will enable you to transform only the current path on the canvas.
Get HTML5 Canvas, 2nd 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.