I found that there\'s a clearRect()
method, but can\'t find any to clear an arc (or a full circle).
Is there any way to clear an arc in canvas?
Nope, once you've drawn something on a canvas there is no object to clear, just the pixels you've drawn. The clearRect
method doesn't clear a previously drawn object, it just clears the pixels in the space defined by the parameters. You can use the clearRect
method to clear the arc if you know a rectangle which contains it. This will of course clear any other pixels in the area, so you'll have to redraw them.
Edit: MooGoo has given a much better answer below