mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Some small changes to lines example.
This commit is contained in:
parent
f39895a945
commit
6430baa858
1 changed files with 5 additions and 4 deletions
|
@ -14,8 +14,8 @@
|
|||
path.closed = true;
|
||||
}
|
||||
|
||||
var position = new Point(document.size) / 2;
|
||||
var mousePos = position;
|
||||
var position = document.bounds.center;
|
||||
var mousePos = position;
|
||||
var children = document.activeLayer.children;
|
||||
var count = 0;
|
||||
|
||||
|
@ -24,13 +24,14 @@
|
|||
var delta = (mousePos - position);
|
||||
position += delta / 10;
|
||||
for (var i = 1; i < amount; i++) {
|
||||
var path = children[i];
|
||||
var length = Math.abs(Math.sin(i + count / 20) * 300);
|
||||
children[i].segments = [
|
||||
path.segments = [
|
||||
position + delta / 1.5,
|
||||
position + { angle: i * 2, length: length },
|
||||
position + { angle: (i + 1) * 2, length: length }
|
||||
];
|
||||
children[i].fillColor.hue = count - length;
|
||||
path.fillColor.hue = count - length;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue