4 ms·
Neat! Here are some pedantic suggestions: <!DOCTYPE HTML> is necessary to let IE9 work without whining imageData is slow and I'd avoid using it. In this insta
by simonsarris 15y ago
Neat! Here are some pedantic suggestions:
<!DOCTYPE HTML> is necessary to let IE9 work without whining
imageData is slow and I'd avoid using it. In this instance you can accomplish the same effect with calls to fillRect.
As it stands right now, you are setting the fillStyle of the arc each time but only need to set it once since the fillStyle never changes. In fact, you probably don't even have to recreate the path each time, since the last path ought to still be there, so the only thing that needs to be in the loop for the arc is `ctx.fill();`! (Haven't tested, but that ought to be the case)