From 538bda6a0987583789e18506f327f0e3f04918cf Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Fri, 11 Feb 2011 18:50:08 +0100 Subject: [PATCH] Add Layer & Group script tags to Examples --- examples/Animated/animatedStar.html | 8 +++++--- examples/Scripts/arcTo.html | 6 ++++-- examples/Scripts/circle.html | 4 +++- examples/Scripts/letter.html | 4 +++- examples/Scripts/lines.html | 6 ++++-- examples/Scripts/rectangle.html | 4 +++- examples/Scripts/roundRectangle.html | 6 ++++-- examples/Scripts/star.html | 6 ++++-- examples/Scripts/strokeJoin.html | 4 +++- examples/Scripts/temp.html | 6 ++++-- examples/Tools/Circles.html | 6 ++++-- examples/Tools/Clouds.html | 4 +++- examples/Tools/Dripping Brush.html | 4 +++- examples/Tools/Fancy Brush.html | 4 +++- examples/Tools/Grid.html | 4 +++- examples/Tools/MultiLines.html | 4 +++- examples/Tools/Wave.html | 4 +++- examples/Tools/Worm Farm.html | 6 ++++-- 18 files changed, 63 insertions(+), 27 deletions(-) diff --git a/examples/Animated/animatedStar.html b/examples/Animated/animatedStar.html index be04a53a..82bc5c5c 100644 --- a/examples/Animated/animatedStar.html +++ b/examples/Animated/animatedStar.html @@ -14,6 +14,8 @@ + + diff --git a/examples/Scripts/arcTo.html b/examples/Scripts/arcTo.html index 6d950065..e4e0d9b4 100644 --- a/examples/Scripts/arcTo.html +++ b/examples/Scripts/arcTo.html @@ -14,6 +14,8 @@ + + + + + + diff --git a/examples/Scripts/lines.html b/examples/Scripts/lines.html index 486d29f4..32ab7e98 100644 --- a/examples/Scripts/lines.html +++ b/examples/Scripts/lines.html @@ -14,6 +14,8 @@ + + + + diff --git a/examples/Scripts/roundRectangle.html b/examples/Scripts/roundRectangle.html index 8f71d3fc..0f555d71 100644 --- a/examples/Scripts/roundRectangle.html +++ b/examples/Scripts/roundRectangle.html @@ -14,6 +14,8 @@ + + diff --git a/examples/Scripts/star.html b/examples/Scripts/star.html index f205c346..48ba213b 100644 --- a/examples/Scripts/star.html +++ b/examples/Scripts/star.html @@ -14,6 +14,8 @@ + + diff --git a/examples/Scripts/strokeJoin.html b/examples/Scripts/strokeJoin.html index b629055c..88d1e20b 100644 --- a/examples/Scripts/strokeJoin.html +++ b/examples/Scripts/strokeJoin.html @@ -14,6 +14,8 @@ + + diff --git a/examples/Scripts/temp.html b/examples/Scripts/temp.html index ef6b1829..b6090ac5 100644 --- a/examples/Scripts/temp.html +++ b/examples/Scripts/temp.html @@ -14,6 +14,8 @@ + + diff --git a/examples/Tools/Circles.html b/examples/Tools/Circles.html index 05b1757d..085cb83e 100644 --- a/examples/Tools/Circles.html +++ b/examples/Tools/Circles.html @@ -14,6 +14,8 @@ + + @@ -25,12 +27,12 @@ var tool = new Tool({ onMouseDrag: function(event) { if(event.count != 1) - doc.children.pop(); + doc.activeLayer.children.pop(); var distance = event.downPoint.subtract(event.point).length; var path = new Path.Circle(event.downPoint, distance); path.strokeColor = 'black'; path.fillColor = 'white'; - doc.children.push(path); + doc.activeLayer.appendTop(path); } }); tool.document = doc; diff --git a/examples/Tools/Clouds.html b/examples/Tools/Clouds.html index 03b9bc55..6a6bf70b 100644 --- a/examples/Tools/Clouds.html +++ b/examples/Tools/Clouds.html @@ -14,6 +14,8 @@ + + @@ -30,7 +32,7 @@ path.strokeJoin = 'round'; path.strokeCap = 'round'; path.add(event.point); - doc.children.push(path); + doc.activeLayer.appendTop(path); }, onMouseDrag: function(event) { path.arcTo(event.point, true); diff --git a/examples/Tools/Dripping Brush.html b/examples/Tools/Dripping Brush.html index e325b3ad..1877933e 100644 --- a/examples/Tools/Dripping Brush.html +++ b/examples/Tools/Dripping Brush.html @@ -14,6 +14,8 @@ + + @@ -38,7 +40,7 @@ path = new Path(); path.fillColor = 'black'; path.add(event.lastPoint); - doc.children.push(path); + doc.activeLayer.appendTop(path); } var step = event.delta.divide(2); diff --git a/examples/Tools/Fancy Brush.html b/examples/Tools/Fancy Brush.html index a1f1269f..cb5391eb 100644 --- a/examples/Tools/Fancy Brush.html +++ b/examples/Tools/Fancy Brush.html @@ -14,6 +14,8 @@ + + @@ -34,7 +36,7 @@ onMouseDown: function(event) { path = new Path(); path.fillColor = event.count % 2 ? 'red' : 'black'; - doc.children.push(path); + doc.activeLayer.appendTop(path); }, onMouseDrag: function(event) { diff --git a/examples/Tools/Grid.html b/examples/Tools/Grid.html index d30c2a6d..0af4981f 100644 --- a/examples/Tools/Grid.html +++ b/examples/Tools/Grid.html @@ -14,6 +14,8 @@ + + @@ -37,7 +39,7 @@ path = new Path(); path.strokeColor = 'black'; path.add(point); - doc.children.push(path); + doc.activeLayer.appendTop(path); }, onMouseDrag: function(event) { var p = getPos(event.point); diff --git a/examples/Tools/MultiLines.html b/examples/Tools/MultiLines.html index 7c383c94..461ba205 100644 --- a/examples/Tools/MultiLines.html +++ b/examples/Tools/MultiLines.html @@ -14,6 +14,8 @@ + + @@ -35,7 +37,7 @@ for (var i = 0; i < values.lines; i++) { var path = new Path(); path.strokeColor = '#000000'; - doc.children.push(path); + doc.activeLayer.appendTop(path); paths.push(path); } }, diff --git a/examples/Tools/Wave.html b/examples/Tools/Wave.html index bd2ffce5..5900d63f 100644 --- a/examples/Tools/Wave.html +++ b/examples/Tools/Wave.html @@ -14,6 +14,8 @@ + + @@ -35,7 +37,7 @@ onMouseDown: function(event) { path = new Path(); path.strokeColor = 'black'; - doc.children.push(path); + doc.activeLayer.appendTop(path); }, onMouseDrag: function(event) { diff --git a/examples/Tools/Worm Farm.html b/examples/Tools/Worm Farm.html index 8e8c9aaa..b6da0c7c 100644 --- a/examples/Tools/Worm Farm.html +++ b/examples/Tools/Worm Farm.html @@ -14,6 +14,8 @@ + + @@ -38,7 +40,7 @@ worm.fillColor = '#ffffff'; worm.strokeColor = '#000000'; worm.add(event.point); - doc.children.push(worm); + doc.activeLayer.appendTop(worm); }, onMouseDrag: function(event) { @@ -75,7 +77,7 @@ // make a new line path from top to bottom var line = new Path.Line(top, bottom); line.strokeColor = '#000000'; - doc.children.push(line); + doc.activeLayer.appendTop(line); // smooth the segments of the path worm.smooth();