Update JSDoc and do some documentation spring-cleaning.

- Convert from {@code ...} to shorter `...`
- Reformat some documentation comment blocks
- Update copyright notices
This commit is contained in:
Jürg Lehni 2015-12-27 18:09:25 +01:00
parent 7d25096de6
commit a7a07fb6d5
117 changed files with 554 additions and 575 deletions

View file

@ -1,4 +1,4 @@
Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
http://scratchdisk.com/ & http://jonathanpuckey.com/
All rights reserved.

View file

@ -3,7 +3,7 @@
# Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
# http://paperjs.org/
#
# Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
# Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
# http://scratchdisk.com/ & http://jonathanpuckey.com/
#
# Distributed under the MIT license. See LICENSE file for details.

View file

@ -3,7 +3,7 @@
# Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
# http://paperjs.org/
#
# Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
# Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
# http://scratchdisk.com/ & http://jonathanpuckey.com/
#
# Distributed under the MIT license. See LICENSE file for details.

View file

@ -3,7 +3,7 @@
# Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
# http://paperjs.org/
#
# Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
# Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
# http://scratchdisk.com/ & http://jonathanpuckey.com/
#
# Distributed under the MIT license. See LICENSE file for details.

@ -1 +1 @@
Subproject commit 91a4e45aa3ac4f25c106fec0ed1d5d8f9bb5fba7
Subproject commit f8b459c7fb52f7f98e3803351990b832d11721dd

View file

@ -3,7 +3,7 @@
# Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
# http://paperjs.org/
#
# Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
# Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
# http://scratchdisk.com/ & http://jonathanpuckey.com/
#
# Distributed under the MIT license. See LICENSE file for details.

View file

@ -3,7 +3,7 @@
# Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
# http://paperjs.org/
#
# Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
# Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
# http://scratchdisk.com/ & http://jonathanpuckey.com/
#
# Distributed under the MIT license. See LICENSE file for details.

View file

@ -3,7 +3,7 @@
# Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
# http://paperjs.org/
#
# Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
# Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
# http://scratchdisk.com/ & http://jonathanpuckey.com/
#
# Distributed under the MIT license. See LICENSE file for details.

View file

@ -3,7 +3,7 @@
# Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
# http://paperjs.org/
#
# Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
# Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
# http://scratchdisk.com/ & http://jonathanpuckey.com/
#
# Distributed under the MIT license. See LICENSE file for details.

View file

@ -3,7 +3,7 @@
# Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
# http://paperjs.org/
#
# Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
# Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
# http://scratchdisk.com/ & http://jonathanpuckey.com/
#
# Distributed under the MIT license. See LICENSE file for details.

View file

@ -3,7 +3,7 @@
# Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
# http://paperjs.org/
#
# Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
# Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
# http://scratchdisk.com/ & http://jonathanpuckey.com/
#
# Distributed under the MIT license. See LICENSE file for details.

View file

