Clearing stroke paths (within a loop) in HTML5 canvas
I'm struggling to clear a canvas for 2 simple stroke paths.
Example: http://dl.dropbox.com/u/104380/canvas-test-case.html
... I'm using the new
requestAnimFrame()
by Paul Irish. But I don't think this should have any effect on Canvas contexts, as opposed to a setInterval. As far开发者_JAVA百科 as I know, I'm also correctly using beginPath() and recalling getContext() inside the render loop.
... problem is, the two original strokes are not clearing!
Any ideas?
this line...
context.clearRect(0,0,canvas.width,canvas.height);
should be
context.clearRect(0,0,canvas[0].width,canvas[0].height);
精彩评论