From 6430baa858e4f3f64b9d91b481d4fc2b790ee7e6 Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Sat, 12 Mar 2011 15:28:01 +0100 Subject: [PATCH] Some small changes to lines example. --- examples/Scripts/lines.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/Scripts/lines.html b/examples/Scripts/lines.html index b3fcd1ed..c51874c7 100644 --- a/examples/Scripts/lines.html +++ b/examples/Scripts/lines.html @@ -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; } }