clearRect method
The
CanvasRenderingContext2D.clearRect()
method of the Canvas 2D API erases the pixels in a rectangular area by
setting them to
transparent black.
Note: Be aware that
clearRect()may cause unintended side effects if you're not using paths properly. Make sure to call CanvasRenderingContext2D.beginPath before starting to draw new items after callingclearRect().
Implementation
external void clearRect(
num x,
num y,
num w,
num h,
);