From fa861f2047fb094123b7bcff1c1188640b5515b7 Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Sun, 3 Mar 2013 20:10:25 +0100 Subject: [PATCH] Improve example documentation. --- src/item/PlacedSymbol.js | 14 +++++++++----- src/path/CompoundPath.js | 14 +++++++++++--- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/item/PlacedSymbol.js b/src/item/PlacedSymbol.js index 899aa183..289238de 100644 --- a/src/item/PlacedSymbol.js +++ b/src/item/PlacedSymbol.js @@ -33,11 +33,15 @@ var PlacedSymbol = this.PlacedSymbol = PlacedItem.extend(/** @lends PlacedSymbol * * @example {@paperscript split=true height=240} * // Placing 100 instances of a symbol: - * var path = new Path.Star(new Point(0, 0), 6, 5, 13); - * path.style = { - * fillColor: 'white', - * strokeColor: 'black' - * }; + * // Create a star shaped path at {x: 0, y: 0}: + * var path = new Path.Star({ + * center: new Point(0, 0), + * numPoints: 6, + * radius1: 5, + * radius2: 13, + * fillColor: 'white', + * strokeColor: 'black' + * }); * * // Create a symbol from the path: * var symbol = new Symbol(path); diff --git a/src/path/CompoundPath.js b/src/path/CompoundPath.js index 42799343..560f3d27 100644 --- a/src/path/CompoundPath.js +++ b/src/path/CompoundPath.js @@ -33,11 +33,19 @@ var CompoundPath = this.CompoundPath = PathItem.extend(/** @lends CompoundPath# * * @example {@paperscript} * // Create a circle shaped path with a hole in it: - * var circle = new Path.Circle(new Point(50, 50), 30); - * var innerCircle = new Path.Circle(new Point(50, 50), 10); + * var circle = new Path.Circle({ + * center: new Point(50, 50), + * radius: 30 + * }); + * + * var innerCircle = new Path.Circle({ + * center: new Point(50, 50), + * radius: 10 + * }); + * * var compoundPath = new CompoundPath([circle, innerCircle]); * compoundPath.fillColor = 'red'; - * + * * // Move the inner circle 5pt to the right: * compoundPath.children[1].position.x += 5; */