Improve and fix example documentation.

This commit is contained in:
Jonathan Puckey 2013-03-04 12:09:58 +01:00
parent 97451320b9
commit 2d103dd792
2 changed files with 20 additions and 20 deletions

View file

@ -193,8 +193,8 @@ Path.inject({ statics: new function() {
* *
* @example {@paperscript} * @example {@paperscript}
* var rectangle = new Rectangle({ * var rectangle = new Rectangle({
* point: new Point(20, 20), * point: [20, 20],
* size: new Size(60, 60) * size: [180, 60]
* }); * });
* var path = new Path.Ellipse(rectangle); * var path = new Path.Ellipse(rectangle);
* path.fillColor = 'black'; * path.fillColor = 'black';

View file

@ -1301,10 +1301,10 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
* // Make the tangent vector 60pt long: * // Make the tangent vector 60pt long:
* tangent.length = 60; * tangent.length = 60;
* *
* var path = new Path(); * var line = new Path({
* path.strokeColor = 'red'; * segments: [point, point + tangent],
* path.add(point); * strokeColor: 'red'
* path.add(point + tangent); * })
* *
* @example {@paperscript height=200} * @example {@paperscript height=200}
* // Iterating over the length of a path: * // Iterating over the length of a path:
@ -1331,11 +1331,10 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
* // Make the tangent vector 60pt long: * // Make the tangent vector 60pt long:
* tangent.length = 60; * tangent.length = 60;
* *
* var line = new Path(); * var line = new Path({
* line.strokeColor = 'red'; * segments: [point, point + tangent],
* line.add(point); * strokeColor: 'red'
* line.add(point + tangent); * })
* }
*/ */
getTangentAt: function(offset, isParameter) { getTangentAt: function(offset, isParameter) {
var loc = this.getLocationAt(offset, isParameter); var loc = this.getLocationAt(offset, isParameter);
@ -1373,10 +1372,10 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
* // Make the normal vector 30pt long: * // Make the normal vector 30pt long:
* normal.length = 30; * normal.length = 30;
* *
* var path = new Path(); * var line = new Path({
* path.strokeColor = 'red'; * segments: [point, point + normal],
* path.add(point); * strokeColor: 'red'
* path.add(point + normal); * });
* *
* @example {@paperscript height=200} * @example {@paperscript height=200}
* // Iterating over the length of a path: * // Iterating over the length of a path:
@ -1403,10 +1402,11 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
* // Make the normal vector 30pt long: * // Make the normal vector 30pt long:
* normal.length = 30; * normal.length = 30;
* *
* var path = new Path({ * var line = new Path({
* segments: [point, point + normal], * segments: [point, point + normal],
* strokeColor: 'red' * strokeColor: 'red'
* }); * });
* }
*/ */
getNormalAt: function(offset, isParameter) { getNormalAt: function(offset, isParameter) {
var loc = this.getLocationAt(offset, isParameter); var loc = this.getLocationAt(offset, isParameter);
@ -1456,7 +1456,7 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
* center: view.center, * center: view.center,
* radius: 3, * radius: 3,
* fillColor: 'red' * fillColor: 'red'
* });; * });
* *
* function onMouseMove(event) { * function onMouseMove(event) {
* // Get the nearest point from the mouse position * // Get the nearest point from the mouse position