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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Nope, once you’ve drawn something on a canvas there is no object to clear, just the pixels you’ve drawn. The
clearRectmethod doesn’t clear a previously drawn object, it just clears the pixels in the space defined by the parameters. You can use theclearRectmethod 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