Canvas is not cleaned properly | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Canvas is not cleaned properly

when drawing a circle it does not clear help https://code.sololearn.com/W3T0uR0z91pu/?ref=app

5th Jul 2020, 8:07 AM
Aparty
Aparty - avatar
2 Answers
+ 2
function animate() { requestAnimationFrame(animate); c.clearRect(0, 0,innerWidth, innerHeight); for (var i = 0; i < circleArray.length; i++) circleArray[i].update(); } do something like this. clearRect clears the screen. And call this animate() inside onload.
5th Jul 2020, 1:17 PM
Rohit
0
problem still exists
6th Jul 2020, 7:23 AM
Aparty
Aparty - avatar