mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Improve RoundedRectangles example.
This commit is contained in:
parent
115d12f6ce
commit
52175da3e9
1 changed files with 2 additions and 7 deletions
|
@ -17,14 +17,9 @@
|
|||
path.fillColor = colors[i % 4];
|
||||
var scale = (1 - i / amount) * 20;
|
||||
path.scale(scale);
|
||||
new PlacedSymbol(path);
|
||||
}
|
||||
|
||||
function onMouseDown(event) {
|
||||
mousePoint = event.point;
|
||||
}
|
||||
|
||||
function onMouseDrag(event) {
|
||||
function onMouseMove(event) {
|
||||
mousePoint = event.point;
|
||||
}
|
||||
|
||||
|
@ -35,7 +30,7 @@
|
|||
var delta = (mousePoint - item.position) / (i + 5);
|
||||
item.rotate(Math.sin((event.count + i) / 10) * 7);
|
||||
if (delta.length > 0.1)
|
||||
item.translate(delta);
|
||||
item.position += delta;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue