mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Use the experimental Event.requestAnimationFrame() rather than setInterval().
This commit is contained in:
parent
4ec8847859
commit
7e46eeabc4
1 changed files with 3 additions and 1 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue