0

ClearRect error

How do I make the previously drawn object in the canvas to get deleted? Even if I use clearRect, it still shows when I draw again https://code.sololearn.com/Wu6oB61QkUYF/?ref=app

7th May 2020, 6:46 PM
SolomonDavid Akesoba
SolomonDavid Akesoba - avatar
2 Respuestas
+ 2
add ctx.beginPath(); After clearRect(0,0,can.width,can.height);
7th May 2020, 7:25 PM
ChaoticDawg
ChaoticDawg - avatar
+ 1
Thank you so much. It actually worked.
7th May 2020, 10:29 PM
SolomonDavid Akesoba
SolomonDavid Akesoba - avatar