Clear canvas using composite operation
suggest changeClear the canvas using compositing operation. This will clear the canvas independent of transforms but is not as fast as clearRect()
.
ctx.globalCompositeOperation = 'copy';
anything drawn next will clear previous content.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents