Use the experimental Event.requestAnimationFrame() rather than setInterval().

This commit is contained in:
Jürg Lehni 2011-03-14 22:21:27 +01:00
parent 4ec8847859
commit 7e46eeabc4

View file

@ -20,7 +20,7 @@
path.scale(scale);
new PlacedSymbol(path);
}
setInterval(draw, 30);
// setInterval(draw, 30);
function onMouseDrag(event) {
mousePoint = event.point;
@ -38,7 +38,9 @@
item.translate(delta);
}
document.redraw();
Event.requestAnimationFrame(draw, document.canvas);
}
Event.requestAnimationFrame(draw, document.canvas);
</script>
</head>
<body>