mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -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);
|
path.scale(scale);
|
||||||
new PlacedSymbol(path);
|
new PlacedSymbol(path);
|
||||||
}
|
}
|
||||||
setInterval(draw, 30);
|
// setInterval(draw, 30);
|
||||||
|
|
||||||
function onMouseDrag(event) {
|
function onMouseDrag(event) {
|
||||||
mousePoint = event.point;
|
mousePoint = event.point;
|
||||||
|
@ -38,7 +38,9 @@
|
||||||
item.translate(delta);
|
item.translate(delta);
|
||||||
}
|
}
|
||||||
document.redraw();
|
document.redraw();
|
||||||
|
Event.requestAnimationFrame(draw, document.canvas);
|
||||||
}
|
}
|
||||||
|
Event.requestAnimationFrame(draw, document.canvas);
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
Loading…
Reference in a new issue