From 4ec8847859409dbf8f8d02d7fefd8b7431bcf307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Mon, 14 Mar 2011 22:20:04 +0100 Subject: [PATCH] Use the experimental Event.requestAnimationFrame() rather than setInterval(). --- examples/Animated/animatedStar.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/Animated/animatedStar.html b/examples/Animated/animatedStar.html index a4532add..8bf8aa4f 100644 --- a/examples/Animated/animatedStar.html +++ b/examples/Animated/animatedStar.html @@ -18,7 +18,7 @@ var offset = new Point(20 + 10 * i, 0); var path = new Path(); path.fillColor = i % 2 ? 'red' : 'black'; - console.log(path.fillColor); + //console.log('color', path.fillColor); path.closed = true; var l = offset.length; @@ -33,7 +33,7 @@ placedSymbol.position = center; layer.appendBottom(placedSymbol); } - setInterval(draw, 30); +// setInterval(draw, 30); var count = 0; function draw() { @@ -44,7 +44,9 @@ item.rotate(angle); } document.redraw(); + Event.requestAnimationFrame(draw, document.canvas); } + Event.requestAnimationFrame(draw, document.canvas);