A whole lot of documentation clean-up.

This commit is contained in:
Jürg Lehni 2015-06-16 17:50:37 +02:00
parent 0d8deb4a9e
commit b541088c6f
28 changed files with 265 additions and 246 deletions

View file

@ -158,6 +158,7 @@ var Matrix = Base.extend(/** @lends Matrix# */{
/** /**
* Attempts to apply the matrix to the content of item that it belongs to, * Attempts to apply the matrix to the content of item that it belongs to,
* meaning its transformation is baked into the item's content or children. * meaning its transformation is baked into the item's content or children.
*
* @param {Boolean} recursively controls whether to apply transformations * @param {Boolean} recursively controls whether to apply transformations
* recursively on children * recursively on children
* @return {Boolean} {@true if the matrix was applied} * @return {Boolean} {@true if the matrix was applied}
@ -483,7 +484,7 @@ var Matrix = Base.extend(/** @lends Matrix# */{
* @param {Number[]} dst the array into which to store the transformed * @param {Number[]} dst the array into which to store the transformed
* point pairs * point pairs
* @param {Number} count the number of points to transform * @param {Number} count the number of points to transform
* @return {Number[]} the dst array, containing the transformed coordinates. * @return {Number[]} the dst array, containing the transformed coordinates
*/ */
transform: function(/* point | */ src, dst, count) { transform: function(/* point | */ src, dst, count) {
return arguments.length < 3 return arguments.length < 3
@ -594,7 +595,7 @@ var Matrix = Base.extend(/** @lends Matrix# */{
* an object with these properties if it succeeded, {@code null} otherwise. * an object with these properties if it succeeded, {@code null} otherwise.
* *
* @return {Object} the decomposed matrix, or {@code null} if decomposition * @return {Object} the decomposed matrix, or {@code null} if decomposition
* is not possible. * is not possible
*/ */
decompose: function() { decompose: function() {
// http://dev.w3.org/csswg/css3-2d-transforms/#matrix-decomposition // http://dev.w3.org/csswg/css3-2d-transforms/#matrix-decomposition

View file

@ -410,7 +410,7 @@ var Point = Base.extend(/** @lends Point# */{
* *
* @param {Point} point * @param {Point} point
* @param {Boolean} [squared=false] Controls whether the distance should * @param {Boolean} [squared=false] Controls whether the distance should
* remain squared, or its square root should be calculated. * remain squared, or its square root should be calculated
* @return {Number} * @return {Number}
*/ */
getDistance: function(/* point, squared */) { getDistance: function(/* point, squared */) {
@ -430,7 +430,7 @@ var Point = Base.extend(/** @lends Point# */{
* *
* @param {Number} [length=1] The length of the normalized vector * @param {Number} [length=1] The length of the normalized vector
* @return {Point} the normalized vector of the vector that is represented * @return {Point} the normalized vector of the vector that is represented
* by this point's coordinates * by this point's coordinates
*/ */
normalize: function(length) { normalize: function(length) {
if (length === undefined) if (length === undefined)
@ -641,7 +641,7 @@ var Point = Base.extend(/** @lends Point# */{
* @operator * @operator
* @param {Number} value * @param {Number} value
* @return {Point} the integer remainders of dividing the point by the value * @return {Point} the integer remainders of dividing the point by the value
* as a new point * as a new point
* *
* @example * @example
* var point = new Point(12, 6); * var point = new Point(12, 6);
@ -656,7 +656,7 @@ var Point = Base.extend(/** @lends Point# */{
* @operator * @operator
* @param {Point} point * @param {Point} point
* @return {Point} the integer remainders of dividing the points by each * @return {Point} the integer remainders of dividing the points by each
* other as a new point * other as a new point
* *
* @example * @example
* var point = new Point(12, 6); * var point = new Point(12, 6);

View file

@ -37,7 +37,7 @@ var Rectangle = Base.extend(/** @lends Rectangle# */{
* *
* @name Rectangle#initialize * @name Rectangle#initialize
* @param {Object} object an object containing properties to be set on the * @param {Object} object an object containing properties to be set on the
* rectangle. * rectangle
* *
* @example // Create a rectangle between {x: 20, y: 20} and {x: 80, y:80} * @example // Create a rectangle between {x: 20, y: 20} and {x: 80, y:80}
* var rectangle = new Rectangle({ * var rectangle = new Rectangle({
@ -530,7 +530,7 @@ var Rectangle = Base.extend(/** @lends Rectangle# */{
* @function * @function
* @param {Rectangle} rect The specified rectangle * @param {Rectangle} rect The specified rectangle
* @return {Boolean} {@true if the rectangle entirely contains the specified * @return {Boolean} {@true if the rectangle entirely contains the specified
* rectangle} * rectangle}
* *
* @example {@paperscript} * @example {@paperscript}
* // Checking whether the bounding box of one item is contained within * // Checking whether the bounding box of one item is contained within
@ -600,7 +600,7 @@ var Rectangle = Base.extend(/** @lends Rectangle# */{
* *
* @param {Rectangle} rect the specified rectangle * @param {Rectangle} rect the specified rectangle
* @return {Boolean} {@true if the rectangle and the specified rectangle * @return {Boolean} {@true if the rectangle and the specified rectangle
* intersect each other} * intersect each other}
* *
* @example {@paperscript} * @example {@paperscript}
* // Checking whether the bounding box of one item intersects with * // Checking whether the bounding box of one item intersects with
@ -660,9 +660,9 @@ var Rectangle = Base.extend(/** @lends Rectangle# */{
* with the specified rectangle. * with the specified rectangle.
* *
* @param {Rectangle} rect The rectangle to be intersected with this * @param {Rectangle} rect The rectangle to be intersected with this
* rectangle * rectangle
* @return {Rectangle} the largest rectangle contained in both the specified * @return {Rectangle} the largest rectangle contained in both the specified
* rectangle and in this rectangle * rectangle and in this rectangle
* *
* @example {@paperscript} * @example {@paperscript}
* // Intersecting two rectangles and visualizing the result using rectangle * // Intersecting two rectangles and visualizing the result using rectangle
@ -709,7 +709,7 @@ var Rectangle = Base.extend(/** @lends Rectangle# */{
* *
* @param {Rectangle} rect the rectangle to be combined with this rectangle * @param {Rectangle} rect the rectangle to be combined with this rectangle
* @return {Rectangle} the smallest rectangle containing both the specified * @return {Rectangle} the smallest rectangle containing both the specified
* rectangle and this rectangle. * rectangle and this rectangle
*/ */
unite: function(/* rect */) { unite: function(/* rect */) {
var rect = Rectangle.read(arguments), var rect = Rectangle.read(arguments),

View file

@ -341,7 +341,7 @@ var Size = Base.extend(/** @lends Size# */{
* @operator * @operator
* @param {Number} value * @param {Number} value
* @return {Size} the integer remainders of dividing the size by the value * @return {Size} the integer remainders of dividing the size by the value
* as a new size * as a new size
* *
* @example * @example
* var size = new Size(12, 6); * var size = new Size(12, 6);
@ -356,7 +356,7 @@ var Size = Base.extend(/** @lends Size# */{
* @operator * @operator
* @param {Size} size * @param {Size} size
* @return {Size} the integer remainders of dividing the sizes by each * @return {Size} the integer remainders of dividing the sizes by each
* other as a new size * other as a new size
* *
* @example * @example
* var size = new Size(12, 6); * var size = new Size(12, 6);

View file

@ -47,9 +47,15 @@ Base.inject(/** @lends Base# */{
}, },
/** /**
* Serializes this object to a JSON string. * Exports (serializes) this object to a JSON data object or string.
* *
* @param {Object} [options={ asString: true, precision: 5 }] * @option [options.asString=true] {Boolean} whether the JSON is returned as
* a {@code Object} or a {@code String}
* @option [options.precision=5] {Number} the amount of fractional digits in
* numbers used in JSON data
*
* @param {Object} [options] the serialization options
* @return {String} the exported JSON data
*/ */
exportJSON: function(options) { exportJSON: function(options) {
return Base.exportJSON(this, options); return Base.exportJSON(this, options);
@ -65,8 +71,7 @@ Base.inject(/** @lends Base# */{
* literal describing all the properties to be set on the created instance. * literal describing all the properties to be set on the created instance.
* *
* @param {Object} props an object describing the properties to set * @param {Object} props an object describing the properties to set
* @param {Object} [exclude=undefined] a lookup table listing properties to * @param {Object} [exclude] a lookup table listing properties to exclude
* exclude
* @param {Boolean} [dontCheck=false] whether to perform a * @param {Boolean} [dontCheck=false] whether to perform a
* Base.isPlainObject() check on props or not * Base.isPlainObject() check on props or not
* @return {Boolean} {@true if the object is a plain object} * @return {Boolean} {@true if the object is a plain object}
@ -156,11 +161,12 @@ Base.inject(/** @lends Base# */{
* the subclass from the passed arguments list or array, at the given * the subclass from the passed arguments list or array, at the given
* index, up to the specified length. * index, up to the specified length.
* When called directly on Base, it reads any value without conversion * When called directly on Base, it reads any value without conversion
* from the apssed arguments list or array. * from the passed arguments list or array.
* This is used in argument conversion, e.g. by all basic types (Point, * This is used in argument conversion, e.g. by all basic types (Point,
* Size, Rectangle) and also higher classes such as Color and Segment. * Size, Rectangle) and also higher classes such as Color and Segment.
*
* @param {Array} list the list to read from, either an arguments object * @param {Array} list the list to read from, either an arguments object
* or a normal array. * or a normal array
* @param {Number} start the index at which to start reading in the list * @param {Number} start the index at which to start reading in the list
* @param {Number} length the amount of elements that can be read * @param {Number} length the amount of elements that can be read
* @param {Object} options {@code options.readNull} controls whether * @param {Object} options {@code options.readNull} controls whether
@ -204,8 +210,9 @@ Base.inject(/** @lends Base# */{
/** /**
* Allows peeking ahead in reading of values and objects from arguments * Allows peeking ahead in reading of values and objects from arguments
* list through Base.read(). * list through Base.read().
*
* @param {Array} list the list to read from, either an arguments object * @param {Array} list the list to read from, either an arguments object
* or a normal array. * or a normal array
* @param {Number} start the index at which to start reading in the list * @param {Number} start the index at which to start reading in the list
*/ */
peek: function(list, start) { peek: function(list, start) {
@ -222,8 +229,9 @@ Base.inject(/** @lends Base# */{
/** /**
* Reads all readable arguments from the list, handling nested arrays * Reads all readable arguments from the list, handling nested arrays
* separately. * separately.
*
* @param {Array} list the list to read from, either an arguments object * @param {Array} list the list to read from, either an arguments object
* or a normal array. * or a normal array
* @param {Number} start the index at which to start reading in the list * @param {Number} start the index at which to start reading in the list
* @param {Object} options {@code options.readNull} controls whether * @param {Object} options {@code options.readNull} controls whether
* null is returned or converted. {@code options.clone} controls whether * null is returned or converted. {@code options.clone} controls whether
@ -247,10 +255,11 @@ Base.inject(/** @lends Base# */{
* Base.readNamed() can read both from such named properties and normal * Base.readNamed() can read both from such named properties and normal
* unnamed arguments through Base.read(). In use for example for the * unnamed arguments through Base.read(). In use for example for the
* various Path.Constructors. * various Path.Constructors.
*
* @param {Array} list the list to read from, either an arguments object * @param {Array} list the list to read from, either an arguments object
* or a normal array. * or a normal array
* @param {Number} start the index at which to start reading in the list * @param {Number} start the index at which to start reading in the list
* @param {String} name the property name to read from. * @param {String} name the property name to read from
*/ */
readNamed: function(list, name, start, options, length) { readNamed: function(list, name, start, options, length) {
var value = this.getNamed(list, name), var value = this.getNamed(list, name),
@ -275,8 +284,8 @@ Base.inject(/** @lends Base# */{
/** /**
* @return the named value if the list provides an arguments object, * @return the named value if the list provides an arguments object,
* {@code null} if the named value is {@code null} or {@code undefined}, * {@code null} if the named value is {@code null} or {@code undefined},
* and {@code undefined} if there is no arguments object. * and {@code undefined} if there is no arguments object
* If no name is provided, it returns the whole arguments object. * If no name is provided, it returns the whole arguments object
*/ */
getNamed: function(list, name) { getNamed: function(list, name) {
var arg = list[0]; var arg = list[0];

View file

@ -121,9 +121,9 @@ var PaperScope = Base.extend(/** @lends PaperScope# */{
* @name PaperScope#settings * @name PaperScope#settings
* @type Object * @type Object
* *
* @option settings.applyMatrix {Boolean} * @option [settings.applyMatrix=true] {Boolean}
* @option settings.handleSize {Number} * @option [settings.handleSize=4] {Number}
* @option settings.hitTolerance {Number} * @option [settings.hitTolerance=0] {Number}
*/ */
/** /**

View file

@ -99,9 +99,9 @@ Base.exports.PaperScript = (function() {
* *
* @name PaperScript.compile * @name PaperScript.compile
* @function * @function
* @param {String} code the PaperScript code. * @param {String} code the PaperScript code
* @param {String} url the url of the source, for source-map debugging. * @param {String} url the url of the source, for source-map debugging
* @return {String} the compiled PaperScript as JavaScript code. * @return {String} the compiled PaperScript as JavaScript code
*/ */
function compile(code, url, options) { function compile(code, url, options) {
if (!code) if (!code)
@ -330,9 +330,9 @@ Base.exports.PaperScript = (function() {
* *
* @name PaperScript.execute * @name PaperScript.execute
* @function * @function
* @param {String} code the PaperScript code. * @param {String} code the PaperScript code
* @param {PaperScope} scope the scope for which the code is executed. * @param {PaperScope} scope the scope for which the code is executed
* @param {String} url the url of the source, for source-map debugging. * @param {String} url the url of the source, for source-map debugging
*/ */
function execute(code, scope, url, options) { function execute(code, scope, url, options) {
// Set currently active scope. // Set currently active scope.
@ -506,9 +506,9 @@ Base.exports.PaperScript = (function() {
* @name PaperScript.load * @name PaperScript.load
* @function * @function
* @param {HTMLScriptElement} [script=null] the script to load. If none is * @param {HTMLScriptElement} [script=null] the script to load. If none is
* provided, all scripts of the HTML document are iterated over and loaded. * provided, all scripts of the HTML document are iterated over and loaded
* @return {PaperScope} the scope produced for the passed {@code script}, or * @return {PaperScope} the scope produced for the passed {@code script}, or
* {@code undefined} of multiple scripts area loaded. * {@code undefined} of multiple scripts area loaded
*/ */
function load(script) { function load(script) {
return script ? loadScript(script) : loadAll(); return script ? loadScript(script) : loadAll();

View file

@ -32,7 +32,7 @@ var Group = Item.extend(/** @lends Group# */{
* *
* @name Group#initialize * @name Group#initialize
* @param {Item[]} [children] An array of children that will be added to the * @param {Item[]} [children] An array of children that will be added to the
* newly created group. * newly created group
* *
* @example {@paperscript} * @example {@paperscript}
* // Create a group containing two paths: * // Create a group containing two paths:
@ -74,7 +74,7 @@ var Group = Item.extend(/** @lends Group# */{
* *
* @name Group#initialize * @name Group#initialize
* @param {Object} object an object literal containing the properties to be * @param {Object} object an object literal containing the properties to be
* set on the group. * set on the group
* *
* @example {@paperscript} * @example {@paperscript}
* var path = new Path([100, 100], [100, 200]); * var path = new Path([100, 100], [100, 200]);

View file

@ -231,7 +231,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* Private notifier that is called whenever a change occurs in this item or * Private notifier that is called whenever a change occurs in this item or
* its sub-elements, such as Segments, Curves, Styles, etc. * its sub-elements, such as Segments, Curves, Styles, etc.
* *
* @param {ChangeFlag} flags describes what exactly has changed. * @param {ChangeFlag} flags describes what exactly has changed
*/ */
_changed: function(flags) { _changed: function(flags) {
var symbol = this._parentSymbol, var symbol = this._parentSymbol,
@ -284,8 +284,9 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* Sets those properties of the passed object literal on this item to * Sets those properties of the passed object literal on this item to
* the values defined in the object literal, if the item has property of the * the values defined in the object literal, if the item has property of the
* given name (or a setter defined for it). * given name (or a setter defined for it).
*
* @param {Object} props * @param {Object} props
* @return {Item} the item itself. * @return {Item} the item itself
* *
* @example {@paperscript} * @example {@paperscript}
* // Setting properties through an object literal * // Setting properties through an object literal
@ -1463,7 +1464,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* *
* @param {Boolean} [insert=true] specifies whether the copy should be * @param {Boolean} [insert=true] specifies whether the copy should be
* inserted into the DOM. When set to {@code true}, it is inserted above the * inserted into the DOM. When set to {@code true}, it is inserted above the
* original. * original
* @return {Item} the newly cloned item * @return {Item} the newly cloned item
* *
* @example {@paperscript} * @example {@paperscript}
@ -1492,7 +1493,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* *
* @param {Boolean} [insert=true] specifies whether the copy should be * @param {Boolean} [insert=true] specifies whether the copy should be
* inserted into the DOM. When set to {@code true}, it is inserted above the * inserted into the DOM. When set to {@code true}, it is inserted above the
* original. * original
* @return {Item} the newly cloned item * @return {Item} the newly cloned item
*/ */
_clone: function(copy, insert, includeMatrix) { _clone: function(copy, insert, includeMatrix) {
@ -1630,7 +1631,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* } * }
* } * }
* *
* @param {Point} point The point to check for. * @param {Point} point The point to check for
*/ */
contains: function(/* point */) { contains: function(/* point */) {
// See CompoundPath#_contains() for the reason for !! // See CompoundPath#_contains() for the reason for !!
@ -1697,30 +1698,29 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* The options object allows you to control the specifics of the hit-test * The options object allows you to control the specifics of the hit-test
* and may contain a combination of the following values: * and may contain a combination of the following values:
* *
* @option options.tolerance {Number} the tolerance of the hit-test in * @option [options.tolerance={@link PaperScope#settings}.hitTolerance]
* points. Can also be controlled through * {Number} the tolerance of the hit-test in points
* {@link PaperScope#settings}{@code .hitTolerance}.
* @option options.class {Function} only hit-test again a certain item class * @option options.class {Function} only hit-test again a certain item class
* and its sub-classes: {@code Group, Layer, Path, CompoundPath, * and its sub-classes: {@code Group, Layer, Path, CompoundPath,
* Shape, Raster, PlacedSymbol, PointText}, etc. * Shape, Raster, PlacedSymbol, PointText}, etc
* @option options.fill {Boolean} hit-test the fill of items. * @option options.fill {Boolean} hit-test the fill of items
* @option options.stroke {Boolean} hit-test the stroke of path items, * @option options.stroke {Boolean} hit-test the stroke of path items,
* taking into account the setting of stroke color and width. * taking into account the setting of stroke color and width
* @option options.segments {Boolean} hit-test for {@link Segment#point} of * @option options.segments {Boolean} hit-test for {@link Segment#point} of
* {@link Path} items. * {@link Path} items
* @option options.curves {Boolean} hit-test the curves of path items, * @option options.curves {Boolean} hit-test the curves of path items,
* without taking the stroke color or width into account. * without taking the stroke color or width into account
* @option options.handles {Boolean} hit-test for the handles. * @option options.handles {Boolean} hit-test for the handles
* ({@link Segment#handleIn} / {@link Segment#handleOut}) of path segments. * ({@link Segment#handleIn} / {@link Segment#handleOut}) of path segments
* @option options.ends {Boolean} only hit-test for the first or last * @option options.ends {Boolean} only hit-test for the first or last
* segment points of open path items. * segment points of open path items
* @option options.bounds {Boolean} hit-test the corners and side-centers of * @option options.bounds {Boolean} hit-test the corners and side-centers of
* the bounding rectangle of items ({@link Item#bounds}). * the bounding rectangle of items ({@link Item#bounds})
* @option options.center {Boolean} hit-test the {@link Rectangle#center} of * @option options.center {Boolean} hit-test the {@link Rectangle#center} of
* the bounding rectangle of items ({@link Item#bounds}). * the bounding rectangle of items ({@link Item#bounds})
* @option options.guides {Boolean} hit-test items that have * @option options.guides {Boolean} hit-test items that have
* {@link Item#guide} set to {@code true}. * {@link Item#guide} set to {@code true}
* @option options.selected {Boolean} only hit selected items. * @option options.selected {Boolean} only hit selected items
* *
* @param {Point} point The point where the hit-test should be performed * @param {Point} point The point where the hit-test should be performed
* @param {Object} [options={ fill: true, stroke: true, segments: true, * @param {Object} [options={ fill: true, stroke: true, segments: true,
@ -1845,8 +1845,8 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* @name Item#matches * @name Item#matches
* @function * @function
* *
* @param {Object} match the criteria to match against. * @param {Object} match the criteria to match against
* @return {@true if the item matches all the criteria} * @return {Boolean} {@true if the item matches all the criteria}
* @see #getItems(match) * @see #getItems(match)
*/ */
/** /**
@ -1863,10 +1863,10 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* @name Item#matches * @name Item#matches
* @function * @function
* *
* @param {String} name the name of the state to match against. * @param {String} name the name of the state to match against
* @param {Object} compare the value, function or regular expression to * @param {Object} compare the value, function or regular expression to
* compare against. * compare against
* @return {@true if the item matches the state} * @return {Boolean} {@true if the item matches the state}
* @see #getItems(match) * @see #getItems(match)
*/ */
matches: function(name, compare) { matches: function(name, compare) {
@ -1941,12 +1941,12 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* examples. * examples.
* *
* @option match.inside {Rectangle} the rectangle in which the items need to * @option match.inside {Rectangle} the rectangle in which the items need to
* be fully contained. * be fully contained
* @option match.overlapping {Rectangle} the rectangle with which the items * @option match.overlapping {Rectangle} the rectangle with which the items
* need to at least partly overlap. * need to at least partly overlap
* *
* @param {Object} match the criteria to match against. * @param {Object} match the criteria to match against
* @return {Item[]} the list of matching descendant items. * @return {Item[]} the list of matching descendant items
* @see #matches(match) * @see #matches(match)
*/ */
getItems: function(match) { getItems: function(match) {
@ -1964,8 +1964,8 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* See {@link Project#getItems(match)} for a selection of illustrated * See {@link Project#getItems(match)} for a selection of illustrated
* examples. * examples.
* *
* @param {Object} match the criteria to match against. * @param {Object} match the criteria to match against
* @return {Item} the first descendant item matching the given criteria. * @return {Item} the first descendant item matching the given criteria
* @see #getItems(match) * @see #getItems(match)
*/ */
getItem: function(match) { getItem: function(match) {
@ -2043,13 +2043,12 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* @name Item#exportJSON * @name Item#exportJSON
* @function * @function
* *
* @option options.asString {Boolean} whether the JSON is returned as a * @option [options.asString=true] {Boolean} whether the JSON is returned as a
* {@code Object} or a {@code String}. * {@code Object} or a {@code String}
* @option options.precision {Number} the amount of fractional digits in * @option [options.precision=5] {Number} the amount of fractional digits in
* numbers used in JSON data. * numbers used in JSON data
* *
* @param {Object} [options={ asString: true, precision: 5 }] the * @param {Object} [options] the serialization options
* serialization options
* @return {String} the exported JSON data * @return {String} the exported JSON data
*/ */
@ -2060,7 +2059,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* to this item's {@link Item#children} list. Note that not all type of * to this item's {@link Item#children} list. Note that not all type of
* items can have children. * items can have children.
* *
* @param {String} json the JSON data to import from. * @param {String} json the JSON data to import from
*/ */
importJSON: function(json) { importJSON: function(json) {
// Try importing into `this`. If another item is returned, try adding // Try importing into `this`. If another item is returned, try adding
@ -2078,15 +2077,15 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* @name Item#exportSVG * @name Item#exportSVG
* @function * @function
* *
* @option options.asString {Boolean} whether a SVG node or a {@code String} * @option [options.asString=false] {Boolean} whether a SVG node or a
* is to be returned. * {@code String} is to be returned
* @option options.precision {Number} the amount of fractional digits in * @option [options.precision=5] {Number} the amount of fractional digits in
* numbers used in SVG data. * numbers used in SVG data
* @option options.matchShapes {Boolean} whether path items should tried to * @option [options.matchShapes=false] {Boolean} whether path items should
* be converted to shape items, if their geometries can be made to match. * tried to be converted to shape items, if their geometries can be made to
* match
* *
* @param {Object} [options={ asString: false, precision: 5, * @param {Object} [options] the export options
* matchShapes: false }] the export options.
* @return {SVGElement} the item converted to an SVG node * @return {SVGElement} the item converted to an SVG node
*/ */
@ -2100,11 +2099,11 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* @name Item#importSVG * @name Item#importSVG
* @function * @function
* *
* @option options.expandShapes {Boolean} whether imported shape items * @option [options.expandShapes=false] {Boolean} whether imported shape
* should be expanded to path items. * items should be expanded to path items
* *
* @param {SVGElement|String} svg the SVG content to import * @param {SVGElement|String} svg the SVG content to import
* @param {Object} [options={ expandShapes: false }] the import options * @param {Object} [options] the import options
* @return {Item} the imported Paper.js parent item * @return {Item} the imported Paper.js parent item
*/ */
@ -2116,7 +2115,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* *
* @param {Item} item the item to be added as a child * @param {Item} item the item to be added as a child
* @return {Item} the added item, or {@code null} if adding was not * @return {Item} the added item, or {@code null} if adding was not
* possible. * possible
*/ */
addChild: function(item, _preserve) { addChild: function(item, _preserve) {
return this.insertChild(undefined, item, _preserve); return this.insertChild(undefined, item, _preserve);
@ -2130,7 +2129,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* @param {Number} index * @param {Number} index
* @param {Item} item the item to be inserted as a child * @param {Item} item the item to be inserted as a child
* @return {Item} the inserted item, or {@code null} if inserting was not * @return {Item} the inserted item, or {@code null} if inserting was not
* possible. * possible
*/ */
insertChild: function(index, item, _preserve) { insertChild: function(index, item, _preserve) {
var res = item ? this.insertChildren(index, [item], _preserve) : null; var res = item ? this.insertChildren(index, [item], _preserve) : null;
@ -2144,7 +2143,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* *
* @param {Item[]} items The items to be added as children * @param {Item[]} items The items to be added as children
* @return {Item[]} the added items, or {@code null} if adding was not * @return {Item[]} the added items, or {@code null} if adding was not
* possible. * possible
*/ */
addChildren: function(items, _preserve) { addChildren: function(items, _preserve) {
return this.insertChildren(this._children.length, items, _preserve); return this.insertChildren(this._children.length, items, _preserve);
@ -2158,7 +2157,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* @param {Number} index * @param {Number} index
* @param {Item[]} items The items to be appended as children * @param {Item[]} items The items to be appended as children
* @return {Item[]} the inserted items, or {@code null} if inserted was not * @return {Item[]} the inserted items, or {@code null} if inserted was not
* possible. * possible
*/ */
insertChildren: function(index, items, _preserve, _proto) { insertChildren: function(index, items, _preserve, _proto) {
// CompoundPath#insertChildren() requires _preserve and _type: // CompoundPath#insertChildren() requires _preserve and _type:
@ -2223,7 +2222,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* *
* @param {Item} item the item above which it should be inserted * @param {Item} item the item above which it should be inserted
* @return {Item} the inserted item, or {@code null} if inserting was not * @return {Item} the inserted item, or {@code null} if inserting was not
* possible. * possible
*/ */
insertAbove: function(item, _preserve) { insertAbove: function(item, _preserve) {
return item._insertSibling(item._index + 1, this, _preserve); return item._insertSibling(item._index + 1, this, _preserve);
@ -2234,7 +2233,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* *
* @param {Item} item the item below which it should be inserted * @param {Item} item the item below which it should be inserted
* @return {Item} the inserted item, or {@code null} if inserting was not * @return {Item} the inserted item, or {@code null} if inserting was not
* possible. * possible
*/ */
insertBelow: function(item, _preserve) { insertBelow: function(item, _preserve) {
return item._insertSibling(item._index, this, _preserve); return item._insertSibling(item._index, this, _preserve);
@ -3046,7 +3045,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
/** /**
* Transform the item. * Transform the item.
* *
* @param {Matrix} matrix the matrix by which the item shall be transformed. * @param {Matrix} matrix the matrix by which the item shall be transformed
*/ */
// TODO: Implement flags: // TODO: Implement flags:
// @param {String[]} flags Array of any of the following: 'objects', // @param {String[]} flags Array of any of the following: 'objects',
@ -3281,11 +3280,11 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* the frame event: * the frame event:
* *
* @option event.count {Number} the number of times the frame event was * @option event.count {Number} the number of times the frame event was
* fired. * fired
* @option event.time {Number} the total amount of time passed since the * @option event.time {Number} the total amount of time passed since the
* first frame event in seconds. * first frame event in seconds
* @option event.delta {Number} the time passed in seconds since the last * @option event.delta {Number} the time passed in seconds since the last
* frame event. * frame event
* *
* @see View#onFrame * @see View#onFrame
* @example {@paperscript} * @example {@paperscript}

View file

@ -36,7 +36,7 @@ var Layer = Group.extend(/** @lends Layer# */{
* *
* @name Layer#initialize * @name Layer#initialize
* @param {Item[]} [children] An array of items that will be added to the * @param {Item[]} [children] An array of items that will be added to the
* newly created layer. * newly created layer
* *
* @example * @example
* var layer = new Layer(); * var layer = new Layer();
@ -48,7 +48,7 @@ var Layer = Group.extend(/** @lends Layer# */{
* *
* @name Layer#initialize * @name Layer#initialize
* @param {Object} object an object literal containing the properties to be * @param {Object} object an object literal containing the properties to be
* set on the layer. * set on the layer
* *
* @example {@paperscript} * @example {@paperscript}
* var path = new Path([100, 100], [100, 200]); * var path = new Path([100, 100], [100, 200]);

View file

@ -484,7 +484,7 @@ var Raster = Item.extend(/** @lends Raster# */{
* *
* @param {Path|Rectangle|Point} object * @param {Path|Rectangle|Point} object
* @return {Color} the average color contained in the area covered by the * @return {Color} the average color contained in the area covered by the
* specified path, rectangle or point. * specified path, rectangle or point
*/ */
getAverageColor: function(object) { getAverageColor: function(object) {
var bounds, path; var bounds, path;

View file

@ -163,9 +163,9 @@ var Shape = Item.extend(/** @lends Shape# */{
* *
* @param {Boolean} [insert=true] specifies whether the new path should be * @param {Boolean} [insert=true] specifies whether the new path should be
* inserted into the DOM. When set to {@code true}, it is inserted above the * inserted into the DOM. When set to {@code true}, it is inserted above the
* shape item. * shape item
* @return {Shape} the newly created path item with the same geometry as * @return {Shape} the newly created path item with the same geometry as
* this shape item. * this shape item
* @see Path#toShape(insert) * @see Path#toShape(insert)
*/ */
toPath: function(insert) { toPath: function(insert) {
@ -407,7 +407,7 @@ statics: new function() {
* *
* @name Shape.Rectangle * @name Shape.Rectangle
* @param {Rectangle} rectangle the rectangle object describing the * @param {Rectangle} rectangle the rectangle object describing the
* geometry of the rectangular shape to be created. * geometry of the rectangular shape to be created
* @param {Size} [radius=null] the size of the rounded corners * @param {Size} [radius=null] the size of the rounded corners
* @return {Shape} the newly created shape * @return {Shape} the newly created shape
* *

View file

@ -29,7 +29,7 @@ var CompoundPath = PathItem.extend(/** @lends CompoundPath# */{
/** /**
* Creates a new compound path item and places it in the active layer. * Creates a new compound path item and places it in the active layer.
* *
* @param {Path[]} [paths] the paths to place within the compound path. * @param {Path[]} [paths] the paths to place within the compound path
* *
* @example {@paperscript} * @example {@paperscript}
* // Create a circle shaped path with a hole in it: * // Create a circle shaped path with a hole in it:
@ -80,7 +80,7 @@ var CompoundPath = PathItem.extend(/** @lends CompoundPath# */{
* *
* @name CompoundPath#initialize * @name CompoundPath#initialize
* @param {String} pathData the SVG path-data that describes the geometry * @param {String} pathData the SVG path-data that describes the geometry
* of this path. * of this path
* @return {CompoundPath} the newly created path * @return {CompoundPath} the newly created path
* *
* @example {@paperscript} * @example {@paperscript}

View file

@ -334,9 +334,9 @@ var Curve = Base.extend(/** @lends Curve# */{
* @name Curve#divide * @name Curve#divide
* @function * @function
* @param {Number} [offset=0.5] the offset on the curve at which to split, * @param {Number} [offset=0.5] the offset on the curve at which to split,
* or the curve time parameter if {@code isParameter} is {@code true} * or the curve time parameter if {@code isParameter} is {@code true}
* @param {Boolean} [isParameter=false] pass {@code true} if {@code offset} * @param {Boolean} [isParameter=false] pass {@code true} if {@code offset}
* is a curve time parameter. * is a curve time parameter
* @return {Curve} the second part of the divided curve * @return {Curve} the second part of the divided curve
*/ */
// TODO: Rename to divideAt()? // TODO: Rename to divideAt()?
@ -400,9 +400,9 @@ var Curve = Base.extend(/** @lends Curve# */{
* @name Curve#split * @name Curve#split
* @function * @function
* @param {Number} [offset=0.5] the offset on the curve at which to split, * @param {Number} [offset=0.5] the offset on the curve at which to split,
* or the curve time parameter if {@code isParameter} is {@code true} * or the curve time parameter if {@code isParameter} is {@code true}
* @param {Boolean} [isParameter=false] pass {@code true} if {@code offset} * @param {Boolean} [isParameter=false] pass {@code true} if {@code offset}
* is a curve time parameter. * is a curve time parameter
* @return {Path} the newly created path after splitting, if any * @return {Path} the newly created path after splitting, if any
* @see Path#split(index, parameter) * @see Path#split(index, parameter)
*/ */
@ -825,9 +825,10 @@ statics: {
* the parameter is searched to the left of the start parameter. If no start * the parameter is searched to the left of the start parameter. If no start
* parameter is provided, a default of {@code 0} for positive values of * parameter is provided, a default of {@code 0} for positive values of
* {@code offset} and {@code 1} for negative values of {@code offset}. * {@code offset} and {@code 1} for negative values of {@code offset}.
*
* @param {Number} offset * @param {Number} offset
* @param {Number} [start] * @param {Number} [start]
* @return {Number} the curve time parameter at the specified offset. * @return {Number} the curve time parameter at the specified offset
*/ */
getParameterAt: function(offset, start) { getParameterAt: function(offset, start) {
return Curve.getParameterAt(this.getValues(), offset, start); return Curve.getParameterAt(this.getValues(), offset, start);
@ -836,8 +837,9 @@ statics: {
/** /**
* Returns the curve time parameter of the specified point if it lies on the * Returns the curve time parameter of the specified point if it lies on the
* curve, {@code null} otherwise. * curve, {@code null} otherwise.
* @param {Point} point the point on the curve. *
* @return {Number} the curve time parameter of the specified point. * @param {Point} point the point on the curve
* @return {Number} the curve time parameter of the specified point
*/ */
getParameterOf: function(/* point */) { getParameterOf: function(/* point */) {
var point = Point.read(arguments); var point = Point.read(arguments);
@ -847,11 +849,12 @@ statics: {
/** /**
* Calculates the curve location at the specified offset or curve time * Calculates the curve location at the specified offset or curve time
* parameter. * parameter.
*
* @param {Number} offset the offset on the curve, or the curve time * @param {Number} offset the offset on the curve, or the curve time
* parameter if {@code isParameter} is {@code true} * parameter if {@code isParameter} is {@code true}
* @param {Boolean} [isParameter=false] pass {@code true} if {@code offset} * @param {Boolean} [isParameter=false] pass {@code true} if {@code offset}
* is a curve time parameter. * is a curve time parameter
* @return {CurveLocation} the curve location at the specified the offset. * @return {CurveLocation} the curve location at the specified the offset
*/ */
getLocationAt: function(offset, isParameter) { getLocationAt: function(offset, isParameter) {
if (!isParameter) if (!isParameter)
@ -864,8 +867,9 @@ statics: {
/** /**
* Returns the curve location of the specified point if it lies on the * Returns the curve location of the specified point if it lies on the
* curve, {@code null} otherwise. * curve, {@code null} otherwise.
* @param {Point} point the point on the curve. *
* @return {CurveLocation} the curve location of the specified point. * @param {Point} point the point on the curve
* @return {CurveLocation} the curve location of the specified point
*/ */
getLocationOf: function(/* point */) { getLocationOf: function(/* point */) {
return this.getLocationAt(this.getParameterOf(Point.read(arguments)), return this.getLocationAt(this.getParameterOf(Point.read(arguments)),
@ -875,8 +879,9 @@ statics: {
/** /**
* Returns the length of the path from its beginning up to up to the * Returns the length of the path from its beginning up to up to the
* specified point if it lies on the path, {@code null} otherwise. * specified point if it lies on the path, {@code null} otherwise.
* @param {Point} point the point on the path. *
* @return {Number} the length of the path up to the specified point. * @param {Point} point the point on the path
* @return {Number} the length of the path up to the specified point
*/ */
getOffsetOf: function(/* point */) { getOffsetOf: function(/* point */) {
var loc = this.getLocationOf.apply(this, arguments); var loc = this.getLocationOf.apply(this, arguments);
@ -926,10 +931,10 @@ statics: {
* @name Curve#getPointAt * @name Curve#getPointAt
* @function * @function
* @param {Number} offset the offset on the curve, or the curve time * @param {Number} offset the offset on the curve, or the curve time
* parameter if {@code isParameter} is {@code true} * parameter if {@code isParameter} is {@code true}
* @param {Boolean} [isParameter=false] pass {@code true} if {@code offset} * @param {Boolean} [isParameter=false] pass {@code true} if {@code offset}
* is a curve time parameter. * is a curve time parameter
* @return {Point} the point on the curve at the specified offset. * @return {Point} the point on the curve at the specified offset
*/ */
/** /**
@ -938,10 +943,10 @@ statics: {
* @name Curve#getTangentAt * @name Curve#getTangentAt
* @function * @function
* @param {Number} offset the offset on the curve, or the curve time * @param {Number} offset the offset on the curve, or the curve time
* parameter if {@code isParameter} is {@code true} * parameter if {@code isParameter} is {@code true}
* @param {Boolean} [isParameter=false] pass {@code true} if {@code offset} * @param {Boolean} [isParameter=false] pass {@code true} if {@code offset}
* is a curve time parameter. * is a curve time parameter
* @return {Point} the tangent of the curve at the specified offset. * @return {Point} the tangent of the curve at the specified offset
*/ */
/** /**
@ -950,10 +955,10 @@ statics: {
* @name Curve#getNormalAt * @name Curve#getNormalAt
* @function * @function
* @param {Number} offset the offset on the curve, or the curve time * @param {Number} offset the offset on the curve, or the curve time
* parameter if {@code isParameter} is {@code true} * parameter if {@code isParameter} is {@code true}
* @param {Boolean} [isParameter=false] pass {@code true} if {@code offset} * @param {Boolean} [isParameter=false] pass {@code true} if {@code offset}
* is a curve time parameter. * is a curve time parameter
* @return {Point} the normal of the curve at the specified offset. * @return {Point} the normal of the curve at the specified offset
*/ */
/** /**
@ -965,10 +970,10 @@ statics: {
* @name Curve#getCurvatureAt * @name Curve#getCurvatureAt
* @function * @function
* @param {Number} offset the offset on the curve, or the curve time * @param {Number} offset the offset on the curve, or the curve time
* parameter if {@code isParameter} is {@code true} * parameter if {@code isParameter} is {@code true}
* @param {Boolean} [isParameter=false] pass {@code true} if {@code offset} * @param {Boolean} [isParameter=false] pass {@code true} if {@code offset}
* is a curve time parameter. * is a curve time parameter
* @return {Number} the curvature of the curve at the specified offset. * @return {Number} the curvature of the curve at the specified offset
*/ */
}), }),
new function() { // Scope for methods that require numerical integration new function() { // Scope for methods that require numerical integration

View file

@ -124,7 +124,7 @@ Path.inject({ statics: new function() {
* *
* @name Path.Rectangle * @name Path.Rectangle
* @param {Rectangle} rectangle the rectangle object describing the * @param {Rectangle} rectangle the rectangle object describing the
* geometry of the rectangular path to be created. * geometry of the rectangular path to be created
* @param {Size} [radius=null] the size of the rounded corners * @param {Size} [radius=null] the size of the rounded corners
* @return {Path} the newly created path * @return {Path} the newly created path
* *

View file

@ -75,9 +75,10 @@ var Path = PathItem.extend(/** @lends Path# */{
* Creates a new path item from SVG path-data and places it at the top of * Creates a new path item from SVG path-data and places it at the top of
* the active layer. * the active layer.
* *
* @param
* @name Path#initialize * @name Path#initialize
* @param {String} pathData the SVG path-data that describes the geometry * @param {String} pathData the SVG path-data that describes the geometry
* of this path. * of this path
* @return {Path} the newly created path * @return {Path} the newly created path
* *
* @example {@paperscript} * @example {@paperscript}
@ -488,7 +489,7 @@ var Path = PathItem.extend(/** @lends Path# */{
* *
* @param {Segment|Point} segment the segment or point to be added. * @param {Segment|Point} segment the segment or point to be added.
* @return {Segment} the added segment. This is not necessarily the same * @return {Segment} the added segment. This is not necessarily the same
* object, e.g. if the segment to be added already belongs to another path. * object, e.g. if the segment to be added already belongs to another path
* *
* @example {@paperscript} * @example {@paperscript}
* // Adding segments to a path using point objects: * // Adding segments to a path using point objects:
@ -560,10 +561,10 @@ var Path = PathItem.extend(/** @lends Path# */{
* Inserts one or more segments at a given index in the list of this path's * Inserts one or more segments at a given index in the list of this path's
* segments. * segments.
* *
* @param {Number} index the index at which to insert the segment. * @param {Number} index the index at which to insert the segment
* @param {Segment|Point} segment the segment or point to be inserted. * @param {Segment|Point} segment the segment or point to be inserted.
* @return {Segment} the added segment. This is not necessarily the same * @return {Segment} the added segment. This is not necessarily the same
* object, e.g. if the segment to be added already belongs to another path. * object, e.g. if the segment to be added already belongs to another path
* *
* @example {@paperscript} * @example {@paperscript}
* // Inserting a segment: * // Inserting a segment:
@ -615,7 +616,7 @@ var Path = PathItem.extend(/** @lends Path# */{
* @param {Segment[]} segments * @param {Segment[]} segments
* @return {Segment[]} an array of the added segments. These segments are * @return {Segment[]} an array of the added segments. These segments are
* not necessarily the same objects, e.g. if the segment to be added already * not necessarily the same objects, e.g. if the segment to be added already
* belongs to another path. * belongs to another path
* *
* @example {@paperscript} * @example {@paperscript}
* // Adding an array of Point objects: * // Adding an array of Point objects:
@ -658,11 +659,11 @@ var Path = PathItem.extend(/** @lends Path# */{
* Inserts an array of segments at a given index in the path's * Inserts an array of segments at a given index in the path's
* {@link #segments} array. * {@link #segments} array.
* *
* @param {Number} index the index at which to insert the segments. * @param {Number} index the index at which to insert the segments
* @param {Segment[]} segments the segments to be inserted. * @param {Segment[]} segments the segments to be inserted
* @return {Segment[]} an array of the added segments. These segments are * @return {Segment[]} an array of the added segments. These segments are
* not necessarily the same objects, e.g. if the segment to be added already * not necessarily the same objects, e.g. if the segment to be added already
* belongs to another path. * belongs to another path
*/ */
insertSegments: function(index, segments) { insertSegments: function(index, segments) {
return this._add(Segment.readAll(segments), index); return this._add(Segment.readAll(segments), index);
@ -1362,9 +1363,9 @@ var Path = PathItem.extend(/** @lends Path# */{
* *
* @param {Boolean} [insert=true] specifies whether the new shape should be * @param {Boolean} [insert=true] specifies whether the new shape should be
* inserted into the DOM. When set to {@code true}, it is inserted above the * inserted into the DOM. When set to {@code true}, it is inserted above the
* path item. * path item
* @return {Shape} the newly created shape item with the same geometry as * @return {Shape} the newly created shape item with the same geometry as
* this path item if it can be matched, {@code null} otherwise. * this path item if it can be matched, {@code null} otherwise
* @see Shape#toPath(insert) * @see Shape#toPath(insert)
*/ */
toShape: function(insert) { toShape: function(insert) {
@ -1640,8 +1641,9 @@ var Path = PathItem.extend(/** @lends Path# */{
* *
* Returns the curve location of the specified point if it lies on the * Returns the curve location of the specified point if it lies on the
* path, {@code null} otherwise. * path, {@code null} otherwise.
* @param {Point} point the point on the path. *
* @return {CurveLocation} the curve location of the specified point. * @param {Point} point the point on the path
* @return {CurveLocation} the curve location of the specified point
*/ */
getLocationOf: function(/* point */) { getLocationOf: function(/* point */) {
var point = Point.read(arguments), var point = Point.read(arguments),
@ -1657,8 +1659,9 @@ var Path = PathItem.extend(/** @lends Path# */{
/** /**
* Returns the length of the path from its beginning up to up to the * Returns the length of the path from its beginning up to up to the
* specified point if it lies on the path, {@code null} otherwise. * specified point if it lies on the path, {@code null} otherwise.
* @param {Point} point the point on the path. *
* @return {Number} the length of the path up to the specified point. * @param {Point} point the point on the path
* @return {Number} the length of the path up to the specified point
*/ */
getOffsetOf: function(/* point */) { getOffsetOf: function(/* point */) {
var loc = this.getLocationOf.apply(this, arguments); var loc = this.getLocationOf.apply(this, arguments);
@ -1669,7 +1672,7 @@ var Path = PathItem.extend(/** @lends Path# */{
* Returns the curve location of the specified offset on the path. * Returns the curve location of the specified offset on the path.
* *
* @param {Number} offset the offset on the path, where {@code 0} is at * @param {Number} offset the offset on the path, where {@code 0} is at
* the beginning of the path and {@link Path#length} at the end. * the beginning of the path and {@link Path#length} at the end
* @param {Boolean} [isParameter=false] * @param {Boolean} [isParameter=false]
* @return {CurveLocation} the curve location at the specified offset * @return {CurveLocation} the curve location at the specified offset
*/ */
@ -1704,7 +1707,7 @@ var Path = PathItem.extend(/** @lends Path# */{
* @name Path#getPointAt * @name Path#getPointAt
* @function * @function
* @param {Number} offset the offset on the path, where {@code 0} is at * @param {Number} offset the offset on the path, where {@code 0} is at
* the beginning of the path and {@link Path#length} at the end. * the beginning of the path and {@link Path#length} at the end
* @param {Boolean} [isParameter=false] * @param {Boolean} [isParameter=false]
* @return {Point} the point at the given offset * @return {Point} the point at the given offset
* *
@ -1767,7 +1770,7 @@ var Path = PathItem.extend(/** @lends Path# */{
* @name Path#getTangentAt * @name Path#getTangentAt
* @function * @function
* @param {Number} offset the offset on the path, where {@code 0} is at * @param {Number} offset the offset on the path, where {@code 0} is at
* the beginning of the path and {@link Path#length} at the end. * the beginning of the path and {@link Path#length} at the end
* @param {Boolean} [isParameter=false] * @param {Boolean} [isParameter=false]
* @return {Point} the tangent vector at the given offset * @return {Point} the tangent vector at the given offset
* *
@ -1838,7 +1841,7 @@ var Path = PathItem.extend(/** @lends Path# */{
* @name Path#getNormalAt * @name Path#getNormalAt
* @function * @function
* @param {Number} offset the offset on the path, where {@code 0} is at * @param {Number} offset the offset on the path, where {@code 0} is at
* the beginning of the path and {@link Path#length} at the end. * the beginning of the path and {@link Path#length} at the end
* @param {Boolean} [isParameter=false] * @param {Boolean} [isParameter=false]
* @return {Point} the normal vector at the given offset * @return {Point} the normal vector at the given offset
* *
@ -1912,7 +1915,7 @@ var Path = PathItem.extend(/** @lends Path# */{
* @name Path#getCurvatureAt * @name Path#getCurvatureAt
* @function * @function
* @param {Number} offset the offset on the path, where {@code 0} is at * @param {Number} offset the offset on the path, where {@code 0} is at
* the beginning of the path and {@link Path#length} at the end. * the beginning of the path and {@link Path#length} at the end
* @param {Boolean} [isParameter=false] * @param {Boolean} [isParameter=false]
* @return {Number} the normal vector at the given offset * @return {Number} the normal vector at the given offset
* *
@ -2181,8 +2184,8 @@ var Path = PathItem.extend(/** @lends Path# */{
* Solves a tri-diagonal system for one of coordinates (x or y) of first * Solves a tri-diagonal system for one of coordinates (x or y) of first
* bezier control points. * bezier control points.
* *
* @param rhs right hand side vector. * @param rhs right hand side vector
* @return Solution vector. * @return Solution vector
*/ */
function getFirstControlPoints(rhs) { function getFirstControlPoints(rhs) {
var n = rhs.length, var n = rhs.length,

View file

@ -185,6 +185,7 @@ PathItem.inject(new function() {
* Private method for splitting a PathItem at the given intersections. * Private method for splitting a PathItem at the given intersections.
* The routine works for both self intersections and intersections * The routine works for both self intersections and intersections
* between PathItems. * between PathItems.
*
* @param {CurveLocation[]} intersections Array of CurveLocation objects * @param {CurveLocation[]} intersections Array of CurveLocation objects
*/ */
function splitPath(intersections) { function splitPath(intersections) {
@ -486,7 +487,7 @@ PathItem.inject(new function() {
* part of a horizontal curve * part of a horizontal curve
* @param {Boolean} testContains whether we need to consider this point * @param {Boolean} testContains whether we need to consider this point
* as part of stationary points on the curve itself, used when checking * as part of stationary points on the curve itself, used when checking
* the winding about a point. * the winding about a point
* @return {Number} the winding number * @return {Number} the winding number
*/ */
_getWinding: function(point, horizontal, testContains) { _getWinding: function(point, horizontal, testContains) {

View file

@ -482,7 +482,7 @@ var PathItem = Item.extend(/** @lends PathItem# */{
* @function * @function
* @param {Point} to the point where the arc should end * @param {Point} to the point where the arc should end
* @param {Boolean} [clockwise=true] specifies whether the arc should be * @param {Boolean} [clockwise=true] specifies whether the arc should be
* drawn in clockwise direction. * drawn in clockwise direction
* *
* @example {@paperscript} * @example {@paperscript}
* var path = new Path(); * var path = new Path();
@ -530,7 +530,7 @@ var PathItem = Item.extend(/** @lends PathItem# */{
* @name PathItem#closePath * @name PathItem#closePath
* @function * @function
* @param {Boolean} join controls whether the method should attempt to merge * @param {Boolean} join controls whether the method should attempt to merge
* the first segment with the last if they lie in the same location. * the first segment with the last if they lie in the same location
* @see Path#closed * @see Path#closed
*/ */
@ -552,7 +552,7 @@ var PathItem = Item.extend(/** @lends PathItem# */{
* @name PathItem#lineBy * @name PathItem#lineBy
* @function * @function
* @param {Point} to the vector which is added to the position of the last * @param {Point} to the vector which is added to the position of the last
* segment of the path, to get to the position of the new segment. * segment of the path, to get to the position of the new segment
* *
* @example {@paperscript} * @example {@paperscript}
* var path = new Path(); * var path = new Path();

View file

@ -21,15 +21,15 @@ var PathIterator = Base.extend({
/** /**
* Creates a path iterator for the given path. * Creates a path iterator for the given path.
* *
* @param {Path} path the path to iterate over. * @param {Path} path the path to iterate over
* @param {Number} [maxRecursion=32] the maximum amount of recursion in * @param {Number} [maxRecursion=32] the maximum amount of recursion in
* curve subdivision when mapping offsets to curve parameters. * curve subdivision when mapping offsets to curve parameters
* @param {Number} [tolerance=0.25] the error tolerance at which the * @param {Number} [tolerance=0.25] the error tolerance at which the
* recursion is interrupted before the maximum number of iterations is * recursion is interrupted before the maximum number of iterations is
* reached. * reached
* @param {Matrix} [matrix] the matrix by which to transform the path's * @param {Matrix} [matrix] the matrix by which to transform the path's
* coordinates without modifying the actual path. * coordinates without modifying the actual path.
* @return {PathIterator} the newly created path iterator. * @return {PathIterator} the newly created path iterator
*/ */
initialize: function(path, maxRecursion, tolerance, matrix) { initialize: function(path, maxRecursion, tolerance, matrix) {
// Instead of relying on path.curves, we only use segments here and // Instead of relying on path.curves, we only use segments here and

View file

@ -32,11 +32,11 @@ var Segment = Base.extend(/** @lends Segment# */{
* @name Segment#initialize * @name Segment#initialize
* @param {Point} [point={x: 0, y: 0}] the anchor point of the segment * @param {Point} [point={x: 0, y: 0}] the anchor point of the segment
* @param {Point} [handleIn={x: 0, y: 0}] the handle point relative to the * @param {Point} [handleIn={x: 0, y: 0}] the handle point relative to the
* anchor point of the segment that describes the in tangent of the * anchor point of the segment that describes the in tangent of the
* segment. * segment
* @param {Point} [handleOut={x: 0, y: 0}] the handle point relative to the * @param {Point} [handleOut={x: 0, y: 0}] the handle point relative to the
* anchor point of the segment that describes the out tangent of the * anchor point of the segment that describes the out tangent of the
* segment. * segment
* *
* @example {@paperscript} * @example {@paperscript}
* var handleIn = new Point(-80, -100); * var handleIn = new Point(-80, -100);
@ -56,7 +56,7 @@ var Segment = Base.extend(/** @lends Segment# */{
* *
* @name Segment#initialize * @name Segment#initialize
* @param {Object} object an object literal containing properties to * @param {Object} object an object literal containing properties to
* be set on the segment. * be set on the segment
* *
* @example {@paperscript} * @example {@paperscript}
* // Creating segments using object notation: * // Creating segments using object notation:
@ -80,18 +80,18 @@ var Segment = Base.extend(/** @lends Segment# */{
* *
* @param {Number} x the x coordinate of the segment point * @param {Number} x the x coordinate of the segment point
* @param {Number} y the y coordinate of the segment point * @param {Number} y the y coordinate of the segment point
* @param {Number} inX the x coordinate of the the handle point relative * @param {Number} inX the x coordinate of the the handle point relative to
* to the anchor point of the segment that describes the in tangent * the anchor point of the segment that describes the in tangent of the
* of the segment. * segment
* @param {Number} inY the y coordinate of the the handle point relative * @param {Number} inY the y coordinate of the the handle point relative to
* to the anchor point of the segment that describes the in tangent * the anchor point of the segment that describes the in tangent of the
* of the segment. * segment
* @param {Number} outX the x coordinate of the the handle point relative * @param {Number} outX the x coordinate of the the handle point relative to
* to the anchor point of the segment that describes the out tangent * the anchor point of the segment that describes the out tangent of the
* of the segment. * segment
* @param {Number} outY the y coordinate of the the handle point relative * @param {Number} outY the y coordinate of the the handle point relative to
* to the anchor point of the segment that describes the out tangent * the anchor point of the segment that describes the out tangent of the
* of the segment. * segment
* *
* @example {@paperscript} * @example {@paperscript}
* var inX = -80; * var inX = -80;

View file

@ -303,30 +303,29 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{
* The options object allows you to control the specifics of the hit-test * The options object allows you to control the specifics of the hit-test
* and may contain a combination of the following values: * and may contain a combination of the following values:
* *
* @option options.tolerance {Number} the tolerance of the hit-test in * @option [options.tolerance={@link PaperScope#settings}.hitTolerance]
* points. Can also be controlled through * {Number} the tolerance of the hit-test in points
* {@link PaperScope#settings}{@code .hitTolerance}.
* @option options.class {Function} only hit-test again a certain item class * @option options.class {Function} only hit-test again a certain item class
* and its sub-classes: {@code Group, Layer, Path, CompoundPath, * and its sub-classes: {@code Group, Layer, Path, CompoundPath,
* Shape, Raster, PlacedSymbol, PointText}, etc. * Shape, Raster, PlacedSymbol, PointText}, etc
* @option options.fill {Boolean} hit-test the fill of items. * @option options.fill {Boolean} hit-test the fill of items
* @option options.stroke {Boolean} hit-test the stroke of path items, * @option options.stroke {Boolean} hit-test the stroke of path items,
* taking into account the setting of stroke color and width. * taking into account the setting of stroke color and width
* @option options.segments {Boolean} hit-test for {@link Segment#point} of * @option options.segments {Boolean} hit-test for {@link Segment#point} of
* {@link Path} items. * {@link Path} items
* @option options.curves {Boolean} hit-test the curves of path items, * @option options.curves {Boolean} hit-test the curves of path items,
* without taking the stroke color or width into account. * without taking the stroke color or width into account
* @option options.handles {Boolean} hit-test for the handles. * @option options.handles {Boolean} hit-test for the handles
* ({@link Segment#handleIn} / {@link Segment#handleOut}) of path segments. * ({@link Segment#handleIn} / {@link Segment#handleOut}) of path segments.
* @option options.ends {Boolean} only hit-test for the first or last * @option options.ends {Boolean} only hit-test for the first or last
* segment points of open path items. * segment points of open path items
* @option options.bounds {Boolean} hit-test the corners and side-centers of * @option options.bounds {Boolean} hit-test the corners and side-centers of
* the bounding rectangle of items ({@link Item#bounds}). * the bounding rectangle of items ({@link Item#bounds})
* @option options.center {Boolean} hit-test the {@link Rectangle#center} of * @option options.center {Boolean} hit-test the {@link Rectangle#center} of
* the bounding rectangle of items ({@link Item#bounds}). * the bounding rectangle of items ({@link Item#bounds})
* @option options.guides {Boolean} hit-test items that have * @option options.guides {Boolean} hit-test items that have
* {@link Item#guide} set to {@code true}. * {@link Item#guide} set to {@code true}
* @option options.selected {Boolean} only hit selected items. * @option options.selected {Boolean} only hit selected items
* *
* @param {Point} point the point where the hit-test should be performed * @param {Point} point the point where the hit-test should be performed
* @param {Object} [options={ fill: true, stroke: true, segments: true, * @param {Object} [options={ fill: true, stroke: true, segments: true,
@ -364,9 +363,9 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{
* contained. * contained.
* *
* @option match.inside {Rectangle} the rectangle in which the items need to * @option match.inside {Rectangle} the rectangle in which the items need to
* be fully contained. * be fully contained
* @option match.overlapping {Rectangle} the rectangle with which the items * @option match.overlapping {Rectangle} the rectangle with which the items
* need to at least partly overlap. * need to at least partly overlap
* *
* @example {@paperscript} // Fetch all selected path items: * @example {@paperscript} // Fetch all selected path items:
* var path1 = new Path.Circle({ * var path1 = new Path.Circle({
@ -573,8 +572,8 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{
* *
* @see Item#matches(match) * @see Item#matches(match)
* @see Item#getItems(match) * @see Item#getItems(match)
* @param {Object} match the criteria to match against. * @param {Object} match the criteria to match against
* @return {Item[]} the list of matching items contained in the project. * @return {Item[]} the list of matching items contained in the project
*/ */
getItems: function(match) { getItems: function(match) {
return Item._getItems(this.layers, match); return Item._getItems(this.layers, match);
@ -590,8 +589,8 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{
* does work for {@link Item#data}. * does work for {@link Item#data}.
* See {@link #getItems(match)} for a selection of illustrated examples. * See {@link #getItems(match)} for a selection of illustrated examples.
* *
* @param {Object} match the criteria to match against. * @param {Object} match the criteria to match against
* @return {Item} the first item in the project matching the given criteria. * @return {Item} the first item in the project matching the given criteria
*/ */
getItem: function(match) { getItem: function(match) {
return Item._getItems(this.layers, match, null, null, true)[0] || null; return Item._getItems(this.layers, match, null, null, true)[0] || null;
@ -601,18 +600,17 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{
* {@grouptitle Importing / Exporting JSON and SVG} * {@grouptitle Importing / Exporting JSON and SVG}
* *
* Exports (serializes) the project with all its layers and child items to * Exports (serializes) the project with all its layers and child items to
* a JSON data string. * a JSON data object or string.
* *
* @name Project#exportJSON * @name Project#exportJSON
* @function * @function
* *
* @option options.asString {Boolean} whether the JSON is returned as a * @option [options.asString=true] {Boolean} whether the JSON is returned as
* {@code Object} or a {@code String}. * a {@code Object} or a {@code String}
* @option options.precision {Number} the amount of fractional digits in * @option [options.precision=5] {Number} the amount of fractional digits in
* numbers used in JSON data. * numbers used in JSON data
* *
* @param {Object} [options={ asString: true, precision: 5 }] the * @param {Object} [options] the serialization options
* serialization options
* @return {String} the exported JSON data * @return {String} the exported JSON data
*/ */
@ -621,7 +619,7 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{
* Note that the project is not cleared first. You can call * Note that the project is not cleared first. You can call
* {@link Project#clear()} to do so. * {@link Project#clear()} to do so.
* *
* @param {String} json the JSON data to import from. * @param {String} json the JSON data to import from
*/ */
importJSON: function(json) { importJSON: function(json) {
this.activate(); this.activate();
@ -638,15 +636,15 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{
* @name Project#exportSVG * @name Project#exportSVG
* @function * @function
* *
* @option options.asString {Boolean} whether a SVG node or a {@code String} * @option [options.asString=false] {Boolean} whether a SVG node or a
* is to be returned. * {@code String} is to be returned
* @option options.precision {Number} the amount of fractional digits in * @option [options.precision=5] {Number} the amount of fractional digits in
* numbers used in SVG data. * numbers used in SVG data
* @option options.matchShapes {Boolean} whether path items should tried to * @option [options.matchShapes=false] {Boolean} whether path items should
* be converted to shape items, if their geometries can be made to match. * tried to be converted to shape items, if their geometries can be made to
* match
* *
* @param {Object} [options={ asString: false, precision: 5, * @param {Object} [options] the export options
* matchShapes: false }] the export options.
* @return {SVGElement} the project converted to an SVG node * @return {SVGElement} the project converted to an SVG node
*/ */
@ -660,11 +658,14 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{
* @name Project#importSVG * @name Project#importSVG
* @function * @function
* *
* @option options.expandShapes {Boolean} whether imported shape items * @option [options.expandShapes=false] {Boolean} whether imported shape
* should be expanded to path items. * items should be expanded to path items
* @option [options.applyMatrix={@link PaperScope#settings}.applyMatrix]
* {Boolean} whether imported items should have
* their transformation matrices applied to their contents or not
* *
* @param {SVGElement|String} svg the SVG content to import * @param {SVGElement|String} svg the SVG content to import
* @param {Object} [options={ expandShapes: false }] the import options * @param {Object} [options] the import options
* @return {Item} the imported Paper.js parent item * @return {Item} the imported Paper.js parent item
*/ */

View file

@ -26,7 +26,7 @@ var Symbol = Base.extend(/** @lends Symbol# */{
* Creates a Symbol item. * Creates a Symbol item.
* *
* @param {Item} item the source item which is copied as the definition of * @param {Item} item the source item which is copied as the definition of
* the symbol * the symbol
* @param {Boolean} [dontCenter=false] * @param {Boolean} [dontCenter=false]
* *
* @example {@paperscript split=true height=240} * @example {@paperscript split=true height=240}
@ -90,7 +90,7 @@ var Symbol = Base.extend(/** @lends Symbol# */{
* Private notifier that is called whenever a change occurs in this symbol's * Private notifier that is called whenever a change occurs in this symbol's
* definition. * definition.
* *
* @param {ChangeFlag} flags describes what exactly has changed. * @param {ChangeFlag} flags describes what exactly has changed
*/ */
_changed: function(flags) { _changed: function(flags) {
if (flags & /*#=*/ChangeFlag.GEOMETRY) { if (flags & /*#=*/ChangeFlag.GEOMETRY) {
@ -133,7 +133,7 @@ var Symbol = Base.extend(/** @lends Symbol# */{
/** /**
* Places in instance of the symbol in the project. * Places in instance of the symbol in the project.
* *
* @param [position] The position of the placed symbol. * @param [position] The position of the placed symbol
* @return {PlacedSymbol} * @return {PlacedSymbol}
*/ */
place: function(position) { place: function(position) {

View file

@ -366,7 +366,7 @@ var Color = Base.extend(new function() {
* *
* @name Color#initialize * @name Color#initialize
* @param {Object} object an object describing the components and * @param {Object} object an object describing the components and
* properties of the color. * properties of the color
* *
* @example {@paperscript} * @example {@paperscript}
* // Creating a HSB Color: * // Creating a HSB Color:
@ -797,7 +797,7 @@ var Color = Base.extend(new function() {
* *
* @param {Boolean} hex whether to return the color in hexadecial * @param {Boolean} hex whether to return the color in hexadecial
* representation or as a CSS RGB / RGBA string. * representation or as a CSS RGB / RGBA string.
* @return {String} a CSS string representation of the color. * @return {String} a CSS string representation of the color
*/ */
toCSS: function(hex) { toCSS: function(hex) {
// TODO: Support HSL / HSLA CSS3 colors directly, without conversion // TODO: Support HSL / HSLA CSS3 colors directly, without conversion
@ -1186,7 +1186,7 @@ var Color = Base.extend(new function() {
* @operator * @operator
* @param {Number} number the number to subtract * @param {Number} number the number to subtract
* @return {Color} the subtraction of the color and the value as a new * @return {Color} the subtraction of the color and the value as a new
* color * color
* *
* @example * @example
* var color = new Color(0.5, 1, 1); * var color = new Color(0.5, 1, 1);
@ -1220,7 +1220,7 @@ var Color = Base.extend(new function() {
* @operator * @operator
* @param {Number} number the number to multiply * @param {Number} number the number to multiply
* @return {Color} the multiplication of the color and the value as a * @return {Color} the multiplication of the color and the value as a
* new color * new color
* *
* @example * @example
* var color = new Color(0.5, 1, 1); * var color = new Color(0.5, 1, 1);
@ -1254,7 +1254,7 @@ var Color = Base.extend(new function() {
* @operator * @operator
* @param {Number} number the number to divide * @param {Number} number the number to divide
* @return {Color} the division of the color and the value as a new * @return {Color} the division of the color and the value as a new
* color * color
* *
* @example * @example
* var color = new Color(0.5, 1, 1); * var color = new Color(0.5, 1, 1);

View file

@ -24,7 +24,7 @@ var GradientStop = Base.extend(/** @lends GradientStop# */{
* *
* @param {Color} [color=new Color(0, 0, 0)] the color of the stop * @param {Color} [color=new Color(0, 0, 0)] the color of the stop
* @param {Number} [rampPoint=0] the position of the stop on the gradient * @param {Number} [rampPoint=0] the position of the stop on the gradient
* ramp as a value between 0 and 1. * ramp as a value between 0 and 1
*/ */
initialize: function GradientStop(arg0, arg1) { initialize: function GradientStop(arg0, arg1) {
if (arg0) { if (arg0) {

View file

@ -509,8 +509,8 @@ new function() {
* Converts various SVG styles and attributes into Paper.js styles and * Converts various SVG styles and attributes into Paper.js styles and
* attributes and applies them to the passed item. * attributes and applies them to the passed item.
* *
* @param {SVGElement} node an SVG node to read style and attributes from. * @param {SVGElement} node an SVG node to read style and attributes from
* @param {Item} item the item to apply the style and attributes to. * @param {Item} item the item to apply the style and attributes to
*/ */
function applyAttributes(item, node, isRoot) { function applyAttributes(item, node, isRoot) {
// SVG attributes can be set both as styles and direct node attributes, // SVG attributes can be set both as styles and direct node attributes,

View file

@ -17,7 +17,7 @@
*/ */
var Formatter = Base.extend(/** @lends Formatter# */{ var Formatter = Base.extend(/** @lends Formatter# */{
/** /**
* @param {Number} [precision=5] the amount of fractional digits. * @param {Number} [precision=5] the amount of fractional digits
*/ */
initialize: function(precision) { initialize: function(precision) {
this.precision = precision || 5; this.precision = precision || 5;

View file

@ -161,12 +161,12 @@ var Numerical = new function() {
* http://www.cs.berkeley.edu/~wkahan/Math128/Cubic.pdf * http://www.cs.berkeley.edu/~wkahan/Math128/Cubic.pdf
* Blinn J. - "How to solve a Quadratic Equation" * Blinn J. - "How to solve a Quadratic Equation"
* *
* @param {Number} a The quadratic term. * @param {Number} a The quadratic term
* @param {Number} b The linear term. * @param {Number} b The linear term
* @param {Number} c The constant term. * @param {Number} c The constant term
* @param {Number[]} roots The array to store the roots in. * @param {Number[]} roots The array to store the roots in
* @return {Number} The number of real roots found, or -1 if there are * @return {Number} The number of real roots found, or -1 if there are
* infinite solutions. * infinite solutions
* *
* @author Harikrishnan Gopalakrishnan * @author Harikrishnan Gopalakrishnan
*/ */
@ -254,10 +254,10 @@ var Numerical = new function() {
* @param {Number} a The cubic term ( term). * @param {Number} a The cubic term ( term).
* @param {Number} b The quadratic term ( term). * @param {Number} b The quadratic term ( term).
* @param {Number} c The linear term (x term). * @param {Number} c The linear term (x term).
* @param {Number} d The constant term. * @param {Number} d The constant term
* @param {Number[]} roots The array to store the roots in. * @param {Number[]} roots The array to store the roots in
* @return {Number} The number of real roots found, or -1 if there are * @return {Number} The number of real roots found, or -1 if there are
* infinite solutions. * infinite solutions
* *
* @author Harikrishnan Gopalakrishnan * @author Harikrishnan Gopalakrishnan
*/ */

View file

@ -267,7 +267,7 @@ var View = Base.extend(Emitter, /** @lends View# */{
* Private notifier that is called whenever a change occurs in this view. * Private notifier that is called whenever a change occurs in this view.
* Used only by Matrix for now. * Used only by Matrix for now.
* *
* @param {ChangeFlag} flags describes what exactly has changed. * @param {ChangeFlag} flags describes what exactly has changed
*/ */
_changed: function(flags) { _changed: function(flags) {
if (flags & /*#=*/ChangeFlag.APPEARANCE) if (flags & /*#=*/ChangeFlag.APPEARANCE)
@ -413,7 +413,7 @@ var View = Base.extend(Emitter, /** @lends View# */{
* Checks whether the view is currently visible within the current browser * Checks whether the view is currently visible within the current browser
* viewport. * viewport.
* *
* @return {Boolean} whether the view is visible. * @return {Boolean} whether the view is visible
*/ */
isVisible: function() { isVisible: function() {
return DomElement.isInView(this._element); return DomElement.isInView(this._element);
@ -504,11 +504,11 @@ var View = Base.extend(Emitter, /** @lends View# */{
* the frame event: * the frame event:
* *
* @option event.count {Number} the number of times the frame event was * @option event.count {Number} the number of times the frame event was
* fired. * fired
* @option event.time {Number} the total amount of time passed since the * @option event.time {Number} the total amount of time passed since the
* first frame event in seconds. * first frame event in seconds
* @code event.delta {Number} the time passed in seconds since the last * @option event.delta {Number} the time passed in seconds since the last
* frame event. * frame event
* *
* @example {@paperscript} * @example {@paperscript}
* // Creating an animation: * // Creating an animation:
@ -578,7 +578,7 @@ var View = Base.extend(Emitter, /** @lends View# */{
* @name View#on * @name View#on
* @function * @function
* @param {Object} param an object literal containing one or more of the * @param {Object} param an object literal containing one or more of the
* following properties: {@code frame, resize}. * following properties: {@code frame, resize}
* @return {View} this view itself, so calls can be chained * @return {View} this view itself, so calls can be chained
* *
* @example {@paperscript} * @example {@paperscript}
@ -644,7 +644,7 @@ var View = Base.extend(Emitter, /** @lends View# */{
* @function * @function
* @param {String('frame', 'resize')} type the event type * @param {String('frame', 'resize')} type the event type
* @param {Object} event an object literal containing properties describing * @param {Object} event an object literal containing properties describing
* the event. * the event
* @return {Boolean} {@true if the event had listeners} * @return {Boolean} {@true if the event had listeners}
*/ */