@ -3,7 +3,7 @@
# Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
# http://paperjs.org/
#
# Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
# Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
# http://scratchdisk.com/ & http://jonathanpuckey.com/
#
# Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
@ -80,8 +80,8 @@ var Line = Base.extend(/** @lends Line# */{
/**
* @param {Line} line
* @param {Boolean} [isInfinite=false]
* @return {Point} the intersection point of the lines, {@code undefined}
* if the two lines are collinear, or {@code null} if they don't intersect.
* @return {Point} the intersection point of the lines, `undefined` if the
* two lines are collinear, or `null` if they don't intersect.
*/
intersect: function(line, isInfinite) {
return Line.intersect(

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
@ -591,11 +591,11 @@ var Matrix = Base.extend(/** @lends Matrix# */{
/**
* Attempts to decompose the affine transformation described by this matrix
* into {@code scaling}, {@code rotation} and {@code shearing}, and returns
* an object with these properties if it succeeded, {@code null} otherwise.
* into `scaling`, `rotation` and `shearing`, and returns an object with
* these properties if it succeeded, `null` otherwise.
*
* @return {Object} the decomposed matrix, or {@code null} if decomposition
* is not possible
* @return {Object} the decomposed matrix, or `null` if decomposition is not
* possible
*/
decompose: function() {
// http://dev.w3.org/csswg/css3-2d-transforms/#matrix-decomposition
@ -730,11 +730,11 @@ var Matrix = Base.extend(/** @lends Matrix# */{
/**
* Creates the inversion of the transformation of the matrix and returns it
* as a new insteance. If the matrix is not invertible (in which case
* {@link #isSingular()} returns true), {@code null } is returned.
* as a new insteance. If the matrix is not invertible (in which case {@link
* #isSingular()} returns true), `null` is returned.
*
* @return {Matrix} the inverted matrix, or {@code null }, if the matrix is
* singular
* @return {Matrix} the inverted matrix, or `null`, if the matrix is
* singular
*/
inverted: function() {
var det = this._getDeterminant();

View file

@ -3,7 +3,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
@ -241,9 +241,9 @@ var Point = Base.extend(/** @lends Point# */{
/**
* The length of the vector that is represented by this point's coordinates.
* Each point can be interpreted as a vector that points from the origin
* ({@code x = 0}, {@code y = 0}) to the point's location.
* Setting the length changes the location but keeps the vector's angle.
* Each point can be interpreted as a vector that points from the origin (`x
* = 0`, `y = 0`) to the point's location. Setting the length changes the
* location but keeps the vector's angle.
*
* @type Number
* @bean
@ -357,10 +357,10 @@ var Point = Base.extend(/** @lends Point# */{
/**
* The quadrant of the {@link #angle} of the point.
*
* Angles between 0 and 90 degrees are in quadrant {@code 1}. Angles between
* 90 and 180 degrees are in quadrant {@code 2}, angles between 180 and 270
* degrees are in quadrant {@code 3} and angles between 270 and 360 degrees
* are in quadrant {@code 4}.
* Angles between 0 and 90 degrees are in quadrant `1`. Angles between 90
* and 180 degrees are in quadrant `2`, angles between 180 and 270 degrees
* are in quadrant `3` and angles between 270 and 360 degrees are in
* quadrant `4`.
*
* @type Number
* @bean
@ -423,14 +423,14 @@ var Point = Base.extend(/** @lends Point# */{
},
/**
* Normalize modifies the {@link #length} of the vector to {@code 1} without
* changing its angle and returns it as a new point. The optional
* {@code length} parameter defines the length to normalize to.
* The object itself is not modified!
* Normalize modifies the {@link #length} of the vector to `1` without
* changing its angle and returns it as a new point. The optional `length`
* parameter defines the length to normalize to. The object itself is not
* modified!
*
* @param {Number} [length=1] The length of the normalized vector
* @return {Point} the normalized vector of the vector that is represented
* by this point's coordinates
* by this point's coordinates
*/
normalize: function(length) {
if (length === undefined)
@ -901,7 +901,7 @@ var Point = Base.extend(/** @lends Point# */{
/**
* Returns a point object with random {@link #x} and {@link #y} values
* between {@code 0} and {@code 1}.
* between `0` and `1`.
*
* @return {Point} the newly created point object
* @static

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
@ -721,16 +721,16 @@ var Rectangle = Base.extend(/** @lends Rectangle# */{
},
/**
* Adds a point to this rectangle. The resulting rectangle is the
* smallest rectangle that contains both the original rectangle and the
* specified point.
* Adds a point to this rectangle. The resulting rectangle is the smallest
* rectangle that contains both the original rectangle and the specified
* point.
*
* After adding a point, a call to {@link #contains(point)} with the added
* point as an argument does not necessarily return {@code true}.
* The {@link Rectangle#contains(point)} method does not return {@code true}
* for points on the right or bottom edges of a rectangle. Therefore, if the
* added point falls on the left or bottom edge of the enlarged rectangle,
* {@link Rectangle#contains(point)} returns {@code false} for that point.
* point as an argument does not necessarily return `true`. The {@link
* Rectangle#contains(point)} method does not return `true` for points on
* the right or bottom edges of a rectangle. Therefore, if the added point
* falls on the left or bottom edge of the enlarged rectangle, {@link
* Rectangle#contains(point)} returns `false` for that point.
*
* @param {Point} point
*/
@ -779,9 +779,9 @@ var Rectangle = Base.extend(/** @lends Rectangle# */{
* @param {Number} amount
*/
/**
* Scales the rectangle in horizontal direction by the specified
* {@code hor} amount and in vertical direction by the specified {@code ver}
* amount from its center.
* Scales the rectangle in horizontal direction by the specified `hor`
* amount and in vertical direction by the specified `ver` amount from its
* center.
*
* @name Rectangle#scale
* @function

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
@ -496,7 +496,7 @@ var Size = Base.extend(/** @lends Size# */{
/**
* Returns a size object with random {@link #width} and {@link #height}
* values between {@code 0} and {@code 1}.
* values between `0` and `1`.
*
* @return {Size} the newly created size object
* @static

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
@ -50,9 +50,9 @@ Base.inject(/** @lends Base# */{
* Exports (serializes) this object to a JSON data object or string.
*
* @option [options.asString=true] {Boolean} whether the JSON is returned as
* a {@code Object} or a {@code String}
* a `Object` or a `String`
* @option [options.precision=5] {Number} the amount of fractional digits in
* numbers used in JSON data
* numbers used in JSON data
*
* @param {Object} [options] the serialization options
* @return {String} the exported JSON data
@ -169,13 +169,13 @@ Base.inject(/** @lends Base# */{
* Size, Rectangle) and also higher classes such as Color and Segment.
*
* @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} length the amount of elements that can be read
* @param {Object} options {@code options.readNull} controls whether
* null is returned or converted. {@code options.clone} controls whether
* passed objects should be cloned if they are already provided in the
* required type
* @param {Object} options `options.readNull` controls whether null is
* returned or converted. `options.clone` controls whether passed
* objects should be cloned if they are already provided in the
* required type
*/
read: function(list, start, options, length) {
// See if it's called directly on Base, and if so, read value and
@ -234,12 +234,12 @@ Base.inject(/** @lends Base# */{
* separately.
*
* @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 {Object} options {@code options.readNull} controls whether
* null is returned or converted. {@code options.clone} controls whether
* passed objects should be cloned if they are already provided in the
* required type
* @param {Object} options `options.readNull` controls whether null is
* returned or converted. `options.clone` controls whether passed
* objects should be cloned if they are already provided in the
* required type
*/
readAll: function(list, start, options) {
var res = [],
@ -286,9 +286,9 @@ Base.inject(/** @lends Base# */{
/**
* @return the named value if the list provides an arguments object,
* {@code null} if the named value is {@code null} or {@code undefined},
* and {@code undefined} if there is no arguments object
* If no name is provided, it returns the whole arguments object
* `null` if the named value is `null` or `undefined`, and
* `undefined` if there is no arguments object If no name is
* provided, it returns the whole arguments object
*/
getNamed: function(list, name) {
var arg = list[0];
@ -301,8 +301,8 @@ Base.inject(/** @lends Base# */{
/**
* Checks if the argument list has a named argument with the given name.
* If name is {@code null}, it returns {@code true} if there are any
* named arguments.
* If name is `null`, it returns `true` if there are any named
* arguments.
*/
hasNamed: function(list, name) {
return !!this.getNamed(list, name);

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
@ -13,24 +13,24 @@
/**
* @name PaperScope
*
* @class The {@code PaperScope} class represents the scope associated with a
* Paper context. When working with PaperScript, these scopes are automatically
* created for us, and through clever scoping the properties and methods of the
* active scope seem to become part of the global scope.
* @class The `PaperScope` class represents the scope associated with a Paper
* context. When working with PaperScript, these scopes are automatically
* created for us, and through clever scoping the properties and methods of
* the active scope seem to become part of the global scope.
*
* When working with normal JavaScript code, {@code PaperScope} objects need to
* be manually created and handled.
* When working with normal JavaScript code, `PaperScope` objects need to be
* manually created and handled.
*
* Paper classes can only be accessed through {@code PaperScope} objects. Thus
* in PaperScript they are global, while in JavaScript, they are available on
* the global {@link paper} object. For JavaScript you can use
* {@link PaperScope#install(scope) } to install the Paper classes and objects
* on the global scope. Note that when working with more than one scope, this
* still works for classes, but not for objects like {@link PaperScope#project},
* since they are not updated in the injected scope if scopes are switched.
* Paper classes can only be accessed through `PaperScope` objects. Thus in
* PaperScript they are global, while in JavaScript, they are available on the
* global {@link paper} object. For JavaScript you can use {@link
* PaperScope#install(scope) } to install the Paper classes and objects on the
* global scope. Note that when working with more than one scope, this still
* works for classes, but not for objects like {@link PaperScope#project}, since
* they are not updated in the injected scope if scopes are switched.
*
* The global {@link paper} object is simply a reference to the currently active
* {@code PaperScope}.
* `PaperScope`.
*/
var PaperScope = Base.extend(/** @lends PaperScope# */{
_class: 'PaperScope',

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
@ -498,21 +498,21 @@ Base.exports.PaperScript = (function() {
}
/**
* Loads, compiles and executes PaperScript code in the HTML document.
* Note that this method is executed automatically for all scripts in the
* Loads, compiles and executes PaperScript code in the HTML document. Note
* that this method is executed automatically for all scripts in the
* document through a window load event. You can optionally call it earlier
* (e.g. from a DOM ready event), or you can mark scripts to be ignored by
* setting the attribute {@code ignore="true"} or
* {@code data-paper-ignore="true"}, and call the
* {@code PaperScript.load(script)} method for each script separately when
* needed.
* setting the attribute `ignore="true"` or `data-paper-ignore="true"`, and
* call the `PaperScript.load(script)` method for each script separately
* when needed.
*
* @name PaperScript.load
* @function
* @param {HTMLScriptElement} [script=null] the script to load. If none is
* provided, all scripts of the HTML document are iterated over and loaded
* @return {PaperScope} the scope produced for the passed {@code script}, or
* {@code undefined} of multiple scripts area loaded
* provided, all scripts of the HTML document are iterated over and
* loaded
* @return {PaperScope} the scope produced for the passed `script`, or
* `undefined` of multiple scripts area loaded
*/
function load(script) {
return script ? loadScript(script) : loadAll();

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
@ -190,21 +190,21 @@ var Key = new function() {
* @type Object
*
* @option modifiers.shift {Boolean} {@true if the shift key is
* pressed}.
* pressed}.
* @option modifiers.control {Boolean} {@true if the control key is
* pressed}.
* pressed}.
* @option modifiers.alt {Boolean} {@true if the alt/option key is
* pressed}.
* pressed}.
* @option modifiers.meta {Boolean} {@true if the meta/windows/command
* key is pressed}.
* @option modifiers.capsLock {Boolean} {@true if the caps-lock
* key is active}.
* key is pressed}.
* @option modifiers.capsLock {Boolean} {@true if the caps-lock key is
* active}.
* @option modifiers.space {Boolean} {@true if the space key is
* pressed}.
* pressed}.
* @option modifiers.option {Boolean} {@true if the alt/option key is
* pressed}. This is the same as {@code modifiers.alt}
* @option modifiers.command {Boolean} {@true if the meta key is
* pressed on Mac, or the control key is pressed on Windows and Linux}.
* pressed}. This is the same as `modifiers.alt`
* @option modifiers.command {Boolean} {@true if the meta key is pressed
* on Mac, or the control key is pressed on Windows and Linux}.
*/
modifiers: modifiers,
@ -212,8 +212,8 @@ var Key = new function() {
* Checks whether the specified key is pressed.
*
* @param {String} key any character or special key descriptor, e.g.:
* {@strings enter, space, shift, control, alt, meta, caps-lock, left,
* up, right, down, escape, delete, ...}
* {@strings enter, space, shift, control, alt, meta, caps-lock,
* left, up, right, down, escape, delete, ...}
* @return {Boolean} {@true if the key is pressed}
*
* @example

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
@ -125,9 +125,9 @@ var Group = Item.extend(/** @lends Group# */{
},
/**
* Specifies whether the group item is to be clipped.
* When setting to {@code true}, the first child in the group is
* automatically defined as the clipping mask.
* Specifies whether the group item is to be clipped. When setting to
* `true`, the first child in the group is automatically defined as the
* clipping mask.
*
* @type Boolean
* @bean

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
@ -436,8 +436,8 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
_locked: false,
/**
* Specifies whether the item is visible. When set to {@code false}, the
* item won't be drawn.
* Specifies whether the item is visible. When set to `false`, the item
* won't be drawn.
*
* @name Item#visible
* @type Boolean
@ -498,7 +498,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
_blendMode: 'normal',
/**
* The opacity of the item as a value between {@code 0} and {@code 1}.
* The opacity of the item as a value between `0` and `1`.
*
* @name Item#opacity
* @type Number
@ -527,8 +527,8 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
// TODO: Implement guides
/**
* Specifies whether the item functions as a guide. When set to
* {@code true}, the item will be drawn at the end as a guide.
* Specifies whether the item functions as a guide. When set to `true`, the
* item will be drawn at the end as a guide.
*
* @name Item#guide
* @type Boolean
@ -538,9 +538,9 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
_guide: false,
/**
* Specifies whether the item is selected. This will also return
* {@code true} for {@link Group} items if they are partially selected, e.g.
* groups containing selected or partially selected paths.
* Specifies whether the item is selected. This will also return `true` for
* {@link Group} items if they are partially selected, e.g. groups
* containing selected or partially selected paths.
*
* Paper.js draws the visual outlines of selected items on top of your
* project. This can be useful for debugging, as it allows you to see the
@ -760,9 +760,9 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
/**
* The item's pivot point specified in the item coordinate system, defining
* the point around which all transformations are hinging. This is also the
* reference point for {@link #position}. By default, it is set to
* {@code null}, meaning the {@link Rectangle#center} of the item's
* {@link #bounds} rectangle is used as pivot.
* reference point for {@link #position}. By default, it is set to `null`,
* meaning the {@link Rectangle#center} of the item's {@link #bounds}
* rectangle is used as pivot.
*
* @type Point
* @bean
@ -1330,7 +1330,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
/**
* The first item contained within this item. This is a shortcut for
* accessing {@code item.children[0]}.
* accessing `item.children[0]`.
*
* @type Item
* @bean
@ -1341,7 +1341,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
/**
* The last item contained within this item.This is a shortcut for
* accessing {@code item.children[item.children.length - 1]}.
* accessing `item.children[item.children.length - 1]`.
*
* @type Item
* @bean
@ -1411,8 +1411,8 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* item.
*
* @param {Boolean} [insert=true] specifies whether the copy should be
* inserted into the DOM. When set to {@code true}, it is inserted above the
* original
* inserted into the DOM. When set to `true`, it is inserted above the
* original
* @return {Item} the newly cloned item
*
* @example {@paperscript}
@ -1538,8 +1538,8 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* is not removed after rasterization.
*
* @param {Number} [resolution=view.resolution] the resolution of the raster
* in pixels per inch (DPI). If not specified, the value of
* {@code view.resolution} is used.
* in pixels per inch (DPI). If not specified, the value of
* `view.resolution` is used.
* @return {Raster} the newly created raster item
*
* @example {@paperscript}
@ -1675,42 +1675,41 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
},
/**
* Perform a hit-test on the item (and its children, if it is a
* {@link Group} or {@link Layer}) at the location of the specified point.
* Perform a hit-test on the item (and its children, if it is a {@link
* Group} or {@link Layer}) at the location of the specified point.
*
* The options object allows you to control the specifics of the hit-test
* and may contain a combination of the following values:
*
* @option [options.tolerance={@link PaperScope#settings}.hitTolerance]
* {Number} the tolerance of the hit-test
* {Number} the tolerance of the hit-test
* @option options.class {Function} only hit-test again a certain item class
* and its sub-classes: {@code Group, Layer, Path, CompoundPath,
* Shape, Raster, PlacedSymbol, PointText}, etc
* and its sub-classes: {@code Group, Layer, Path, CompoundPath, Shape,
* Raster, PlacedSymbol, PointText}, etc
* @option options.fill {Boolean} hit-test the fill of 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
* {@link Path} items
* {@link Path} items
* @option options.curves {Boolean} hit-test the curves of path items,
* without taking the stroke color or width into account
* @option options.handles {Boolean} hit-test for the handles
* ({@link Segment#handleIn} / {@link Segment#handleOut}) of path segments
* without taking the stroke color or width into account
* @option options.handles {Boolean} hit-test for the handles ({@link
* Segment#handleIn} / {@link Segment#handleOut}) of path segments
* @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
* 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
* the bounding rectangle of items ({@link Item#bounds})
* @option options.guides {Boolean} hit-test items that have
* {@link Item#guide} set to {@code true}
* the bounding rectangle of items ({@link Item#bounds})
* @option options.guides {Boolean} hit-test items that have {@link
* Item#guide} set to `true`
* @option options.selected {Boolean} only hit selected items
*
* @param {Point} point The point where the hit-test should be performed
* @param {Object} [options={ fill: true, stroke: true, segments: true,
* tolerance: 2 }]
* @return {HitResult} a hit result object that contains more
* information about what exactly was hit or {@code null} if nothing was
* hit
* tolerance: 2 }]
* @return {HitResult} a hit result object that contains more information
* about what exactly was hit or `null` if nothing was hit
*/
hitTest: function(/* point, options */) {
return this._hitTest(
@ -1912,17 +1911,15 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
/**
* Fetch the descendants (children or children of children) of this item
* that match the properties in the specified object.
* Extended matching is possible by providing a compare function or
* regular expression. Matching points, colors only work as a comparison
* of the full object, not partial matching (e.g. only providing the x-
* coordinate to match all points with that x-value). Partial matching
* does work for {@link Item#data}.
* that match the properties in the specified object. Extended matching is
* possible by providing a compare function or regular expression. Matching
* points, colors only work as a comparison of the full object, not partial
* matching (e.g. only providing the x- coordinate to match all points with
* that x-value). Partial matching does work for {@link Item#data}.
*
* Matching items against a rectangular area is also possible, by setting
* either {@code match.inside} or {@code match.overlapping} to a rectangle
* describing the area in which the items either have to be fully or partly
* contained.
* either `match.inside` or `match.overlapping` to a rectangle describing
* the area in which the items either have to be fully or partly contained.
*
* See {@link Project#getItems(match)} for a selection of illustrated
* examples.
@ -1932,7 +1929,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* @option match.match {Function} a match function to be called for each
* item, allowing the definition of more flexible item checks that are
* not bound to properties. If no other match properties are defined,
* this function can also be passed instead of the {@code match} object
* this function can also be passed instead of the `match` object
* @option match.class {Function} the constructor function of the item type
* to match against
* @option match.inside {Rectangle} the rectangle in which the items need to
@ -2050,10 +2047,10 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* @name Item#exportJSON
* @function
*
* @option [options.asString=true] {Boolean} whether the JSON is returned as a
* {@code Object} or a {@code String}
* @option [options.asString=true] {Boolean} whether the JSON is returned as
* a `Object` or a `String`
* @option [options.precision=5] {Number} the amount of fractional digits in
* numbers used in JSON data
* numbers used in JSON data
*
* @param {Object} [options] the serialization options
* @return {String} the exported JSON data
@ -2085,15 +2082,15 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* @function
*
* @option [options.asString=false] {Boolean} whether a SVG node or a
* {@code String} is to be returned
* `String` is to be returned
* @option [options.precision=5] {Number} the amount of fractional digits in
* numbers used in SVG data
* numbers used in SVG data
* @option [options.matchShapes=false] {Boolean} whether path items should
* tried to be converted to SVG shape items (rect, circle, ellipse, line,
* polyline, polygon), if their geometries match
* @option [options.embedImages=true] {Boolean} whether raster images
* should be embedded as base64 data inlined in the xlink:href attribute,
* or kept as a link to their external URL.
* tried to be converted to SVG shape items (rect, circle, ellipse,
* line, polyline, polygon), if their geometries match
* @option [options.embedImages=true] {Boolean} whether raster images should
* be embedded as base64 data inlined in the xlink:href attribute, or
* kept as a link to their external URL.
*
* @param {Object} [options] the export options
* @return {SVGElement} the item converted to an SVG node
@ -2101,68 +2098,63 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
/**
* Converts the provided SVG content into Paper.js items and adds them to
* the this item's children list.
* Note that the item is not cleared first. You can call
* {@link Item#removeChildren()} to do so.
* the this item's children list. Note that the item is not cleared first.
* You can call {@link Item#removeChildren()} to do so.
*
* @name Item#importSVG
* @function
*
* @option [options.expandShapes=false] {Boolean} whether imported shape
* items should be expanded to path items
* items should be expanded to path items
* @option [options.onLoad] {Function} the callback function to call once
* the SVG content is loaded from the given URL. Only required when loading
* from external files.
* the SVG content is loaded from the given URL. Only required when
* loading from external files.
* @option [options.applyMatrix={@link PaperScope#settings}.applyMatrix]
* {Boolean} whether imported items should have their transformation
* matrices applied to their contents or not
* {Boolean} whether imported items should have their transformation
* matrices applied to their contents or not
*
* @param {SVGElement|String} svg the SVG content to import, either as a SVG
* DOM node, a string containing SVG content, or a string describing the URL
* of the SVG file to fetch.
* DOM node, a string containing SVG content, or a string describing the
* URL of the SVG file to fetch.
* @param {Object} [options] the import options
* @return {Item} the newly created Paper.js item containing the converted
* SVG content
* SVG content
*/
/**
* Imports the provided external SVG file, converts it into Paper.js items
* and adds them to the this item's children list.
* Note that the item is not cleared first. You can call
* {@link Item#removeChildren()} to do so.
* and adds them to the this item's children list. Note that the item is not
* cleared first. You can call {@link Item#removeChildren()} to do so.
*
* @name Item#importSVG
* @function
*
* @param {SVGElement|String} svg the URL of the SVG file to fetch.
* @param {Function} onLoad the callback function to call once the SVG
* content is loaded from the given URL.
* content is loaded from the given URL.
* @return {Item} the newly created Paper.js item containing the converted
* SVG content
* SVG content
*/
/**
* {@grouptitle Hierarchy Operations}
* Adds the specified item as a child of this item at the end of the
* its children list. You can use this function for groups, compound
* paths and layers.
* {@grouptitle Hierarchy Operations} Adds the specified item as a child of
* this item at the end of the its children list. You can use this function
* for groups, compound paths and layers.
*
* @param {Item} item the item to be added as a child
* @return {Item} the added item, or {@code null} if adding was not
* possible
* @return {Item} the added item, or `null` if adding was not possible
*/
addChild: function(item, _preserve) {
return this.insertChild(undefined, item, _preserve);
},
/**
* Inserts the specified item as a child of this item at the specified
* index in its {@link #children} list. You can use this function for
* groups, compound paths and layers.
* Inserts the specified item as a child of this item at the specified index
* in its {@link #children} list. You can use this function for groups,
* compound paths and layers.
*
* @param {Number} index
* @param {Item} item the item to be inserted as a child
* @return {Item} the inserted item, or {@code null} if inserting was not
* possible
* @return {Item} the inserted item, or `null` if inserting was not possible
*/
insertChild: function(index, item, _preserve) {
var res = item ? this.insertChildren(index, [item], _preserve) : null;
@ -2170,13 +2162,12 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
},
/**
* Adds the specified items as children of this item at the end of the
* its children list. You can use this function for groups, compound
* paths and layers.
* Adds the specified items as children of this item at the end of the its
* children list. You can use this function for groups, compound paths and
* layers.
*
* @param {Item[]} items The items to be added as children
* @return {Item[]} the added items, or {@code null} if adding was not
* possible
* @return {Item[]} the added items, or `null` if adding was not possible
*/
addChildren: function(items, _preserve) {
return this.insertChildren(this._children.length, items, _preserve);
@ -2189,8 +2180,8 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
*
* @param {Number} index
* @param {Item[]} items The items to be appended as children
* @return {Item[]} the inserted items, or {@code null} if inserted was not
* possible
* @return {Item[]} the inserted items, or `null` if inserted was not
* possible
*/
insertChildren: function(index, items, _preserve, _proto) {
// CompoundPath#insertChildren() requires _preserve and _type:
@ -2254,8 +2245,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* Inserts this item above the specified item.
*
* @param {Item} item the item above which it should be inserted
* @return {Item} the inserted item, or {@code null} if inserting was not
* possible
* @return {Item} the inserted item, or `null` if inserting was not possible
*/
insertAbove: function(item, _preserve) {
return item._insertSibling(item._index + 1, this, _preserve);
@ -2265,8 +2255,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* Inserts this item below the specified item.
*
* @param {Item} item the item below which it should be inserted
* @return {Item} the inserted item, or {@code null} if inserting was not
* possible
* @return {Item} the inserted item, or `null` if inserting was not possible
*/
insertBelow: function(item, _preserve) {
return item._insertSibling(item._index, this, _preserve);
@ -2448,8 +2437,8 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* @return {Item[]} an array containing the removed items
*/
/**
* Removes the children from the specified {@code from} index to the
* {@code to} index from the parent's {@link #children} array.
* Removes the children from the specified `from` index to the `to` index
* from the parent's {@link #children} array.
*
* @name Item#removeChildren
* @function
@ -2893,7 +2882,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
/**
* The fill-rule with which the shape gets filled. Please note that only
* modern browsers support fill-rules other than {@code 'nonzero'}.
* modern browsers support fill-rules other than `'nonzero'`.
*
* @name Item#fillRule
* @property
@ -2907,7 +2896,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
* The shadow color.
*
* @property
* @name Style#shadowColor
* @name Item#shadowColor
* @type Color
*
* @example {@paperscript}
@ -2931,7 +2920,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
*
* @property
* @default 0
* @name Style#shadowBlur
* @name Item#shadowBlur
* @type Number
*/
@ -2940,7 +2929,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
*
* @property
* @default 0
* @name Style#shadowOffset
* @name Item#shadowOffset
* @type Point
*/
@ -3367,16 +3356,17 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
/**
* {@grouptitle Event Handlers}
*
* Item level handler function to be called on each frame of an animation.
* The function receives an event object which contains information about
* the frame event:
*
* @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
* first frame event in seconds
* first frame event in seconds
* @option event.delta {Number} the time passed in seconds since the last
* frame event
* frame event
*
* @see View#onFrame
* @example {@paperscript}
@ -4073,24 +4063,24 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
/**
* {@grouptitle Remove On Event}
*
* Removes the item when the events specified in the passed object literal
* Removes the item when the events specified in the passed options object
* occur.
* The object literal can contain the following values:
* Remove the item when the next {@link Tool#onMouseMove} event is
* fired: {@code object.move = true}
*
* Remove the item when the next {@link Tool#onMouseDrag} event is
* fired: {@code object.drag = true}
* @option options.move {Boolean) remove the item when the next {@link
* Tool#onMouseMove} event is fired.
*
* Remove the item when the next {@link Tool#onMouseDown} event is
* fired: {@code object.down = true}
* @option options.drag {Boolena) remove the item when the next {@link
* Tool#onMouseDrag} event is fired.
*
* Remove the item when the next {@link Tool#onMouseUp} event is
* fired: {@code object.up = true}
* @option options.down {Boolean) remove the item when the next {@link
* Tool#onMouseDown} event is fired.
*
* @option options.up {Boolean) remove the item when the next {@link
* Tool#onMouseUp} event is fired.
*
* @name Item#removeOn
* @function
* @param {Object} object
* @param {Object} options
*
* @example {@paperscript height=200}
* // Click and drag below:

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
@ -34,14 +34,14 @@ var Raster = Item.extend(/** @lends Raster# */{
// TODO: Have PlacedSymbol & Raster inherit from a shared class?
/**
* Creates a new raster item from the passed argument, and places it in the
* active layer. {@code object} can either be a DOM Image, a Canvas, or a
* string describing the URL to load the image from, or the ID of a DOM
* element to get the image from (either a DOM Image or a Canvas).
* active layer. `object` can either be a DOM Image, a Canvas, or a string
* describing the URL to load the image from, or the ID of a DOM element to
* get the image from (either a DOM Image or a Canvas).
*
* @param {HTMLImageElement|HTMLCanvasElement|String} [source] the source of
* the raster
* the raster
* @param {Point} [position] the center position at which the raster item is
* placed
* placed
*
* @example {@paperscript height=300} // Creating a raster using a url
* var url = 'http://assets.paperjs.org/images/marilyn.jpg';
@ -250,7 +250,7 @@ var Raster = Item.extend(/** @lends Raster# */{
* The Canvas object of the raster. If the raster was created from an image,
* accessing its canvas causes the raster to try and create one and draw the
* image into it. Depending on security policies, this might fail, in which
* case {@code null} is returned instead.
* case `null` is returned instead.
*
* @type Canvas
* @bean
@ -476,7 +476,7 @@ var Raster = Item.extend(/** @lends Raster# */{
},
/**
* Returns a Base 64 encoded {@code data:} URL representation of the raster.
* Returns a Base 64 encoded `data:` URL representation of the raster.
*
* @return {String}
*/

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
@ -160,10 +160,10 @@ var Shape = Item.extend(/** @lends Shape# */{
* inherits all settings from it, similar to {@link Item#clone()}.
*
* @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
* shape item
* inserted into the DOM. When set to `true`, it is inserted above the
* shape item
* @return {Shape} the newly created path item with the same geometry as
* this shape item
* this shape item
* @see Path#toShape(insert)
*/
toPath: function(insert) {

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js v*#=* __options.version - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
@ -403,7 +403,7 @@ var Curve = Base.extend(/** @lends Curve# */{
/**
* Creates a new curve as a sub-curve from this curve, its range defined by
* the given parameters. If {@code from} is larger than {@code to}, then
* the given parameters. If `from` is larger than `to`, then
* the resulting curve will have its direction reversed.
*
* @param {Number} from the curve-time parameter at which the sub-curve
@ -426,10 +426,10 @@ var Curve = Base.extend(/** @lends Curve# */{
* of {@link CurveLocation} objects.
*
* @param {Curve} curve the other curve to find the intersections with (if
* the curve itself or {@code null} is passed, the self intersection of the
* curve is returned, if it exists)
* the curve itself or `null` is passed, the self intersection of the
* curve is returned, if it exists)
* @return {CurveLocation[]} the locations of all intersections between the
* curves
* curves
*/
getIntersections: function(curve) {
return Curve._getIntersections(this.getValues(),
@ -464,11 +464,11 @@ var Curve = Base.extend(/** @lends Curve# */{
* @name Curve#divide
* @function
* @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}
* @param {Boolean} [isParameter=false] pass {@code true} if {@code offset}
* is a curve time parameter
* @return {Curve} the second part of the divided curve, if the offset
* is within the valid range, {code null} otherwise.
* or the curve time parameter if `isParameter` is `true`
* @param {Boolean} [isParameter=false] pass `true` if `offset` is a curve
* time parameter
* @return {Curve} the second part of the divided curve, if the offset is
* within the valid range, {code null} otherwise.
*/
// TODO: Rename to divideAt()?
divide: function(offset, isParameter, _setHandles) {
@ -524,9 +524,9 @@ var Curve = Base.extend(/** @lends Curve# */{
* @name Curve#split
* @function
* @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}
* @param {Boolean} [isParameter=false] pass {@code true} if {@code offset}
* is a curve time parameter
* or the curve time parameter if `isParameter` is `true`
* @param {Boolean} [isParameter=false] pass `true` if `offset` is a curve
* time parameter
* @return {Path} the newly created path after splitting, if any
* @see Path#split(index, parameter)
*/
@ -985,8 +985,8 @@ statics: {
* Calculates the curve time parameter of the specified offset on the path,
* relative to the provided start parameter. If offset is a negative value,
* 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
* {@code offset} and {@code 1} for negative values of {@code offset}.
* parameter is provided, a default of `0` for positive values of `offset`
* and `1` for negative values of `offset`.
*
* @param {Number} offset
* @param {Number} [start]
@ -998,7 +998,7 @@ statics: {
/**
* Returns the curve time parameter of the specified point if it lies on the
* curve, {@code null} otherwise.
* curve, `null` otherwise.
*
* @param {Point} point the point on the curve
* @return {Number} the curve time parameter of the specified point
@ -1012,9 +1012,9 @@ statics: {
* parameter.
*
* @param {Number} offset the offset on the curve, or the curve time
* parameter if {@code isParameter} is {@code true}
* @param {Boolean} [isParameter=false] pass {@code true} if {@code offset}
* is a curve time parameter
* parameter if `isParameter` is `true`
* @param {Boolean} [isParameter=false] pass `true` if `offset` is a curve
* time parameter
* @return {CurveLocation} the curve location at the specified the offset
*/
getLocationAt: function(offset, isParameter) {
@ -1026,7 +1026,7 @@ statics: {
/**
* Returns the curve location of the specified point if it lies on the
* curve, {@code null} otherwise.
* curve, `null` otherwise.
*
* @param {Point} point the point on the curve
* @return {CurveLocation} the curve location of the specified point
@ -1038,7 +1038,7 @@ statics: {
/**
* 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, `null` otherwise.
*
* @param {Point} point the point on the path
* @return {Number} the length of the path up to the specified point
@ -1082,9 +1082,9 @@ statics: {
* @name Curve#getPointAt
* @function
* @param {Number} offset the offset on the curve, or the curve time
* parameter if {@code isParameter} is {@code true}
* @param {Boolean} [isParameter=false] pass {@code true} if {@code offset}
* is a curve time parameter
* parameter if `isParameter` is `true`
* @param {Boolean} [isParameter=false] pass `true` if `offset` is a curve
* time parameter
* @return {Point} the point on the curve at the given offset
*/
@ -1095,9 +1095,9 @@ statics: {
* @name Curve#getTangentAt
* @function
* @param {Number} offset the offset on the curve, or the curve time
* parameter if {@code isParameter} is {@code true}
* @param {Boolean} [isParameter=false] pass {@code true} if {@code offset}
* is a curve time parameter
* parameter if `isParameter` is `true`
* @param {Boolean} [isParameter=false] pass `true` if `offset` is a curve
* time parameter
* @return {Point} the normalized tangent of the curve at the given offset
*/
@ -1107,22 +1107,22 @@ statics: {
* @name Curve#getNormalAt
* @function
* @param {Number} offset the offset on the curve, or the curve time
* parameter if {@code isParameter} is {@code true}
* @param {Boolean} [isParameter=false] pass {@code true} if {@code offset}
* is a curve time parameter
* parameter if `isParameter` is `true`
* @param {Boolean} [isParameter=false] pass `true` if `offset` is a curve
* time parameter
* @return {Point} the normal of the curve at the given offset
*/
/**
* Calculates the weighted tangent vector of the curve at the given
* offset, its length reflecting the curve velocity at that location.
* Calculates the weighted tangent vector of the curve at the given offset,
* its length reflecting the curve velocity at that location.
*
* @name Curve#getWeightedTangentAt
* @function
* @param {Number} offset the offset on the curve, or the curve time
* parameter if {@code isParameter} is {@code true}
* @param {Boolean} [isParameter=false] pass {@code true} if {@code offset}
* is a curve time parameter
* parameter if `isParameter` is `true`
* @param {Boolean} [isParameter=false] pass `true` if `offset` is a curve
* time parameter
* @return {Point} the weighted tangent of the curve at the given offset
*/
@ -1133,9 +1133,9 @@ statics: {
* @name Curve#getWeightedNormalAt
* @function
* @param {Number} offset the offset on the curve, or the curve time
* parameter if {@code isParameter} is {@code true}
* @param {Boolean} [isParameter=false] pass {@code true} if {@code offset}
* is a curve time parameter
* parameter if `isParameter` is `true`
* @param {Boolean} [isParameter=false] pass `true` if `offset` is a curve
* time parameter
* @return {Point} the weighted normal of the curve at the given offset
*/
@ -1148,9 +1148,9 @@ statics: {
* @name Curve#getCurvatureAt
* @function
* @param {Number} offset the offset on the curve, or the curve time
* parameter if {@code isParameter} is {@code true}
* @param {Boolean} [isParameter=false] pass {@code true} if {@code offset}
* is a curve time parameter
* parameter if `isParameter` is `true`
* @param {Boolean} [isParameter=false] pass `true` if `offset` is a curve
* time parameter
* @return {Number} the curvature of the curve at the given offset
*/
},

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
@ -13,11 +13,11 @@
/**
* @name CurveLocation
*
* @class CurveLocation objects describe a location on {@link Curve} objects,
* as defined by the curve-time {@link #parameter}, a value between {@code 0}
* (beginning of the curve) and {@code 1} (end of the curve). If the curve is
* part of a {@link Path} item, its {@link #index} inside the
* {@link Path#curves} array is also provided.
* @class CurveLocation objects describe a location on {@link Curve} objects, as
* defined by the curve-time {@link #parameter}, a value between `0`
* (beginning of the curve) and `1` (end of the curve). If the curve is part
* of a {@link Path} item, its {@link #index} inside the {@link Path#curves}
* array is also provided.
*
* The class is in use in many places, such as
* {@link Path#getLocationAt(offset)},
@ -176,8 +176,8 @@ var CurveLocation = Base.extend(/** @lends CurveLocation# */{
/**
* The curve-time parameter, as used by various bezier curve calculations.
* It is value between {@code 0} (beginning of the curve) and {@code 1}
* (end of the curve).
* It is value between `0` (beginning of the curve) and `1` (end of the
* curve).
*
* @type Number
* @bean
@ -429,7 +429,7 @@ var CurveLocation = Base.extend(/** @lends CurveLocation# */{
c1 = t1 <= tMin ? c2.getPrevious() : c2,
c4 = inter.getCurve(),
c3 = t2 <= tMin ? c4.getPrevious() : c4;
// If t1, t2 are at the end, then step to the next curve.
// If t1 / t2 are at the end, then step to the next curve.
if (t1 >= tMax)
c2 = c2.getNext();
if (t2 >= tMax)

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
@ -393,9 +393,9 @@ Path.inject({ statics: new function() {
/**
* Creates a star shaped path item.
*
* The largest of {@code radius1} and {@code radius2} will be the outer
* radius of the star. The smallest of radius1 and radius2 will be the
* inner radius.
* The largest of `radius1` and `radius2` will be the outer radius of
* the star. The smallest of radius1 and radius2 will be the inner
* radius.
*
* @name Path.Star
* @param {Point} center the center point of the star

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
@ -701,8 +701,8 @@ var Path = PathItem.extend(/** @lends Path# */{
* @return {Segment[]} an array containing the removed segments
*/
/**
* Removes the segments from the specified {@code from} index to the
* {@code to} index from the path's {@link #segments} array.
* Removes the segments from the specified `from` index to the `to` index
* from the path's {@link #segments} array.
*
* @param {Number} from the beginning index, inclusive
* @param {Number} [to=segments.length] the ending index, exclusive
@ -862,9 +862,8 @@ var Path = PathItem.extend(/** @lends Path# */{
},
/**
* Specifies whether an path is selected and will also return {@code true}
* if the path is partially selected, i.e. one or more of its segments is
* selected.
* Specifies whether an path is selected and will also return `true` if the
* path is partially selected, i.e. one or more of its segments is selected.
*
* Paper.js draws the visual outlines of selected items on top of your
* project. This can be useful for debugging, as it allows you to see the
@ -903,7 +902,7 @@ var Path = PathItem.extend(/** @lends Path# */{
*/
/**
* Specifies whether the path and all its segments are selected. Cannot be
* {@code true} on an empty path.
* `true` on an empty path.
*
* @type Boolean
* @bean
@ -981,7 +980,7 @@ var Path = PathItem.extend(/** @lends Path# */{
/**
* Converts the curves in a path to straight lines with an even distribution
* of points. The distance between the produced segments is as close as
* possible to the value specified by the {@code maxDistance} parameter.
* possible to the value specified by the `maxDistance` parameter.
*
* @param {Number} maxDistance the maximum distance between the points
*
@ -1396,10 +1395,10 @@ var Path = PathItem.extend(/** @lends Path# */{
* and inherits all settings from it, similar to {@link Item#clone()}.
*
* @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 `true`, it is inserted above the
* path item
* @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, `null` otherwise
* @see Shape#toPath(insert)
*/
toShape: function(insert) {
@ -1694,7 +1693,7 @@ var Path = PathItem.extend(/** @lends Path# */{
* {@grouptitle Positions on Paths and Curves}
*
* Returns the curve location of the specified point if it lies on the
* path, {@code null} otherwise.
* path, `null` otherwise.
*
* @param {Point} point the point on the path
* @return {CurveLocation} the curve location of the specified point
@ -1712,7 +1711,7 @@ var Path = PathItem.extend(/** @lends Path# */{
/**
* 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, `null` otherwise.
*
* @param {Point} point the point on the path
* @return {Number} the length of the path up to the specified point
@ -1725,7 +1724,7 @@ var Path = PathItem.extend(/** @lends 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 `0` is at
* the beginning of the path and {@link Path#length} at the end
* @param {Boolean} [isParameter=false]
* @return {CurveLocation} the curve location at the specified offset
@ -1761,7 +1760,7 @@ var Path = PathItem.extend(/** @lends Path# */{
*
* @name Path#getPointAt
* @function
* @param {Number} offset the offset on the path, where {@code 0} is at
* @param {Number} offset the offset on the path, where `0` is at
* the beginning of the path and {@link Path#length} at the end
* @param {Boolean} [isParameter=false]
* @return {Point} the point at the given offset
@ -1824,7 +1823,7 @@ var Path = PathItem.extend(/** @lends Path# */{
*
* @name Path#getTangentAt
* @function
* @param {Number} offset the offset on the path, where {@code 0} is at
* @param {Number} offset the offset on the path, where `0` is at
* the beginning of the path and {@link Path#length} at the end
* @param {Boolean} [isParameter=false]
* @return {Point} the normalized tangent vector at the given offset
@ -1891,7 +1890,7 @@ var Path = PathItem.extend(/** @lends Path# */{
*
* @name Path#getNormalAt
* @function
* @param {Number} offset the offset on the path, where {@code 0} is at
* @param {Number} offset the offset on the path, where `0` is at
* the beginning of the path and {@link Path#length} at the end
* @param {Boolean} [isParameter=false]
* @return {Point} the normal vector at the given offset
@ -1958,7 +1957,7 @@ var Path = PathItem.extend(/** @lends Path# */{
*
* @name Path#getWeightedTangentAt
* @function
* @param {Number} offset the offset on the path, where {@code 0} is at
* @param {Number} offset the offset on the path, where `0` is at
* the beginning of the path and {@link Path#length} at the end
* @param {Boolean} [isParameter=false]
* @return {Point} the weighted tangent vector at the given offset
@ -1969,7 +1968,7 @@ var Path = PathItem.extend(/** @lends Path# */{
*
* @name Path#getWeightedNormalAt
* @function
* @param {Number} offset the offset on the path, where {@code 0} is at
* @param {Number} offset the offset on the path, where `0` is at
* the beginning of the path and {@link Path#length} at the end
* @param {Boolean} [isParameter=false]
* @return {Point} the weighted normal vector at the given offset
@ -1983,7 +1982,7 @@ var Path = PathItem.extend(/** @lends Path# */{
*
* @name Path#getCurvatureAt
* @function
* @param {Number} offset the offset on the path, where {@code 0} is at
* @param {Number} offset the offset on the path, where `0` is at
* the beginning of the path and {@link Path#length} at the end
* @param {Boolean} [isParameter=false]
* @return {Number} the normal vector at the given offset

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
@ -402,8 +402,8 @@ var PathItem = Item.extend(/** @lends PathItem# */{
// DOCS: Document PathItem#curveTo() 'paramater' param.
/**
* Draws a curve from the position of the last segment point in the path
* that goes through the specified {@code through} point, to the specified
* {@code to} point by adding one segment to the path.
* that goes through the specified `through` point, to the specified `to`
* point by adding one segment to the path.
*
* @name PathItem#curveTo
* @function
@ -437,8 +437,8 @@ var PathItem = Item.extend(/** @lends PathItem# */{
/**
* Draws an arc from the position of the last segment point in the path that
* goes through the specified {@code through} point, to the specified
* {@code to} point by adding one or more segments to the path.
* goes through the specified `through` point, to the specified `to` point
* by adding one or more segments to the path.
*
* @name PathItem#arcTo
* @function

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
@ -304,35 +304,34 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{
* and may contain a combination of the following values:
*
* @option [options.tolerance={@link PaperScope#settings}.hitTolerance]
* {Number} the tolerance of the hit-test
* {Number} the tolerance of the hit-test
* @option options.class {Function} only hit-test again a certain item class
* and its sub-classes: {@code Group, Layer, Path, CompoundPath,
* Shape, Raster, PlacedSymbol, PointText}, etc
* and its sub-classes: {@code Group, Layer, Path, CompoundPath, Shape,
* Raster, PlacedSymbol, PointText}, etc
* @option options.fill {Boolean} hit-test the fill of 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
* {@link Path} items
* {@link Path} items
* @option options.curves {Boolean} hit-test the curves of path items,
* without taking the stroke color or width into account
* @option options.handles {Boolean} hit-test for the handles
* ({@link Segment#handleIn} / {@link Segment#handleOut}) of path segments.
* without taking the stroke color or width into account
* @option options.handles {Boolean} hit-test for the handles ({@link
* Segment#handleIn} / {@link Segment#handleOut}) of path segments.
* @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
* 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
* the bounding rectangle of items ({@link Item#bounds})
* @option options.guides {Boolean} hit-test items that have
* {@link Item#guide} set to {@code true}
* the bounding rectangle of items ({@link Item#bounds})
* @option options.guides {Boolean} hit-test items that have {@link
* Item#guide} set to `true`
* @option options.selected {Boolean} only hit selected items
*
* @param {Point} point the point where the hit-test should be performed
* @param {Object} [options={ fill: true, stroke: true, segments: true,
* tolerance: true }]
* @return {HitResult} a hit result object that contains more
* information about what exactly was hit or {@code null} if nothing was
* hit
* tolerance: true }]
* @return {HitResult} a hit result object that contains more information
* about what exactly was hit or `null` if nothing was hit
*/
hitTest: function(/* point, options */) {
// We don't need to do this here, but it speeds up things since we won't
@ -352,22 +351,23 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{
*
* Fetch items contained within the project whose properties match the
* criteria in the specified object.
*
* Extended matching of properties is possible by providing a comparator
* function or regular expression. Matching points, colors only work as a
* comparison of the full object, not partial matching (e.g. only providing
* the x- coordinate to match all points with that x-value). Partial
* matching does work for {@link Item#data}.
*
* Matching items against a rectangular area is also possible, by setting
* either {@code match.inside} or {@code match.overlapping} to a rectangle
* describing the area in which the items either have to be fully or partly
* contained.
* either `match.inside` or `match.overlapping` to a rectangle describing
* the area in which the items either have to be fully or partly contained.
*
* @option [match.recursive=true] {Boolean} whether to loop recursively
* through all children, or stop at the current level
* @option match.match {Function} a match function to be called for each
* item, allowing the definition of more flexible item checks that are
* not bound to properties. If no other match properties are defined,
* this function can also be passed instead of the {@code match} object
* this function can also be passed instead of the `match` object
* @option match.class {Function} the constructor function of the item type
* to match against
* @option match.inside {Rectangle} the rectangle in which the items need to
@ -607,16 +607,16 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{
/**
* {@grouptitle Importing / Exporting JSON and SVG}
*
* Exports (serializes) the project with all its layers and child items to
* a JSON data object or string.
* Exports (serializes) the project with all its layers and child items to a
* JSON data object or string.
*
* @name Project#exportJSON
* @function
*
* @option [options.asString=true] {Boolean} whether the JSON is returned as
* a {@code Object} or a {@code String}
* a `Object` or a `String`
* @option [options.precision=5] {Number} the amount of fractional digits in
* numbers used in JSON data
* numbers used in JSON data
*
* @param {Object} [options] the serialization options
* @return {String} the exported JSON data
@ -645,15 +645,15 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{
* @function
*
* @option [options.asString=false] {Boolean} whether a SVG node or a
* {@code String} is to be returned
* `String` is to be returned
* @option [options.precision=5] {Number} the amount of fractional digits in
* numbers used in SVG data
* numbers used in SVG data
* @option [options.matchShapes=false] {Boolean} whether path items should
* tried to be converted to SVG shape items (rect, circle, ellipse, line,
* polyline, polygon), if their geometries match
* @option [options.embedImages=true] {Boolean} whether raster images
* should be embedded as base64 data inlined in the xlink:href attribute,
* or kept as a link to their external URL.
* tried to be converted to SVG shape items (rect, circle, ellipse,
* line, polyline, polygon), if their geometries match
* @option [options.embedImages=true] {Boolean} whether raster images should
* be embedded as base64 data inlined in the xlink:href attribute, or
* kept as a link to their external URL.
*
* @param {Object} [options] the export options
* @return {SVGElement} the project converted to an SVG node

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
@ -292,14 +292,14 @@ var Color = Base.extend(new function() {
* Creates a RGB Color object.
*
* @name Color#initialize
* @param {Number} red the amount of red in the color as a value
* between {@code 0} and {@code 1}
* @param {Number} red the amount of red in the color as a value between
* `0` and `1`
* @param {Number} green the amount of green in the color as a value
* between {@code 0} and {@code 1}
* between `0` and `1`
* @param {Number} blue the amount of blue in the color as a value
* between {@code 0} and {@code 1}
* @param {Number} [alpha] the alpha of the color as a value between
* {@code 0} and {@code 1}
* between `0` and `1`
* @param {Number} [alpha] the alpha of the color as a value between `0`
* and `1`
*
* @example {@paperscript}
* // Creating a RGB Color:
@ -316,9 +316,9 @@ var Color = Base.extend(new function() {
*
* @name Color#initialize
* @param {Number} gray the amount of gray in the color as a value
* between {@code 0} and {@code 1}
* @param {Number} [alpha] the alpha of the color as a value between
* {@code 0} and {@code 1}
* between `0` and `1`
* @param {Number} [alpha] the alpha of the color as a value between `0`
* and `1`
*
* @example {@paperscript}
* // Creating a gray Color:
@ -334,35 +334,33 @@ var Color = Base.extend(new function() {
* Creates a HSB, HSL or gradient Color object from the properties of
* the provided object:
*
* <b>HSB Color</b>:<br>
* {@code hue: Number} the hue of the color as a value in
* degrees between {@code 0} and {@code 360}<br>
* {@code saturation: Number} the saturation of the color as a
* value between {@code 0} and {@code 1}<br>
* {@code brightness: Number} the brightness of the color as a
* value between {@code 0} and {@code 1}<br>
* {@code alpha: Number} the alpha of the color as a value between
* {@code 0} and {@code 1}
* @option hsb.hue {Number} the hue of the color as a value in degrees
* between `0` and `360`
* @option hsb.saturation {Number} the saturation of the color as a
* value between `0` and `1`
* @option hsb.brightness {Number} the brightness of the color as a
* value between `0` and `1`
* @option hsb.alpha {Number} the alpha of the color as a value between
* `0` and `1`
*
* <b>HSL Color</b>:<br>
* {@code hue: Number} the hue of the color as a value in
* degrees between {@code 0} and {@code 360}<br>
* {@code saturation: Number} the saturation of the color as a
* value between {@code 0} and {@code 1}<br>
* {@code lightness: Number} the lightness of the color as a
* value between {@code 0} and {@code 1}<br>
* {@code alpha: Number} the alpha of the color as a value between
* {@code 0} and {@code 1}
* @option hsl.hue {Number} the hue of the color as a value in degrees
* between `0` and `360`
* @option hsl.saturation {Number} the saturation of the color as a
* value between `0` and `1`
* @option hsl.lightness {Number} the lightness of the color as a value
* between `0` and `1`<br>
* @option hsl.alpha {Number} the alpha of the color as a value between
* `0` and `1`
*
* <b>Gradient Color</b>:<br>
* {@code gradient: Gradient} the gradient object that describes the
* color stops and type of gradient to be used.<br>
* {@code origin: Point} the origin point of the gradient<br>
* {@code destination: Point} the destination point of the gradient
* {@code stops: Array of GradientStop} the gradient stops describing
* the gradient, as an alternative to providing a gradient object<br>
* {@code radial: Boolean} controls whether the gradient is radial,
* as an alternative to providing a gradient object<br>
* @option gradient.gradient {Gradient} the gradient object that
* describes the color stops and type of gradient to be used
* @option gradient.origin {Point} the origin point of the gradient
* @option gradient.destination {Point} the destination point of the
* gradient
* @option gradient.stops {GradientStop[]} the gradient stops describing
* the gradient, as an alternative to providing a gradient object
* @option gradient.radial {Boolean} controls whether the gradient is
* radial, as an alternative to providing a gradient object
*
* @name Color#initialize
* @param {Object} object an object describing the components and
@ -707,7 +705,7 @@ var Color = Base.extend(new function() {
},
/**
* The color's alpha value as a number between {@code 0} and {@code 1}.
* The color's alpha value as a number between `0` and `1`.
* All colors of the different subclasses support alpha values.
*
* @type Number
@ -879,8 +877,7 @@ var Color = Base.extend(new function() {
/**
* {@grouptitle RGB Components}
*
* The amount of red in the color as a value between {@code 0} and
* {@code 1}.
* The amount of red in the color as a value between `0` and `1`.
*
* @name Color#red
* @property
@ -895,8 +892,7 @@ var Color = Base.extend(new function() {
* circle.fillColor.red = 1;
*/
/**
* The amount of green in the color as a value between {@code 0} and
* {@code 1}.
* The amount of green in the color as a value between `0` and `1`.
*
* @name Color#green
* @property
@ -913,8 +909,7 @@ var Color = Base.extend(new function() {
* circle.fillColor.green = 1;
*/
/**
* The amount of blue in the color as a value between {@code 0} and
* {@code 1}.
* The amount of blue in the color as a value between `0` and `1`.
*
* @name Color#blue
* @property
@ -934,8 +929,7 @@ var Color = Base.extend(new function() {
/**
* {@grouptitle Gray Components}
*
* The amount of gray in the color as a value between {@code 0} and
* {@code 1}.
* The amount of gray in the color as a value between `0` and `1`.
*
* @name Color#gray
* @property
@ -945,8 +939,7 @@ var Color = Base.extend(new function() {
/**
* {@grouptitle HSB Components}
*
* The hue of the color as a value in degrees between {@code 0} and
* {@code 360}.
* The hue of the color as a value in degrees between `0` and `360`.
*
* @name Color#hue
* @property
@ -971,16 +964,14 @@ var Color = Base.extend(new function() {
* }
*/
/**
* The saturation of the color as a value between {@code 0} and
* {@code 1}.
* The saturation of the color as a value between `0` and `1`.
*
* @name Color#saturation
* @property
* @type Number
*/
/**
* The brightness of the color as a value between {@code 0} and
* {@code 1}.
* The brightness of the color as a value between `0` and `1`.
*
* @name Color#brightness
* @property
@ -990,8 +981,8 @@ var Color = Base.extend(new function() {
/**
* {@grouptitle HSL Components}
*
* The lightness of the color as a value between {@code 0} and
* {@code 1}.
* The lightness of the color as a value between `0` and `1`.
*
* Note that all other components are shared with HSB.
*
* @name Color#lightness

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
@ -72,8 +72,7 @@ var GradientStop = Base.extend(/** @lends GradientStop# */{
},
/**
* The ramp-point of the gradient stop as a value between {@code 0} and
* {@code 1}.
* The ramp-point of the gradient stop as a value between `0` and `1`.
*
* @type Number
* @bean

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
@ -523,7 +523,7 @@ var Style = Base.extend(new function() {
/**
* The fill-rule with which the shape gets filled. Please note that only
* modern browsers support fill-rules other than {@code 'nonzero'}.
* modern browsers support fill-rules other than `'nonzero'`.
*
* @name Style#fillRule
* @property
@ -605,8 +605,8 @@ var Style = Base.extend(new function() {
*/
/**
* The font size of text content, as a number in pixels, or as a string
* with optional units {@code 'px'}, {@code 'pt'} and {@code 'em'}.
* The font size of text content, as a number in pixels, or as a string with
* optional units `'px'`, `'pt'` and `'em'`.
*
* @name Style#fontSize
* @default 10

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
@ -13,11 +13,11 @@
/**
* @name TextItem
*
* @class The TextItem type allows you to create typography. Its
* functionality is inherited by different text item types such as
* {@link PointText}, and {@link AreaText} (coming soon). They each add a
* layer of functionality that is unique to their type, but share the
* underlying properties and functions that they inherit from TextItem.
* @class The TextItem type allows you to create typography. Its functionality
* is inherited by different text item types such as {@link PointText}, and
* {@link AreaText} (coming soon). They each add a layer of functionality
* that is unique to their type, but share the underlying properties and
* functions that they inherit from TextItem.
*
* @extends Item
*/
@ -119,8 +119,8 @@ var TextItem = Item.extend(/** @lends TextItem# */{
*/
/**
* The font size of text content, as a number in pixels, or as a string
* with optional units {@code 'px'}, {@code 'pt'} and {@code 'em'}.
* The font size of text content, as a number in pixels, or as a string with
* optional units `'px'`, `'pt'` and `'em'`.
*
* @name TextItem#fontSize
* @default 10

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
@ -13,15 +13,15 @@
/**
* @name Tool
*
* @class The Tool object refers to a script that the user can interact with
* by using the mouse and keyboard and can be accessed through the global
* {@code tool} variable. All its properties are also available in the paper
* scope.
* @class The Tool object refers to a script that the user can interact with by
* using the mouse and keyboard and can be accessed through the global
* `tool` variable. All its properties are also available in the paper
* scope.
*
* The global {@code tool} variable only exists in scripts that contain mouse
* handler functions ({@link #onMouseMove}, {@link #onMouseDown},
* {@link #onMouseDrag}, {@link #onMouseUp}) or a keyboard handler
* function ({@link #onKeyDown}, {@link #onKeyUp}).
* The global `tool` variable only exists in scripts that contain mouse handler
* functions ({@link #onMouseMove}, {@link #onMouseDown}, {@link #onMouseDrag},
* {@link #onMouseUp}) or a keyboard handler function ({@link #onKeyDown},
* {@link #onKeyUp}).
*
* @classexample
* var path;
@ -227,10 +227,10 @@ var Tool = PaperScopeItem.extend(/** @lends Tool# */{
* The function to be called when the user presses a key on the keyboard.
* The function receives a {@link KeyEvent} object which contains
* information about the keyboard event.
* If the function returns {@code false}, the keyboard event will be
* prevented from bubbling up. This can be used for example to stop the
* window from scrolling, when you need the user to interact with arrow
* keys.
*
* If the function returns `false`, the keyboard event will be prevented
* from bubbling up. This can be used for example to stop the window from
* scrolling, when you need the user to interact with arrow keys.
*
* @name Tool#onKeyDown
* @property
@ -261,10 +261,10 @@ var Tool = PaperScopeItem.extend(/** @lends Tool# */{
* The function to be called when the user releases a key on the keyboard.
* The function receives a {@link KeyEvent} object which contains
* information about the keyboard event.
* If the function returns {@code false}, the keyboard event will be
* prevented from bubbling up. This can be used for example to stop the
* window from scrolling, when you need the user to interact with arrow
* keys.
*
* If the function returns `false`, the keyboard event will be prevented
* from bubbling up. This can be used for example to stop the window from
* scrolling, when you need the user to interact with arrow keys.
*
* @name Tool#onKeyUp
* @property

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
@ -296,7 +296,7 @@ var View = Base.extend(Emitter, /** @lends View# */{
/**
* The ratio between physical pixels and device-independent pixels (DIPs)
* of the underlying canvas / device.
* It is {@code 1} for normal displays, and {@code 2} or more for
* It is `1` for normal displays, and `2` or more for
* high-resolution displays.
*
* @type Number
@ -309,8 +309,8 @@ var View = Base.extend(Emitter, /** @lends View# */{
/**
* The resoltuion of the underlying canvas / device in pixel per inch (DPI).
* It is {@code 72} for normal displays, and {@code 144} for high-resolution
* displays with a pixel-ratio of {@code 2}.
* It is `72` for normal displays, and `144` for high-resolution
* displays with a pixel-ratio of `2`.
*
* @type Number
* @bean
@ -580,7 +580,7 @@ var View = Base.extend(Emitter, /** @lends View# */{
* @name View#on
* @function
* @param {Object} param an object literal containing one or more of the
* following properties: {@code frame, resize}
* following properties: `frame, resize`
* @return {View} this view itself, so calls can be chained
*
* @example {@paperscript}
@ -635,7 +635,7 @@ var View = Base.extend(Emitter, /** @lends View# */{
* @name View#off
* @function
* @param {Object} param an object literal containing one or more of the
* following properties: {@code frame, resize}
* following properties: `frame, resize`
* @return {View} this view itself, so calls can be chained
*/

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
@ -14,75 +14,75 @@ module('Emitter');
test('on()', function() {
var emitter = new Base(Emitter),
installed;
// fake event type registration
emitter._eventTypes = {mousemove: {install: function(){ installed = true;} } };
equals(function() {
return !emitter.responds('mousemove');
}, true);
installed;
// fake event type registration
emitter._eventTypes = {mousemove: {install: function(){ installed = true;} } };
equals(function() {
return !emitter.responds('mousemove');
}, true);
emitter.on('mousemove', function() {});
equals(function() {
equals(function() {
return emitter.responds('mousemove')
}, true);
equals(function() { return installed; }, true);
// one time installation only
installed = false;
emitter.on('mousemove', function() {});
equals(function() { return !installed; }, true);
equals(function() { return installed; }, true);
// one time installation only
installed = false;
emitter.on('mousemove', function() {});
equals(function() { return !installed; }, true);
emitter.on('customUnregistered', function() {});
equals(function() {
emitter.on('customUnregistered', function() {});
equals(function() {
return emitter.responds('customUnregistered')
}, true);
});
test('off()', function() {
var emitter = new Base(Emitter),
uninstalled, called = 0,
handler = function () {called++},
handler2 = function () {};
emitter._eventTypes = {mousemove: {uninstall: function(){ uninstalled = true;} } };
var emitter = new Base(Emitter),
uninstalled, called = 0,
handler = function () {called++},
handler2 = function () {};
emitter._eventTypes = {mousemove: {uninstall: function(){ uninstalled = true;} } };
emitter.on('mousemove', handler);
emitter.on('mousemove', handler2);
emitter.on('custom', handler);
emitter.emit('mousemove');
equals(function() { return called == 1; }, true);
emitter.on('mousemove', handler);
emitter.on('mousemove', handler2);
emitter.on('custom', handler);
emitter.emit('mousemove');
equals(function() { return called == 1; }, true);
emitter.off('mousemove', handler2);
emitter.emit('mousemove');
equals(function() { return called == 2; }, true);
equals(function() { return !uninstalled }, true);
emitter.off('mousemove', handler2);
emitter.emit('mousemove');
equals(function() { return called == 2; }, true);
equals(function() { return !uninstalled }, true);
emitter.off('mousemove', handler);
emitter.emit('mousemove');
equals(function() { return called == 2; }, true);
equals(function() { return uninstalled }, true);
emitter.off('mousemove', handler);
emitter.emit('mousemove');
equals(function() { return called == 2; }, true);
equals(function() { return uninstalled }, true);
called = 0;
emitter.emit('custom');
equals(function() { return called == 1; }, true);
emitter.off('custom', handler);
emitter.emit('custom');
equals(function() { return called == 1; }, true);
called = 0;
emitter.emit('custom');
equals(function() { return called == 1; }, true);
emitter.off('custom', handler);
emitter.emit('custom');
equals(function() { return called == 1; }, true);
});
test('emit()', function() {
var emitter = new Base(Emitter),
called,
handler = function (e) {called = e};
// fake event type registration
emitter._eventTypes = {mousemove: {} };
emitter.on('mousemove', handler);
emitter.on('custom', handler);
var emitter = new Base(Emitter),
called,
handler = function (e) {called = e};
// fake event type registration
emitter._eventTypes = {mousemove: {} };
emitter.on('mousemove', handler);
emitter.on('custom', handler);
emitter.emit('mousemove', 'mousemove');
equals(function() {
return called == 'mousemove';
}, true);
emitter.emit('mousemove', 'mousemove');
equals(function() {
return called == 'mousemove';
}, true);
emitter.emit('custom', 'custom');
equals(function() {
return called == 'custom';
}, true);
emitter.emit('custom', 'custom');
equals(function() {
return called == 'custom';
}, true);
});

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

View file

@ -2,7 +2,7 @@
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.

Some files were not shown because too many files have changed in this diff Show more