I have while loop drawing circles one by one:
actx.shadowColor = 'rgba(0, 0, 0, 1)';
while (len--) {
var point = data[len];
actx.beginPath();
actx.arc(point[0] - 15000, point[1] - 15000, 10, 0, Math.PI * 2);
actx.closePath();
actx.fill();
}
It seems a little bit slow for me, so I am thinking how it could be optimized. I have found that the fill() function takes the longest, so I have tried put it after the loop, but it draws only the last circle.
- Is there any way how to fill all the circles at once?
- Or is there any other, faster method?
Aucun commentaire:
Enregistrer un commentaire