mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Lines example: use new notation for creating paths.
This commit is contained in:
parent
4a7972ce0c
commit
1346b7d4c0
1 changed files with 6 additions and 5 deletions
|
@ -8,10 +8,11 @@
|
|||
<script type="text/paperscript" canvas="canvas">
|
||||
var amount = 180;
|
||||
for (var i = 0; i < amount; i++) {
|
||||
var path = new Path();
|
||||
path.fillColor = new HsbColor(1, 1, Math.random());
|
||||
path.strokeCap = 'round';
|
||||
path.closed = true;
|
||||
var path = new Path({
|
||||
fillColor: new HsbColor(1, 1, Math.random()),
|
||||
strokeCap: 'round',
|
||||
closed: true
|
||||
});
|
||||
}
|
||||
|
||||
var position = view.center;
|
||||
|
@ -21,7 +22,7 @@
|
|||
|
||||
function iterate() {
|
||||
count++;
|
||||
var delta = (mousePos - position);
|
||||
var delta = mousePos - position;
|
||||
position += delta / 10;
|
||||
for (var i = 1; i < amount; i++) {
|
||||
var path = children[i];
|
||||
|
|
Loading…
Reference in a new issue