HTML and CSS Reference
In-Depth Information
How Do We Save and Restore the Canvas State?
To save (push) the current state to the stack, call:
context
.
save
()
To restore the canvas by “popping” the last state saved to the stack, use:
context
.
restore
()