HTML and CSS Reference
Starting and Ending a Path
The beginPath() functioncallstartsapath,andthe closePath() functioncallendsthepath.
When you connect two points inside a path, it is referred to as a subpath . A subpath is con-
sidered “closed” if the final point connects to the first point.
The current transformation matrix will affect everything drawn in this path. As we will see when we
explore the upcoming section on transformations, we will always want to set the transformation mat-
rix to the identity (or reset) if we do not want any transformation applied to a path.