Lines example: use new notation for creating paths.

This commit is contained in:
Jonathan Puckey 2013-03-02 20:51:44 +01:00
parent 4a7972ce0c
commit 1346b7d4c0

View file

@ -8,10 +8,11 @@
<script type="text/paperscript" canvas="canvas"> <script type="text/paperscript" canvas="canvas">
var amount = 180; var amount = 180;
for (var i = 0; i < amount; i++) { for (var i = 0; i < amount; i++) {
var path = new Path(); var path = new Path({
path.fillColor = new HsbColor(1, 1, Math.random()); fillColor: new HsbColor(1, 1, Math.random()),
path.strokeCap = 'round'; strokeCap: 'round',
path.closed = true; closed: true
});
} }
var position = view.center; var position = view.center;
@ -21,7 +22,7 @@
function iterate() { function iterate() {
count++; count++;
var delta = (mousePos - position); var delta = mousePos - position;
position += delta / 10; position += delta / 10;
for (var i = 1; i < amount; i++) { for (var i = 1; i < amount; i++) {
var path = children[i]; var path = children[i];