mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -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];
|
path.fillColor = colors[i % 4];
|
||||||
var scale = (1 - i / amount) * 20;
|
var scale = (1 - i / amount) * 20;
|
||||||
path.scale(scale);
|
path.scale(scale);
|
||||||
new PlacedSymbol(path);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onMouseDown(event) {
|
function onMouseMove(event) {
|
||||||
mousePoint = event.point;
|
|
||||||
}
|
|
||||||
|
|
||||||
function onMouseDrag(event) {
|
|
||||||
mousePoint = event.point;
|
mousePoint = event.point;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +30,7 @@
|
||||||
var delta = (mousePoint - item.position) / (i + 5);
|
var delta = (mousePoint - item.position) / (i + 5);
|
||||||
item.rotate(Math.sin((event.count + i) / 10) * 7);
|
item.rotate(Math.sin((event.count + i) / 10) * 7);
|
||||||
if (delta.length > 0.1)
|
if (delta.length > 0.1)
|
||||||
item.translate(delta);
|
item.position += delta;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue