From 10aa8d7b4a2a877302a36f4d2bdad37dda6da49e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 28 Dec 2013 22:34:00 +0100 Subject: [PATCH 01/26] Fix accidental documentation leakage into global scope. --- src/style/Color.js | 1 + src/util/Formatter.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/style/Color.js b/src/style/Color.js index daec2ded..2ae7bd95 100644 --- a/src/style/Color.js +++ b/src/style/Color.js @@ -775,6 +775,7 @@ var Color = Base.extend(new function() { /** * @name Color#clone + * @function * * Returns a copy of the color object. * diff --git a/src/util/Formatter.js b/src/util/Formatter.js index c5f45e51..fe4036cd 100644 --- a/src/util/Formatter.js +++ b/src/util/Formatter.js @@ -12,9 +12,10 @@ /** * @name Formatter + * @class * @private */ -var Formatter = Base.extend({ +var Formatter = Base.extend(/** @lends Formatter# */{ /** * @param {Number} [precision=5] the amount of fractional digits. */ From 5f466bbc7eef572f144d8f124631f38eefab5367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 28 Dec 2013 22:48:50 +0100 Subject: [PATCH 02/26] Move documentation for PaperScope#tools to the right place. --- src/core/PaperScope.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/PaperScope.js b/src/core/PaperScope.js index 683870b7..00a233c6 100644 --- a/src/core/PaperScope.js +++ b/src/core/PaperScope.js @@ -113,6 +113,12 @@ var PaperScope = Base.extend(/** @lends PaperScope# */{ return this._tool; }, + /** + * The list of available tools. + * @name PaperScope#tools + * @type Tool[] + */ + /** * A reference to the local scope. This is required, so `paper` will always * refer to the local scope, even when calling into it from another scope. @@ -125,12 +131,6 @@ var PaperScope = Base.extend(/** @lends PaperScope# */{ return this; }, - /** - * The list of available tools. - * @name PaperScope#tools - * @type Tool[] - */ - evaluate: function(code) { var res = paper.PaperScript.evaluate(code, this); View.updateFocus(); From 8395541298a14647bc520e6d1675fcfc6fd674f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 29 Dec 2013 15:44:26 +0100 Subject: [PATCH 03/26] Clean up docs and fix spelling mistakes. --- node_modules/.gitignore | 5 +++-- src/core/Base.js | 2 +- src/dom/DomElement.js | 2 +- src/dom/DomEvent.js | 2 +- src/path/Curve.js | 4 ++-- src/path/PathFitter.js | 5 +++++ src/path/PathFlattener.js | 5 +++++ src/ui/CanvasView.js | 2 +- src/util/Numerical.js | 7 ++++++- 9 files changed, 25 insertions(+), 9 deletions(-) diff --git a/node_modules/.gitignore b/node_modules/.gitignore index f03c65d0..b2703914 100644 --- a/node_modules/.gitignore +++ b/node_modules/.gitignore @@ -1,7 +1,8 @@ .bin canvas +grunt* +jsdoc jsdom +prepro request uglify-js -prepro -grunt* diff --git a/src/core/Base.js b/src/core/Base.js index aa6fe49c..73406462 100644 --- a/src/core/Base.js +++ b/src/core/Base.js @@ -211,7 +211,7 @@ Base.inject(/** @lends Base# */{ /** * Reads all readable arguments from the list, handling nested arrays - * seperately. + * separately. * @param {Array} list the list to read from, either an arguments object * or a normal array. * @param {Number} start the index at which to start reading in the list diff --git a/src/dom/DomElement.js b/src/dom/DomElement.js index 46fa1ec7..15a38fca 100644 --- a/src/dom/DomElement.js +++ b/src/dom/DomElement.js @@ -46,7 +46,7 @@ var DomElement = new function() { return res; } - return { + return /** @lends DomElement */{ create: function(nodes, parent) { var isArray = Array.isArray(nodes), res = create(isArray ? nodes : arguments, isArray ? parent : null); diff --git a/src/dom/DomEvent.js b/src/dom/DomEvent.js index 49b66407..70f2e33b 100644 --- a/src/dom/DomEvent.js +++ b/src/dom/DomEvent.js @@ -15,7 +15,7 @@ * @namespace * @private */ -var DomEvent = { +var DomEvent = /** @lends DomEvent */{ add: function(el, events) { for (var type in events) el.addEventListener(type, events[type], false); diff --git a/src/path/Curve.js b/src/path/Curve.js index 2331a317..a1bc7458 100644 --- a/src/path/Curve.js +++ b/src/path/Curve.js @@ -556,7 +556,7 @@ statics: { }, getParameterOf: function(v, x, y) { - // Handle beginnings and end seperately, as they are not detected + // Handle beginnings and end separately, as they are not detected // sometimes. var tolerance = /*#=*/ Numerical.TOLERANCE; if (Math.abs(v[0] - x) < tolerance && Math.abs(v[1] - y) < tolerance) @@ -675,7 +675,7 @@ statics: { c = v1 - v0, count = Numerical.solveQuadratic(a, b, c, roots), // Add some tolerance for good roots, as t = 0 / 1 are added - // seperately anyhow, and we don't want joins to be added with + // separately anyhow, and we don't want joins to be added with // radiuses in getStrokeBounds() tMin = /*#=*/ Numerical.TOLERANCE, tMax = 1 - tMin; diff --git a/src/path/PathFitter.js b/src/path/PathFitter.js index b179529e..86b79c84 100644 --- a/src/path/PathFitter.js +++ b/src/path/PathFitter.js @@ -15,6 +15,11 @@ // from "Graphics Gems", Academic Press, 1990 // Modifications and optimisations of original algorithm by Juerg Lehni. +/** + * @name PathFitter + * @class + * @private + */ var PathFitter = Base.extend({ initialize: function(path, error) { this.points = []; diff --git a/src/path/PathFlattener.js b/src/path/PathFlattener.js index adb6cf4c..186e633c 100644 --- a/src/path/PathFlattener.js +++ b/src/path/PathFlattener.js @@ -10,6 +10,11 @@ * All rights reserved. */ +/** + * @name PathFlattener + * @class + * @private + */ var PathFlattener = Base.extend({ initialize: function(path) { this.curves = []; // The curve values as returned by getValues() diff --git a/src/ui/CanvasView.js b/src/ui/CanvasView.js index 03137cfb..a1253cb2 100644 --- a/src/ui/CanvasView.js +++ b/src/ui/CanvasView.js @@ -143,7 +143,7 @@ var CanvasView = View.extend(/** @lends CanvasView# */{ return false; } - return { + return /** @lends CanvasView# */{ /** * Returns true if event was stopped, false otherwise, whether handler * was called or not! diff --git a/src/util/Numerical.js b/src/util/Numerical.js index f5d717c0..3c6c4c51 100644 --- a/src/util/Numerical.js +++ b/src/util/Numerical.js @@ -10,6 +10,11 @@ * All rights reserved. */ +/** + * @name Numerical + * @namespace + * @private + */ var Numerical = new function() { // Lookup tables for abscissas and weights with values for n = 2 .. 16. @@ -75,7 +80,7 @@ var Numerical = new function() { }; } - return { + return /** @lends Numerical */{ TOLERANCE: TOLERANCE, // Precision when comparing against 0 EPSILON: EPSILON, From f97056e4b74fb0d55facd4cdc3f626c92b77c690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 29 Dec 2013 16:36:23 +0100 Subject: [PATCH 04/26] Change the way PaperScripts are executed in Node.js Requiring a PaperScript returns an initialize method which receives the Canvas argument. --- examples/Node.js/Tadpoles.js | 6 +++--- examples/Node.js/Tadpoles.pjs | 2 -- src/core/PaperScript.js | 24 +++++++++++++++--------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/examples/Node.js/Tadpoles.js b/examples/Node.js/Tadpoles.js index 47ed04d6..6aad6cf8 100644 --- a/examples/Node.js/Tadpoles.js +++ b/examples/Node.js/Tadpoles.js @@ -1,7 +1,7 @@ -require('paper'); -var paper = require('./Tadpoles.pjs'); +var paper = require('paper'); +var scope = require('./Tadpoles.pjs')(new paper.Canvas(1024, 768)); -paper.view.exportFrames({ +scope.view.exportFrames({ amount: 400, directory: __dirname, onComplete: function() { diff --git a/examples/Node.js/Tadpoles.pjs b/examples/Node.js/Tadpoles.pjs index 6db5b820..3b02c84d 100644 --- a/examples/Node.js/Tadpoles.pjs +++ b/examples/Node.js/Tadpoles.pjs @@ -1,5 +1,3 @@ -paper.setup(new Canvas(1024, 768)); - // Adapted from Flocking Processing example by Daniel Schiffman: // http://processing.org/learning/topics/flocking.html diff --git a/src/core/PaperScript.js b/src/core/PaperScript.js index a11224b0..e87c8aef 100644 --- a/src/core/PaperScript.js +++ b/src/core/PaperScript.js @@ -404,15 +404,21 @@ var PaperScript = Base.exports.PaperScript = (function(root) { path = require('path'); require.extensions['.pjs'] = function(module, uri) { - var source = compile(fs.readFileSync(uri, 'utf8')), - scope = new PaperScope(); - scope.__filename = uri; - scope.__dirname = path.dirname(uri); - // Expose core methods and values - scope.require = require; - scope.console = console; - execute(source, scope); - module.exports = scope; + // Requiring a PaperScript on Node.js returns an initialize method which + // needs to receive a Canvas object when called and returns the + // PaperScope. + module.exports = function(canvas) { + var source = compile(fs.readFileSync(uri, 'utf8')), + scope = new PaperScope(); + scope.setup(canvas); + scope.__filename = uri; + scope.__dirname = path.dirname(uri); + // Expose core methods and values + scope.require = require; + scope.console = console; + execute(source, scope); + return scope; + }; }; /*#*/ } // __options.environment == 'node' From 4b3c3e22ff1fe89eb691e6a86b151ea16c0178bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 29 Dec 2013 16:36:44 +0100 Subject: [PATCH 05/26] Update to latest Prepro.js that exposes all globals. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 44a6995c..f7063eb3 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ }, "devDependencies": { "uglify-js": "~2.3.6", - "prepro": "~0.8.0", + "prepro": "~0.8.1", "grunt": "~0.4.1", "grunt-contrib-uglify": "~0.2.2" }, From a26d1ed0fc1b363bd7bf0d107a788113ae6cad10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 29 Dec 2013 16:41:57 +0100 Subject: [PATCH 06/26] Instead of creating the actual canvas we can also just provide a size. --- examples/Node.js/Tadpoles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Node.js/Tadpoles.js b/examples/Node.js/Tadpoles.js index 6aad6cf8..6b025864 100644 --- a/examples/Node.js/Tadpoles.js +++ b/examples/Node.js/Tadpoles.js @@ -1,5 +1,5 @@ var paper = require('paper'); -var scope = require('./Tadpoles.pjs')(new paper.Canvas(1024, 768)); +var scope = require('./Tadpoles.pjs')(new paper.Size(1024, 768)); scope.view.exportFrames({ amount: 400, From 6654dca6bf28fd57298de3f746f408817fba3874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Mon, 30 Dec 2013 14:18:33 +0100 Subject: [PATCH 07/26] Improve precision of Numerical.findRoot() --- src/util/Numerical.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/util/Numerical.js b/src/util/Numerical.js index 3c6c4c51..d971ffea 100644 --- a/src/util/Numerical.js +++ b/src/util/Numerical.js @@ -119,13 +119,13 @@ var Numerical = new function() { findRoot: function(f, df, x, a, b, n, tolerance) { for (var i = 0; i < n; i++) { var fx = f(x), - dx = fx / df(x); + // Calculate a new candidate with the Newton-Raphson method. + dx = fx / df(x), + nx = x - dx; // See if we can trust the Newton-Raphson result. If not we use // bisection to find another candiate for Newton's method. if (abs(dx) < tolerance) - return x; - // Generate a candidate for Newton's method. - var nx = x - dx; + return nx; // Update the root-bounding interval and test for containment of // the candidate. If candidate is outside the root-bounding // interval, use bisection instead. @@ -140,6 +140,9 @@ var Numerical = new function() { x = nx >= b ? 0.5 * (a + b) : nx; } } + // Return the best result even though we haven't gotten close + // enough to the root... (In paper.js this never seems to happen). + return x; }, /** From 6a1154794255352013814cbe36b322f3c4846ce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Mon, 30 Dec 2013 14:20:05 +0100 Subject: [PATCH 08/26] Fix issue in Curve.getLength() for linear curves with sub-ranges. Closes #376. --- src/path/Curve.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/path/Curve.js b/src/path/Curve.js index a1bc7458..4622ca11 100644 --- a/src/path/Curve.js +++ b/src/path/Curve.js @@ -1091,12 +1091,13 @@ new function() { // Scope for methods that require numerical integration b = 1; var isZero = Numerical.isZero; // See if the curve is linear by checking p1 == c1 and p2 == c2 - if (isZero(v[0] - v[2]) && isZero(v[1] - v[3]) + if (a === 0 && b === 1 + && isZero(v[0] - v[2]) && isZero(v[1] - v[3]) && isZero(v[6] - v[4]) && isZero(v[7] - v[5])) { // Straight line var dx = v[6] - v[0], // p2x - p1x dy = v[7] - v[1]; // p2y - p1y - return (b - a) * Math.sqrt(dx * dx + dy * dy); + return Math.sqrt(dx * dx + dy * dy); } var ds = getLengthIntegrand(v); return Numerical.integrate(ds, a, b, getIterations(a, b)); From c197f531a407c76f3bbdbe5ab992c2198f8fa01b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Mon, 30 Dec 2013 23:34:19 +0100 Subject: [PATCH 09/26] Implement options.asString for Item#exportJSON() --- src/core/Base.js | 7 +++++-- src/item/Item.js | 9 ++++++--- src/project/Project.js | 9 ++++++--- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/core/Base.js b/src/core/Base.js index 73406462..04c78dff 100644 --- a/src/core/Base.js +++ b/src/core/Base.js @@ -40,7 +40,7 @@ Base.inject(/** @lends Base# */{ /** * Serializes this object to a JSON string. * - * @param {Object} [options={ precision: 5 }] + * @param {Object} [options={ asString: true, precision: 5 }] */ exportJSON: function(options) { return Base.exportJSON(this, options); @@ -433,7 +433,10 @@ Base.inject(/** @lends Base# */{ }, exportJSON: function(obj, options) { - return JSON.stringify(Base.serialize(obj, options)); + var json = Base.serialize(obj, options); + return options && options.asString === false + ? json + : JSON.stringify(json); }, importJSON: function(json, target) { diff --git a/src/item/Item.js b/src/item/Item.js index 4c0103ed..5027d8d5 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -1804,12 +1804,15 @@ var Item = Base.extend(Callback, /** @lends Item# */{ * data string. * * The options object offers control over some aspects of the SVG export: + * options.asString: {@code Boolean} – wether the JSON is returned as + * a {@code Object} or a {@code String}. * options.precision: {@code Number} – the amount of fractional * digits in numbers used in JSON data. * * @name Item#exportJSON * @function - * @param {Object} [options={ precision: 5 }] the serialization options + * @param {Object} [options={ asString: true, precision: 5 }] the + * serialization options * @return {String} the exported JSON data */ @@ -1836,8 +1839,8 @@ var Item = Base.extend(Callback, /** @lends Item# */{ * Exports the item with its content and child items as an SVG DOM. * * The options object offers control over some aspects of the SVG export: - * options.asString: {@code Boolean} – wether a SVG node or a String - * is to be returned. + * options.asString: {@code Boolean} – wether a SVG node or a + * {@code String} is to be returned. * options.precision: {@code Number} – the amount of fractional * digits in numbers used in SVG data. * options.matchShapes: {@code Boolean} – wether imported path diff --git a/src/project/Project.js b/src/project/Project.js index f7b09d3f..df1ebd88 100644 --- a/src/project/Project.js +++ b/src/project/Project.js @@ -335,12 +335,15 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{ * a JSON data string. * * The options object offers control over some aspects of the SVG export: + * options.asString: {@code Boolean} – wether the JSON is returned as + * a {@code Object} or a {@code String}. * options.precision: {@code Number} – the amount of fractional * digits in numbers used in JSON data. * * @name Project#exportJSON * @function - * @param {Object} [options={ precision: 5 }] the serialization options + * @param {Object} [options={ asString: true, precision: 5 }] the + * serialization options * @return {String} the exported JSON data */ @@ -364,8 +367,8 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{ * all contained in one top level SVG group node. * * The options object offers control over some aspects of the SVG export: - * options.asString: {@code Boolean} – wether a SVG node or a String - * is to be returned. + * options.asString: {@code Boolean} – wether a SVG node or a + * {@code String} is to be returned. * options.precision: {@code Number} – the amount of fractional * digits in numbers used in SVG data. * options.matchShapes: {@code Boolean} – wether imported path From 469aa18f1a888be2e7b2f1221f40f3f4a5c7b877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 2 Jan 2014 10:55:34 +0100 Subject: [PATCH 10/26] HitTesting example: Fix dragging of paths and segments. --- examples/Paperjs.org/HitTesting.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/Paperjs.org/HitTesting.html b/examples/Paperjs.org/HitTesting.html index a1c5f631..ec01d83c 100644 --- a/examples/Paperjs.org/HitTesting.html +++ b/examples/Paperjs.org/HitTesting.html @@ -89,12 +89,11 @@ function onMouseDrag(event) { if (segment) { - segment.point = event.point; + segment.point += event.delta; path.smooth(); - } - - if (movePath) + } else if (path) { path.position += event.delta; + } } From ad34bbf7aacab1a97dfbff1bc807873dd1bf07f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 2 Jan 2014 21:47:00 +0100 Subject: [PATCH 11/26] Bail out of Item#transform() immediately if there is nothing to do. --- src/item/Item.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/item/Item.js b/src/item/Item.js index 5027d8d5..5c11883b 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -2721,6 +2721,9 @@ var Item = Base.extend(Callback, /** @lends Item# */{ // 'children', 'fill-gradients', 'fill-patterns', 'stroke-patterns', // 'lines'. Default: ['objects', 'children'] transform: function(matrix /*, applyMatrix */) { + // Bail out immediatelly if there is nothing to do + if (matrix.isIdentity()) + return this; // Calling _changed will clear _bounds and _position, but depending // on matrix we can calculate and set them again. var bounds = this._bounds, From 541ac6acce6139e2cc0ab86710fddcff589ac332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 2 Jan 2014 21:47:20 +0100 Subject: [PATCH 12/26] Shorten code a bit. --- src/svg/SVGExport.js | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/svg/SVGExport.js b/src/svg/SVGExport.js index 1519c725..74cae6ef 100644 --- a/src/svg/SVGExport.js +++ b/src/svg/SVGExport.js @@ -55,24 +55,25 @@ new function() { attrs[center ? 'cy' : 'y'] = point.y; trans = null; } - if (matrix.isIdentity()) - return attrs; - // See if we can decompose the matrix and can formulate it as a simple - // translate/scale/rotate command sequence. - var decomposed = matrix.decompose(); - if (decomposed && !decomposed.shearing) { - var parts = [], - angle = decomposed.rotation, - scale = decomposed.scaling; - if (trans && !trans.isZero()) - parts.push('translate(' + formatter.point(trans) + ')'); - if (angle) - parts.push('rotate(' + formatter.number(angle) + ')'); - if (!Numerical.isZero(scale.x - 1) || !Numerical.isZero(scale.y - 1)) - parts.push('scale(' + formatter.point(scale) +')'); - attrs.transform = parts.join(' '); - } else { - attrs.transform = 'matrix(' + matrix.getValues().join(',') + ')'; + if (!matrix.isIdentity()) { + // See if we can decompose the matrix and can formulate it as a + // simple translate/scale/rotate command sequence. + var decomposed = matrix.decompose(); + if (decomposed && !decomposed.shearing) { + var parts = [], + angle = decomposed.rotation, + scale = decomposed.scaling; + if (trans && !trans.isZero()) + parts.push('translate(' + formatter.point(trans) + ')'); + if (angle) + parts.push('rotate(' + formatter.number(angle) + ')'); + if (!Numerical.isZero(scale.x - 1) + || !Numerical.isZero(scale.y - 1)) + parts.push('scale(' + formatter.point(scale) +')'); + attrs.transform = parts.join(' '); + } else { + attrs.transform = 'matrix(' + matrix.getValues().join(',') + ')'; + } } return attrs; } From 2d719c9c78427d4a8bd8a3c0b736c15b4fa32a65 Mon Sep 17 00:00:00 2001 From: Bruce MacNaughton Date: Thu, 2 Jan 2014 14:59:46 -0800 Subject: [PATCH 13/26] Updated README.md to include instructions for installation on Ubuntu/Debian Linux. --- README.md | 43 +++++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 9976378b..ede86bd8 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,11 @@ You can download prebuilt packages from . As of July 2013, the recommended way to install and maintain Paper.js is through Bower for browsers, and through NPM for Node.js. -See for a tutorial explaining how to install Node.js, NPM and Bower on OSX. +For OSX see for a tutorial explaining how to install Node.js, NPM and Bower. + +For Linux see to locate 32-bit and 64-bit nodejs binaries as well as sources. It is recommended that you download directly from the nodejs site; the version available via many OS-supplied package managers is out-of-date and doesn't work with many of the packages paper uses. NPM is now included with the nodejs distribution. Once nodejs (with npm) has been installed you can install bower using the following command: + + npm install -g bower With Bower installed, simply type this command in your project folder: @@ -22,26 +26,41 @@ With Bower installed, simply type this command in your project folder: Upon execution, you will find a `paper` folder inside the project's `component` folder. For more information on Bower and to learn about its features for dependence tracking, see . -## Installing for Node.js +## Installing Paper.js for Node.js Similarly you can use NPM to install Paper.js for Node.js. But before doing so, you need the Cairo Graphics library installed, see . -The easiest way to install Cairo on OSX is through Homebrew . +**For OSX:** + +The easiest way to install Cairo is install Homebrew then issue the command: brew install cairo -Once Homebrew has installed this for you, you can then install the Paper.js module: - - npm install paper - Note that currently there is an issue on OSX with Cairo. If the above causes errors, the following will most likely fix it: - PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig/ npm install paper + PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig/ npm insetall paper Also, whenever you would like to update the modules, you will need to execute: PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig/ npm update +**For Debian/Ubuntu Linux:** + + sudo apt-get install libcairo2-dev + +For Debian/Ubuntu you might also need these additional packages if you don't usually build from c++ sources: + + build-essential + libssl-dev + libjpeg8-dev + libgif-dev + +**After cairo has been installed:** + +Then install the Paper.js module: + + npm install paper + ## Development **Get the source (for building):** @@ -57,7 +76,7 @@ If you want to contribute to the project you will have to [make a fork](http://h ### Refreshing Your Clone -To fetch changes from origin, run +To fetch changes from origin (your fork), run git fetch origin @@ -73,11 +92,15 @@ To update the `jsdoc-toolkit` submodule inside the `build` folder, used to gener Paper.js has a couple of dependencies as Bower and NPM modules. See for a tutorial explaining how to install Node.js, NPM and Bower on OSX. -In order to be able to build Paper.js, these dependencies need to be installed first after checking out the repository: +In order to be able to build Paper.js, after checking out the repository, paper has dependencies that need to be installed. Install them by issuing the following commands from the paper.js directory: npm install bower install +You might find that the npm command fails attempting to fetch packages needed for dependencies due to using https (the default protocol to access the npm registry). If that is the case you can switch to using http for registry access with the following command: + + npm config set registry http://registry.npmjs.org/ + Next you need to create minified versions of some of these dependencies. This is handled by the `minify-components.sh` script inside the `build` folder: cd build From da0670f1f9c176f1a9deab7f97378219337a9757 Mon Sep 17 00:00:00 2001 From: Bruce MacNaughton Date: Thu, 2 Jan 2014 15:07:00 -0800 Subject: [PATCH 14/26] 1. Added cd into cloned directory. 2. Add push to remote origin as part of submitting a patch --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ede86bd8..812e1b70 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,7 @@ Then install the Paper.js module: If you want to contribute to the project you will have to [make a fork](http://help.github.com/forking/). Then do this: git clone --recursive git@github.com:yourusername/paper.js.git + cd paper.js git remote add upstream git://github.com/paperjs/paper.js.git ### Refreshing Your Clone @@ -168,7 +169,8 @@ As mentioned earlier in this article, we prefer that you send a [*pull request*] 3. This is important: Create a so-called *topic branch*: `git checkout -tb name-of-my-patch` where "name-of-my-patch" is a short but descriptive name of the patch you're about to create. Don't worry about the perfect name though -- you can change this name at any time later on. -4. Hack! Make your changes, additions, etc and commit them. +4. Hack! Make your changes, additions, etc., commit them then push them to your github fork: `git push origin name-of-my-patch` + 5. Send a pull request to the upstream repository's owner by visiting your repository's site at github (i.e. https://github.com/yourusername/paper.js) and press the "Pull Request" button. Here's a good guide on pull requests: From de939ab9391be79a6ac1dcf36f54635b8aec12ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Fri, 3 Jan 2014 18:31:07 +0100 Subject: [PATCH 15/26] Clean up code and comments. --- src/core/PaperScript.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/core/PaperScript.js b/src/core/PaperScript.js index e87c8aef..42eebca3 100644 --- a/src/core/PaperScript.js +++ b/src/core/PaperScript.js @@ -109,13 +109,12 @@ var PaperScript = Base.exports.PaperScript = (function(root) { */ function compile(code) { // Use Acorn or Esprima to translate the code into an AST structure - // which is then walked and parsed for operators to overload. - // Instead of modifying the AST and converting back to code, we directly - // change the source code based on the parser's range information, so we - // can preserve line-numbers in syntax errors and remove the need for - // Escodegen. + // which is then walked and parsed for operators to overload. Instead of + // modifying the AST and translating it back to code, we directly change + // the source code based on the parser's range information, to preserve + // line-numbers in syntax errors and remove the need for Escodegen. - // Tracks code insertions so we can add their differences to the + // Track code insertions so their differences can be added to the // original offsets. var insertions = []; @@ -143,8 +142,8 @@ var PaperScript = Base.exports.PaperScript = (function(root) { // information up-to-date. function replaceCode(node, str) { var start = getOffset(node.range[0]), - end = getOffset(node.range[1]); - var insert = 0; + end = getOffset(node.range[1]), + insert = 0; // Sort insertions by their offset, so getOffest() can do its thing for (var i = insertions.length - 1; i >= 0; i--) { if (start > insertions[i][0]) { From 4594b66fd6045ce52fead177c838a416a6f183cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Fri, 3 Jan 2014 19:45:00 +0100 Subject: [PATCH 16/26] Fix comments. --- src/core/PaperScript.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/PaperScript.js b/src/core/PaperScript.js index 42eebca3..b9aa5c2a 100644 --- a/src/core/PaperScript.js +++ b/src/core/PaperScript.js @@ -34,7 +34,7 @@ var PaperScript = Base.exports.PaperScript = (function(root) { // Operators to overload var binaryOperators = { - // The hidden math functions are to be injected specifically, see below. + // The hidden math methods are to be injected specifically, see below. '+': '__add', '-': '__subtract', '*': '__multiply', @@ -50,11 +50,11 @@ var PaperScript = Base.exports.PaperScript = (function(root) { '+': null }; - // Inject underscored math functions as aliases to Point, Size and Color. + // Inject underscored math methods as aliases to Point, Size and Color. var fields = Base.each( ['add', 'subtract', 'multiply', 'divide', 'modulo', 'negate'], function(name) { - // Create an alias for ach math function to be injected into the + // Create an alias for each math method to be injected into the // classes using Straps.js' #inject() this['__' + name] = '#' + name; }, From e22fa3a6641ef118a6520069095151f49bfebf02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 4 Jan 2014 01:47:16 +0100 Subject: [PATCH 17/26] Update copyright notice. --- AUTHORS.md | 2 +- LICENSE.txt | 4 ++-- build/build.sh | 4 ++-- build/dist.sh | 4 ++-- build/docs.sh | 4 ++-- build/load.sh | 4 ++-- build/minify-components.sh | 4 ++-- build/minify.sh | 4 ++-- build/preprocess.sh | 4 ++-- build/publish.sh | 4 ++-- build/typescript.sh | 4 ++-- build/zip.sh | 4 ++-- package.json | 2 +- src/basic/Line.js | 4 ++-- src/basic/Matrix.js | 4 ++-- src/basic/Point.js | 4 ++-- src/basic/Rectangle.js | 4 ++-- src/basic/Size.js | 4 ++-- src/canvas/BlendMode.js | 4 ++-- src/canvas/CanvasProvider.js | 4 ++-- src/canvas/ProxyContext.js | 4 ++-- src/constants.js | 4 ++-- src/core/Base.js | 7 +++---- src/core/Callback.js | 4 ++-- src/core/PaperScope.js | 4 ++-- src/core/PaperScopeItem.js | 4 ++-- src/core/PaperScript.js | 4 ++-- src/docs/global.js | 4 ++-- src/dom/DomElement.js | 4 ++-- src/dom/DomEvent.js | 4 ++-- src/dom/node.js | 4 ++-- src/export.js | 4 ++-- src/item/ChangeFlag.js | 4 ++-- src/item/Group.js | 4 ++-- src/item/HitResult.js | 4 ++-- src/item/Item.js | 4 ++-- src/item/Layer.js | 4 ++-- src/item/PlacedSymbol.js | 4 ++-- src/item/Raster.js | 4 ++-- src/item/Shape.js | 4 ++-- src/load.js | 4 ++-- src/net/Http.js | 4 ++-- src/options.js | 4 ++-- src/paper.js | 10 +++++----- src/path/CompoundPath.js | 4 ++-- src/path/Curve.js | 4 ++-- src/path/CurveLocation.js | 4 ++-- src/path/Path.Constructors.js | 4 ++-- src/path/Path.js | 4 ++-- src/path/PathFitter.js | 4 ++-- src/path/PathFlattener.js | 4 ++-- src/path/PathItem.Boolean.js | 4 ++-- src/path/PathItem.js | 4 ++-- src/path/Segment.js | 4 ++-- src/path/SegmentPoint.js | 4 ++-- src/path/SelectionState.js | 4 ++-- src/project/Project.js | 4 ++-- src/project/Symbol.js | 4 ++-- src/style/Color.js | 4 ++-- src/style/Gradient.js | 4 ++-- src/style/GradientStop.js | 4 ++-- src/style/Style.js | 4 ++-- src/svg/SVGExport.js | 4 ++-- src/svg/SVGImport.js | 4 ++-- src/svg/SVGNamespaces.js | 4 ++-- src/svg/SVGStyles.js | 4 ++-- src/text/PointText.js | 4 ++-- src/text/TextItem.js | 4 ++-- src/tool/Tool.js | 4 ++-- src/tool/ToolEvent.js | 4 ++-- src/ui/CanvasView.js | 4 ++-- src/ui/Component.js | 4 ++-- src/ui/Event.js | 4 ++-- src/ui/Key.js | 4 ++-- src/ui/KeyEvent.js | 4 ++-- src/ui/MouseEvent.js | 4 ++-- src/ui/Palette.js | 4 ++-- src/ui/View.js | 4 ++-- src/util/Formatter.js | 4 ++-- src/util/Numerical.js | 4 ++-- test/lib/helpers.js | 4 ++-- test/load.js | 4 ++-- test/tests/Color.js | 4 ++-- test/tests/CompoundPath.js | 4 ++-- test/tests/Curve.js | 4 ++-- test/tests/Group.js | 4 ++-- test/tests/HitResult.js | 4 ++-- test/tests/Item.js | 4 ++-- test/tests/Item_Bounds.js | 4 ++-- test/tests/Item_Cloning.js | 4 ++-- test/tests/Item_Contains.js | 4 ++-- test/tests/Item_Order.js | 4 ++-- test/tests/JSON.js | 4 ++-- test/tests/Layer.js | 4 ++-- test/tests/Matrix.js | 4 ++-- test/tests/Path.js | 4 ++-- test/tests/Path_Bounds.js | 4 ++-- test/tests/Path_Curves.js | 4 ++-- test/tests/Path_Drawing_Commands.js | 4 ++-- test/tests/Path_Length.js | 4 ++-- test/tests/Path_Shapes.js | 4 ++-- test/tests/PlacedSymbol.js | 4 ++-- test/tests/Point.js | 4 ++-- test/tests/Project.js | 4 ++-- test/tests/Raster.js | 4 ++-- test/tests/Rectangle.js | 4 ++-- test/tests/SVGExport.js | 4 ++-- test/tests/SVGImport.js | 4 ++-- test/tests/Segment.js | 4 ++-- test/tests/Size.js | 4 ++-- test/tests/Style.js | 4 ++-- test/tests/TextItem.js | 4 ++-- test/tests/load.js | 4 ++-- 113 files changed, 228 insertions(+), 229 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 46e21bd3..8b0438b3 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -1,6 +1,6 @@ ## Authors -- Juerg Lehni +- Juerg Lehni - Jonathan Puckey ## Contributors diff --git a/LICENSE.txt b/LICENSE.txt index f8619334..3c2bb41e 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,5 +1,5 @@ -Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey -http://lehni.org/ & http://jonathanpuckey.com/ +Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey +http://scratchdisk.com/ & http://jonathanpuckey.com/ All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/build/build.sh b/build/build.sh index 52cfbcb8..6274ff4b 100755 --- a/build/build.sh +++ b/build/build.sh @@ -3,8 +3,8 @@ # Paper.js - The Swiss Army Knife of Vector Graphics Scripting. # http://paperjs.org/ # -# Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey -# http://lehni.org/ & http://jonathanpuckey.com/ +# Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey +# http://scratchdisk.com/ & http://jonathanpuckey.com/ # # Distributed under the MIT license. See LICENSE file for details. # diff --git a/build/dist.sh b/build/dist.sh index 7fd72385..4a9bdf69 100755 --- a/build/dist.sh +++ b/build/dist.sh @@ -3,8 +3,8 @@ # Paper.js - The Swiss Army Knife of Vector Graphics Scripting. # http://paperjs.org/ # -# Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey -# http://lehni.org/ & http://jonathanpuckey.com/ +# Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey +# http://scratchdisk.com/ & http://jonathanpuckey.com/ # # Distributed under the MIT license. See LICENSE file for details. # diff --git a/build/docs.sh b/build/docs.sh index 690c2e50..95c8caaa 100755 --- a/build/docs.sh +++ b/build/docs.sh @@ -3,8 +3,8 @@ # Paper.js - The Swiss Army Knife of Vector Graphics Scripting. # http://paperjs.org/ # -# Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey -# http://lehni.org/ & http://jonathanpuckey.com/ +# Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey +# http://scratchdisk.com/ & http://jonathanpuckey.com/ # # Distributed under the MIT license. See LICENSE file for details. # diff --git a/build/load.sh b/build/load.sh index d04fb1b9..8b231cb9 100755 --- a/build/load.sh +++ b/build/load.sh @@ -3,8 +3,8 @@ # Paper.js - The Swiss Army Knife of Vector Graphics Scripting. # http://paperjs.org/ # -# Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey -# http://lehni.org/ & http://jonathanpuckey.com/ +# Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey +# http://scratchdisk.com/ & http://jonathanpuckey.com/ # # Distributed under the MIT license. See LICENSE file for details. # diff --git a/build/minify-components.sh b/build/minify-components.sh index ed33157f..82a4bdd6 100755 --- a/build/minify-components.sh +++ b/build/minify-components.sh @@ -3,8 +3,8 @@ # Paper.js - The Swiss Army Knife of Vector Graphics Scripting. # http://paperjs.org/ # -# Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey -# http://lehni.org/ & http://jonathanpuckey.com/ +# Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey +# http://scratchdisk.com/ & http://jonathanpuckey.com/ # # Distributed under the MIT license. See LICENSE file for details. # diff --git a/build/minify.sh b/build/minify.sh index 658fc982..7b12133e 100755 --- a/build/minify.sh +++ b/build/minify.sh @@ -3,8 +3,8 @@ # Paper.js - The Swiss Army Knife of Vector Graphics Scripting. # http://paperjs.org/ # -# Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey -# http://lehni.org/ & http://jonathanpuckey.com/ +# Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey +# http://scratchdisk.com/ & http://jonathanpuckey.com/ # # Distributed under the MIT license. See LICENSE file for details. # diff --git a/build/preprocess.sh b/build/preprocess.sh index 00801c4a..eb20a20a 100755 --- a/build/preprocess.sh +++ b/build/preprocess.sh @@ -3,8 +3,8 @@ # Paper.js - The Swiss Army Knife of Vector Graphics Scripting. # http://paperjs.org/ # -# Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey -# http://lehni.org/ & http://jonathanpuckey.com/ +# Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey +# http://scratchdisk.com/ & http://jonathanpuckey.com/ # # Distributed under the MIT license. See LICENSE file for details. # diff --git a/build/publish.sh b/build/publish.sh index e42c2359..7d839821 100755 --- a/build/publish.sh +++ b/build/publish.sh @@ -3,8 +3,8 @@ # Paper.js - The Swiss Army Knife of Vector Graphics Scripting. # http://paperjs.org/ # -# Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey -# http://lehni.org/ & http://jonathanpuckey.com/ +# Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey +# http://scratchdisk.com/ & http://jonathanpuckey.com/ # # Distributed under the MIT license. See LICENSE file for details. # diff --git a/build/typescript.sh b/build/typescript.sh index 4320a2f2..8f2f6439 100755 --- a/build/typescript.sh +++ b/build/typescript.sh @@ -3,8 +3,8 @@ # Paper.js - The Swiss Army Knife of Vector Graphics Scripting. # http://paperjs.org/ # -# Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey -# http://lehni.org/ & http://jonathanpuckey.com/ +# Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey +# http://scratchdisk.com/ & http://jonathanpuckey.com/ # # Distributed under the MIT license. See LICENSE file for details. # diff --git a/build/zip.sh b/build/zip.sh index cf0ee013..16b22d6e 100755 --- a/build/zip.sh +++ b/build/zip.sh @@ -3,8 +3,8 @@ # Paper.js - The Swiss Army Knife of Vector Graphics Scripting. # http://paperjs.org/ # -# Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey -# http://lehni.org/ & http://jonathanpuckey.com/ +# Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey +# http://scratchdisk.com/ & http://jonathanpuckey.com/ # # Distributed under the MIT license. See LICENSE file for details. # diff --git a/package.json b/package.json index f7063eb3..d1c3a009 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "homepage": "http://paperjs.org", "repository": "git://github.com/paperjs/paper.js", "contributors": [ - "Jürg Lehni (http://lehni.org)", + "Jürg Lehni (http://scratchdisk.com)", "Jonathan Puckey (http://studiomoniker.com)" ], "main": "./dist/paper-node.js", diff --git a/src/basic/Line.js b/src/basic/Line.js index 93e2434b..447a5802 100644 --- a/src/basic/Line.js +++ b/src/basic/Line.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/basic/Matrix.js b/src/basic/Matrix.js index dce19957..4b01d341 100644 --- a/src/basic/Matrix.js +++ b/src/basic/Matrix.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/basic/Point.js b/src/basic/Point.js index 5597358d..bcd1e2f0 100644 --- a/src/basic/Point.js +++ b/src/basic/Point.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/basic/Rectangle.js b/src/basic/Rectangle.js index 376e7589..5a1a6691 100644 --- a/src/basic/Rectangle.js +++ b/src/basic/Rectangle.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/basic/Size.js b/src/basic/Size.js index cb85e01c..710b3ff2 100644 --- a/src/basic/Size.js +++ b/src/basic/Size.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/canvas/BlendMode.js b/src/canvas/BlendMode.js index 3fadee81..c3ccc3dd 100644 --- a/src/canvas/BlendMode.js +++ b/src/canvas/BlendMode.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/canvas/CanvasProvider.js b/src/canvas/CanvasProvider.js index 84594fac..f70eaa47 100644 --- a/src/canvas/CanvasProvider.js +++ b/src/canvas/CanvasProvider.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/canvas/ProxyContext.js b/src/canvas/ProxyContext.js index 19c72ba6..70e2ad39 100644 --- a/src/canvas/ProxyContext.js +++ b/src/canvas/ProxyContext.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/constants.js b/src/constants.js index 51e5e364..6b1dd923 100644 --- a/src/constants.js +++ b/src/constants.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/core/Base.js b/src/core/Base.js index 04c78dff..de83d418 100644 --- a/src/core/Base.js +++ b/src/core/Base.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * @@ -15,8 +15,7 @@ * @class * @private */ -// Extend Base with utility functions used across the library. Also set -// this.Base on the injection scope, since straps.js ommits that. +// Extend Base with utility functions used across the library. Base.inject(/** @lends Base# */{ /** * Renders base objects to strings in object literal notation. diff --git a/src/core/Callback.js b/src/core/Callback.js index 33838d29..080e023b 100644 --- a/src/core/Callback.js +++ b/src/core/Callback.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/core/PaperScope.js b/src/core/PaperScope.js index 5061f7f0..ec0b2c14 100644 --- a/src/core/PaperScope.js +++ b/src/core/PaperScope.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/core/PaperScopeItem.js b/src/core/PaperScopeItem.js index 610d8069..b1344048 100644 --- a/src/core/PaperScopeItem.js +++ b/src/core/PaperScopeItem.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/core/PaperScript.js b/src/core/PaperScript.js index b9aa5c2a..ee58b9eb 100644 --- a/src/core/PaperScript.js +++ b/src/core/PaperScript.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/docs/global.js b/src/docs/global.js index 979ea441..3a33ab89 100644 --- a/src/docs/global.js +++ b/src/docs/global.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/dom/DomElement.js b/src/dom/DomElement.js index 15a38fca..624df695 100644 --- a/src/dom/DomElement.js +++ b/src/dom/DomElement.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/dom/DomEvent.js b/src/dom/DomEvent.js index 70f2e33b..3426edfa 100644 --- a/src/dom/DomEvent.js +++ b/src/dom/DomEvent.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/dom/node.js b/src/dom/node.js index 4b391ba9..d31840ed 100644 --- a/src/dom/node.js +++ b/src/dom/node.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/export.js b/src/export.js index c9bc9e32..014ff75f 100644 --- a/src/export.js +++ b/src/export.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/item/ChangeFlag.js b/src/item/ChangeFlag.js index 23b825b2..0ae08015 100644 --- a/src/item/ChangeFlag.js +++ b/src/item/ChangeFlag.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/item/Group.js b/src/item/Group.js index a478221e..ed4bc05c 100644 --- a/src/item/Group.js +++ b/src/item/Group.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/item/HitResult.js b/src/item/HitResult.js index 83eb80e8..16f97fcd 100644 --- a/src/item/HitResult.js +++ b/src/item/HitResult.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/item/Item.js b/src/item/Item.js index 5c11883b..1eb4e4be 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/item/Layer.js b/src/item/Layer.js index 16afd1ce..e4d6424e 100644 --- a/src/item/Layer.js +++ b/src/item/Layer.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/item/PlacedSymbol.js b/src/item/PlacedSymbol.js index 4277c44f..e498b7a0 100644 --- a/src/item/PlacedSymbol.js +++ b/src/item/PlacedSymbol.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/item/Raster.js b/src/item/Raster.js index 13e8dbd0..88fa275d 100644 --- a/src/item/Raster.js +++ b/src/item/Raster.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/item/Shape.js b/src/item/Shape.js index 3e6ce6cd..8f847ab8 100644 --- a/src/item/Shape.js +++ b/src/item/Shape.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/load.js b/src/load.js index a679cfa3..ddbf4854 100644 --- a/src/load.js +++ b/src/load.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/net/Http.js b/src/net/Http.js index d4d05832..662bbcc1 100644 --- a/src/net/Http.js +++ b/src/net/Http.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/options.js b/src/options.js index 4c5f915a..55bc09d8 100644 --- a/src/options.js +++ b/src/options.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/paper.js b/src/paper.js index 3b695514..fe82b5d8 100644 --- a/src/paper.js +++ b/src/paper.js @@ -2,8 +2,8 @@ * Paper.js v*#=* __options.version - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * @@ -13,16 +13,16 @@ * *** * - * straps.js - Class inheritance library with support for bean-style accessors + * Straps.js - Class inheritance library with support for bean-style accessors * * Copyright (c) 2006 - 2013 Juerg Lehni - * http://lehni.org/ + * http://scratchdisk.com/ * * Distributed under the MIT license. * *** * - * acorn.js + * Acorn.js * http://marijnhaverbeke.nl/acorn/ * * Acorn is a tiny, fast JavaScript parser written in JavaScript, diff --git a/src/path/CompoundPath.js b/src/path/CompoundPath.js index 3b648f0d..202737aa 100644 --- a/src/path/CompoundPath.js +++ b/src/path/CompoundPath.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/path/Curve.js b/src/path/Curve.js index 4622ca11..abccbddb 100644 --- a/src/path/Curve.js +++ b/src/path/Curve.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/path/CurveLocation.js b/src/path/CurveLocation.js index b4ade4db..f04845c5 100644 --- a/src/path/CurveLocation.js +++ b/src/path/CurveLocation.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/path/Path.Constructors.js b/src/path/Path.Constructors.js index 004f4b71..967b1ad9 100644 --- a/src/path/Path.Constructors.js +++ b/src/path/Path.Constructors.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/path/Path.js b/src/path/Path.js index 272481ec..74fbf5cb 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/path/PathFitter.js b/src/path/PathFitter.js index 86b79c84..3b1d0d42 100644 --- a/src/path/PathFitter.js +++ b/src/path/PathFitter.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/path/PathFlattener.js b/src/path/PathFlattener.js index 186e633c..81b5085e 100644 --- a/src/path/PathFlattener.js +++ b/src/path/PathFlattener.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/path/PathItem.Boolean.js b/src/path/PathItem.Boolean.js index c8e0c81d..de8ea9f5 100644 --- a/src/path/PathItem.Boolean.js +++ b/src/path/PathItem.Boolean.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/path/PathItem.js b/src/path/PathItem.js index 64ce13fa..4f65ac22 100644 --- a/src/path/PathItem.js +++ b/src/path/PathItem.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/path/Segment.js b/src/path/Segment.js index a1791cf6..21342588 100644 --- a/src/path/Segment.js +++ b/src/path/Segment.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/path/SegmentPoint.js b/src/path/SegmentPoint.js index f191f08f..113897cf 100644 --- a/src/path/SegmentPoint.js +++ b/src/path/SegmentPoint.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/path/SelectionState.js b/src/path/SelectionState.js index 3252cbe2..d822308e 100644 --- a/src/path/SelectionState.js +++ b/src/path/SelectionState.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/project/Project.js b/src/project/Project.js index df1ebd88..ea404777 100644 --- a/src/project/Project.js +++ b/src/project/Project.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/project/Symbol.js b/src/project/Symbol.js index 7db868b5..5a480350 100644 --- a/src/project/Symbol.js +++ b/src/project/Symbol.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/style/Color.js b/src/style/Color.js index 2ae7bd95..97ce49e1 100644 --- a/src/style/Color.js +++ b/src/style/Color.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/style/Gradient.js b/src/style/Gradient.js index c8f58400..465dfd24 100644 --- a/src/style/Gradient.js +++ b/src/style/Gradient.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/style/GradientStop.js b/src/style/GradientStop.js index fc1baae7..7b75de3a 100644 --- a/src/style/GradientStop.js +++ b/src/style/GradientStop.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/style/Style.js b/src/style/Style.js index 8719f9bc..28bc56d6 100644 --- a/src/style/Style.js +++ b/src/style/Style.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/svg/SVGExport.js b/src/svg/SVGExport.js index 74cae6ef..21eb7588 100644 --- a/src/svg/SVGExport.js +++ b/src/svg/SVGExport.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/svg/SVGImport.js b/src/svg/SVGImport.js index 0fb63f12..4fac29b6 100644 --- a/src/svg/SVGImport.js +++ b/src/svg/SVGImport.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/svg/SVGNamespaces.js b/src/svg/SVGNamespaces.js index e0816a4d..81fe7617 100644 --- a/src/svg/SVGNamespaces.js +++ b/src/svg/SVGNamespaces.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/svg/SVGStyles.js b/src/svg/SVGStyles.js index ba45e554..521650fb 100644 --- a/src/svg/SVGStyles.js +++ b/src/svg/SVGStyles.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/text/PointText.js b/src/text/PointText.js index 4db8268b..97c782bb 100644 --- a/src/text/PointText.js +++ b/src/text/PointText.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/text/TextItem.js b/src/text/TextItem.js index 35cd6efa..55ed163a 100644 --- a/src/text/TextItem.js +++ b/src/text/TextItem.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/tool/Tool.js b/src/tool/Tool.js index 2f72c55e..0d02490d 100644 --- a/src/tool/Tool.js +++ b/src/tool/Tool.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/tool/ToolEvent.js b/src/tool/ToolEvent.js index c1450020..45fa4040 100644 --- a/src/tool/ToolEvent.js +++ b/src/tool/ToolEvent.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/ui/CanvasView.js b/src/ui/CanvasView.js index a1253cb2..83419c11 100644 --- a/src/ui/CanvasView.js +++ b/src/ui/CanvasView.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/ui/Component.js b/src/ui/Component.js index 67b762ac..7fed1d50 100644 --- a/src/ui/Component.js +++ b/src/ui/Component.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/ui/Event.js b/src/ui/Event.js index 0ad74981..a49bdac0 100644 --- a/src/ui/Event.js +++ b/src/ui/Event.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/ui/Key.js b/src/ui/Key.js index db55cda6..13d65b74 100644 --- a/src/ui/Key.js +++ b/src/ui/Key.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/ui/KeyEvent.js b/src/ui/KeyEvent.js index 0dc13c32..47966caa 100644 --- a/src/ui/KeyEvent.js +++ b/src/ui/KeyEvent.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/ui/MouseEvent.js b/src/ui/MouseEvent.js index d780ae3d..cd27f4b7 100644 --- a/src/ui/MouseEvent.js +++ b/src/ui/MouseEvent.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/ui/Palette.js b/src/ui/Palette.js index 811c1a3d..2e691713 100644 --- a/src/ui/Palette.js +++ b/src/ui/Palette.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/ui/View.js b/src/ui/View.js index db0b8969..ac48a49d 100644 --- a/src/ui/View.js +++ b/src/ui/View.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/util/Formatter.js b/src/util/Formatter.js index fe4036cd..707ab8f9 100644 --- a/src/util/Formatter.js +++ b/src/util/Formatter.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/src/util/Numerical.js b/src/util/Numerical.js index d971ffea..7d81a1e7 100644 --- a/src/util/Numerical.js +++ b/src/util/Numerical.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/lib/helpers.js b/test/lib/helpers.js index dfb53cb2..67e56053 100644 --- a/test/lib/helpers.js +++ b/test/lib/helpers.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/load.js b/test/load.js index 629aac36..2a70ae25 100644 --- a/test/load.js +++ b/test/load.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/Color.js b/test/tests/Color.js index 41bbe34f..7a426ec1 100644 --- a/test/tests/Color.js +++ b/test/tests/Color.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/CompoundPath.js b/test/tests/CompoundPath.js index 1b3a2b0e..74c346ba 100644 --- a/test/tests/CompoundPath.js +++ b/test/tests/CompoundPath.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/Curve.js b/test/tests/Curve.js index 3c285f42..8c7b85ac 100644 --- a/test/tests/Curve.js +++ b/test/tests/Curve.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/Group.js b/test/tests/Group.js index c29a3c13..85f992d4 100644 --- a/test/tests/Group.js +++ b/test/tests/Group.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/HitResult.js b/test/tests/HitResult.js index 2d4446b6..a21d0836 100644 --- a/test/tests/HitResult.js +++ b/test/tests/HitResult.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/Item.js b/test/tests/Item.js index 251db2c8..e09699b3 100644 --- a/test/tests/Item.js +++ b/test/tests/Item.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/Item_Bounds.js b/test/tests/Item_Bounds.js index 3f7c35be..d8346a20 100644 --- a/test/tests/Item_Bounds.js +++ b/test/tests/Item_Bounds.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/Item_Cloning.js b/test/tests/Item_Cloning.js index ff434701..ab752c9b 100644 --- a/test/tests/Item_Cloning.js +++ b/test/tests/Item_Cloning.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/Item_Contains.js b/test/tests/Item_Contains.js index c26d20cb..d419e4f2 100644 --- a/test/tests/Item_Contains.js +++ b/test/tests/Item_Contains.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/Item_Order.js b/test/tests/Item_Order.js index 9d295fac..0f809c22 100644 --- a/test/tests/Item_Order.js +++ b/test/tests/Item_Order.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/JSON.js b/test/tests/JSON.js index a9035dc9..f233a6a1 100644 --- a/test/tests/JSON.js +++ b/test/tests/JSON.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/Layer.js b/test/tests/Layer.js index 48a56f0d..a0297d3b 100644 --- a/test/tests/Layer.js +++ b/test/tests/Layer.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/Matrix.js b/test/tests/Matrix.js index 89c10c2b..25e1330a 100644 --- a/test/tests/Matrix.js +++ b/test/tests/Matrix.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/Path.js b/test/tests/Path.js index 299b817a..15d0a3cf 100644 --- a/test/tests/Path.js +++ b/test/tests/Path.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/Path_Bounds.js b/test/tests/Path_Bounds.js index 659e0acd..20196b13 100644 --- a/test/tests/Path_Bounds.js +++ b/test/tests/Path_Bounds.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/Path_Curves.js b/test/tests/Path_Curves.js index e9c512e4..2e45a20f 100644 --- a/test/tests/Path_Curves.js +++ b/test/tests/Path_Curves.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/Path_Drawing_Commands.js b/test/tests/Path_Drawing_Commands.js index d4f9b7bb..70054eb7 100644 --- a/test/tests/Path_Drawing_Commands.js +++ b/test/tests/Path_Drawing_Commands.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/Path_Length.js b/test/tests/Path_Length.js index 8241e551..ee0d91a6 100644 --- a/test/tests/Path_Length.js +++ b/test/tests/Path_Length.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/Path_Shapes.js b/test/tests/Path_Shapes.js index 9b91f24a..f5c3f05f 100644 --- a/test/tests/Path_Shapes.js +++ b/test/tests/Path_Shapes.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/PlacedSymbol.js b/test/tests/PlacedSymbol.js index a085d3da..63682672 100644 --- a/test/tests/PlacedSymbol.js +++ b/test/tests/PlacedSymbol.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/Point.js b/test/tests/Point.js index 9ad47e4b..5cebde0b 100644 --- a/test/tests/Point.js +++ b/test/tests/Point.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/Project.js b/test/tests/Project.js index 12458205..f41cc21d 100644 --- a/test/tests/Project.js +++ b/test/tests/Project.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/Raster.js b/test/tests/Raster.js index 551b76f2..613cba70 100644 --- a/test/tests/Raster.js +++ b/test/tests/Raster.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/Rectangle.js b/test/tests/Rectangle.js index 2f877742..07b1f406 100644 --- a/test/tests/Rectangle.js +++ b/test/tests/Rectangle.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/SVGExport.js b/test/tests/SVGExport.js index 2e7b8caf..4ad73dc8 100644 --- a/test/tests/SVGExport.js +++ b/test/tests/SVGExport.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/SVGImport.js b/test/tests/SVGImport.js index 395e572b..14db3956 100644 --- a/test/tests/SVGImport.js +++ b/test/tests/SVGImport.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/Segment.js b/test/tests/Segment.js index cabf0d68..492a8c5d 100644 --- a/test/tests/Segment.js +++ b/test/tests/Segment.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/Size.js b/test/tests/Size.js index 70ca9c2e..93b75028 100644 --- a/test/tests/Size.js +++ b/test/tests/Size.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/Style.js b/test/tests/Style.js index af6a7aae..88e051ab 100644 --- a/test/tests/Style.js +++ b/test/tests/Style.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/TextItem.js b/test/tests/TextItem.js index 94daeb4a..2afc32e3 100644 --- a/test/tests/TextItem.js +++ b/test/tests/TextItem.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * diff --git a/test/tests/load.js b/test/tests/load.js index 107d163a..986cc42a 100644 --- a/test/tests/load.js +++ b/test/tests/load.js @@ -2,8 +2,8 @@ * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ * - * Copyright (c) 2011 - 2013, Juerg Lehni & Jonathan Puckey - * http://lehni.org/ & http://jonathanpuckey.com/ + * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey + * http://scratchdisk.com/ & http://jonathanpuckey.com/ * * Distributed under the MIT license. See LICENSE file for details. * From bd4f48ca1a8afe903941f1ab94bb517aa1288c00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 4 Jan 2014 17:33:20 +0100 Subject: [PATCH 18/26] Fix bounds check for mousemove events. Closes #369 --- src/ui/View.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ui/View.js b/src/ui/View.js index ac48a49d..c93f2d1e 100644 --- a/src/ui/View.js +++ b/src/ui/View.js @@ -706,8 +706,7 @@ var View = Base.extend(Callback, /** @lends View# */{ } if (view) { var point = viewToProject(view, event); - if (dragging || new Rectangle(new Point(), - view.getViewSize()).contains(point)) + if (dragging || view.getBounds().contains(point)) tool = handleMouseMove(view, point, event); } } From 8f2f38c41b1e4fbadbc822fdd0ff407ab0b2e744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 4 Jan 2014 17:38:48 +0100 Subject: [PATCH 19/26] Simplify Debian/Ubuntu instructions a bit. --- README.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 812e1b70..277b4d95 100644 --- a/README.md +++ b/README.md @@ -48,12 +48,9 @@ Also, whenever you would like to update the modules, you will need to execute: sudo apt-get install libcairo2-dev -For Debian/Ubuntu you might also need these additional packages if you don't usually build from c++ sources: +You might also need these additional packages if you don't usually build from c++ sources: - build-essential - libssl-dev - libjpeg8-dev - libgif-dev + sudo apt-get install build-essential libssl-dev libjpeg8-dev libgif-dev **After cairo has been installed:** From bb77da22a8a5ebcabbea2822bfb9f1f3f0e972a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 4 Jan 2014 17:43:33 +0100 Subject: [PATCH 20/26] Some more streamlining of README instructions. --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 277b4d95..9c66024d 100644 --- a/README.md +++ b/README.md @@ -26,11 +26,11 @@ With Bower installed, simply type this command in your project folder: Upon execution, you will find a `paper` folder inside the project's `component` folder. For more information on Bower and to learn about its features for dependence tracking, see . -## Installing Paper.js for Node.js +## Installing Paper.js for Node.js through NPM -Similarly you can use NPM to install Paper.js for Node.js. But before doing so, you need the Cairo Graphics library installed, see . +You can also use NPM to install Paper.js for Node.js. But before doing so, you need the Cairo Graphics library installed, see . -**For OSX:** +**Installing Cairo on OSX:** The easiest way to install Cairo is install Homebrew then issue the command: @@ -44,7 +44,7 @@ Also, whenever you would like to update the modules, you will need to execute: PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig/ npm update -**For Debian/Ubuntu Linux:** +**Installing Cairo on Debian/Ubuntu Linux:** sudo apt-get install libcairo2-dev @@ -52,9 +52,9 @@ You might also need these additional packages if you don't usually build from c+ sudo apt-get install build-essential libssl-dev libjpeg8-dev libgif-dev -**After cairo has been installed:** +**Ater Cairo has been installed:** -Then install the Paper.js module: +You should now be able to install the Paper.js module from NPM: npm install paper From 0dddd897ab3894761b1aab657990cd24b52cb437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 4 Jan 2014 18:16:52 +0100 Subject: [PATCH 21/26] Remove internal clamping of color values to facilitate proper mathematical calculations with colors. Clamp only when producing CSS values. Closes #271. --- src/core/Base.js | 5 --- src/style/Color.js | 89 ++++++++++++++++-------------------------- test/tests/Color.js | 12 +++++- test/tests/TextItem.js | 2 +- 4 files changed, 45 insertions(+), 63 deletions(-) diff --git a/src/core/Base.js b/src/core/Base.js index de83d418..9437fd98 100644 --- a/src/core/Base.js +++ b/src/core/Base.js @@ -179,9 +179,6 @@ Base.inject(/** @lends Base# */{ obj = Base.create(this.prototype); if (readIndex) obj.__read = true; - // If options were provided, pass them on to the constructed object - if (options) - obj.__options = options; obj = obj.initialize.apply(obj, index > 0 || length < list.length ? Array.prototype.slice.call(list, index, index + length) : list) || obj; @@ -191,8 +188,6 @@ Base.inject(/** @lends Base# */{ // last read() call list.__read = obj.__read; delete obj.__read; - if (options) - delete obj.__options; } return obj; }, diff --git a/src/style/Color.js b/src/style/Color.js index 97ce49e1..aa3807ae 100644 --- a/src/style/Color.js +++ b/src/style/Color.js @@ -247,23 +247,20 @@ var Color = Base.extend(new function() { } return value; } - : name === 'hue' - ? function(value) { - // Keep negative values within modulo 360 too: - return isNaN(value) ? 0 - : ((value % 360) + 360) % 360; + : type === 'gradient' + ? function(/* value */) { + return Point.read(arguments, 0, 0, { + readNull: name === 'highlight', + clone: true + }); } - : type === 'gradient' - ? function(/* value */) { - return Point.read(arguments, 0, 0, { - readNull: name === 'highlight', - clone: true - }); - } - : function(value) { - return isNaN(value) ? 0 - : Math.min(Math.max(value, 0), 1); - }; + : function(value) { + // NOTE: We don't clamp values here, they're only + // clamped once the actual CSS values are produced. + // Gotta love the fact that isNaN(null) is false, + // while isNaN(undefined) is true. + return value == null || isNaN(value) ? 0 : value; + }; this['get' + part] = function() { return this._type === type @@ -401,7 +398,7 @@ var Color = Base.extend(new function() { * // the path and to position the gradient color: * var topLeft = view.center - [80, 80]; * var bottomRight = view.center + [80, 80]; - * + * * var path = new Path.Rectangle({ * topLeft: topLeft, * bottomRight: bottomRight, @@ -489,7 +486,6 @@ var Color = Base.extend(new function() { var slice = Array.prototype.slice, args = arguments, read = 0, - parse = true, type, components, alpha, @@ -520,8 +516,6 @@ var Color = Base.extend(new function() { } } if (!components) { - // Only parse values if we're not told to not do so - parse = !(this.__options && this.__options.dontParse); // Determine if there is a values array values = argType === 'number' ? args @@ -586,7 +580,7 @@ var Color = Base.extend(new function() { : 'rgb'; // Convert to array and parse in one loop, for efficiency var properties = types[type]; - parsers = parse && componentParsers[type]; + parsers = componentParsers[type]; this._components = components = []; for (var i = 0, l = properties.length; i < l; i++) { var value = arg[properties[i]]; @@ -600,8 +594,7 @@ var Color = Base.extend(new function() { radial: arg.radial }; } - if (parse) - value = parsers[i].call(this, value); + value = parsers[i].call(this, value); if (value != null) components[i] = value; } @@ -623,9 +616,7 @@ var Color = Base.extend(new function() { this._components = components = []; var parsers = componentParsers[this._type]; for (var i = 0, l = parsers.length; i < l; i++) { - var value = values && values[i]; - if (parse) - value = parsers[i].call(this, value); + var value = parsers[i].call(this, values && values[i]); if (value != null) components[i] = value; } @@ -815,13 +806,16 @@ var Color = Base.extend(new function() { // TODO: Support HSL / HSLA CSS3 colors directly, without conversion var components = this._convert('rgb'), alpha = hex || this._alpha == null ? 1 : this._alpha; + function convert(val) { + return Math.round((val < 0 ? 0 : val > 1 ? 1 : val) * 255); + } components = [ - Math.round(components[0] * 255), - Math.round(components[1] * 255), - Math.round(components[2] * 255) + convert(components[0]), + convert(components[1]), + convert(components[2]) ]; if (alpha < 1) - components.push(alpha); + components.push(val < 0 ? 0 : val); return hex ? '#' + ((1 << 24) + (components[0] << 16) + (components[1] << 8) @@ -1119,48 +1113,33 @@ var Color = Base.extend(new function() { } }); }, new function() { - function clamp(value, hue) { - return value < 0 - ? 0 - : hue && value > 360 - ? 360 - : !hue && value > 1 - ? 1 - : value; - } - var operators = { - add: function(a, b, hue) { - return clamp(a + b, hue); + add: function(a, b) { + return a + b; }, - subtract: function(a, b, hue) { - return clamp(a - b, hue); + subtract: function(a, b) { + return a - b; }, - multiply: function(a, b, hue) { - return clamp(a * b, hue); + multiply: function(a, b) { + return a * b; }, - divide: function(a, b, hue) { - return clamp(a / b, hue); + divide: function(a, b) { + return a / b; } }; return Base.each(operators, function(operator, name) { - // Tell the argument reader not to parse values for multiply and divide, - // so the are not clamped yet. - var options = { dontParse: /^(multiply|divide)$/.test(name) }; - this[name] = function(color) { - color = Color.read(arguments, 0, 0, options); + color = Color.read(arguments, 0, 0); var type = this._type, properties = this._properties, components1 = this._components, components2 = color._convert(type); for (var i = 0, l = components1.length; i < l; i++) - components2[i] = operator(components1[i], components2[i], - properties[i] === 'hue'); + components2[i] = operator(components1[i], components2[i]); return new Color(type, components2, this._alpha != null ? operator(this._alpha, color.getAlpha()) diff --git a/test/tests/Color.js b/test/tests/Color.js index 7a426ec1..6f8a51b0 100644 --- a/test/tests/Color.js +++ b/test/tests/Color.js @@ -51,6 +51,14 @@ test('Set color to array', function() { }); test('Creating Colors', function() { + compareColors(new Color(), new Color(0, 0, 0), + 'Color with no arguments should be black'); + + compareColors(new Color('black'), new Color(0, 0, 0), + 'Color from name (black)'); + + compareColors(new Color('red'), new Color(1, 0, 0), + 'Color from name (red)'); compareColors(new Color('#ff0000'), new Color(1, 0, 0), 'Color from hex code'); @@ -203,7 +211,7 @@ test('Saturation from black rgb', function() { test('Color#add', function() { var color = new Color(0, 1, 1); compareColors(color.add([1, 0, 0]), [1, 1, 1]); - compareColors(color.add([1, 0.5, 0]), [1, 1, 1]); + compareColors(color.add([1, 0.5, 0]), [1, 1.5, 1]); var color = new Color(0, 0.5, 0); compareColors(color.add(0.5), [0.5, 1, 0.5]); }); @@ -229,7 +237,7 @@ test('Color#divide', function() { var color = new Color(1, 1, 1); compareColors(color.divide([1, 2, 4]), [1, 0.5, 0.25]); var color = new Color(1, 0.5, 0.25); - compareColors(color.divide(0.25), [1, 1, 1]); + compareColors(color.divide(0.25), [4, 2, 1]); var color = new Color(1, 1, 1); compareColors(color.divide(4), [0.25, 0.25, 0.25]); }); diff --git a/test/tests/TextItem.js b/test/tests/TextItem.js index 2afc32e3..1aecea59 100644 --- a/test/tests/TextItem.js +++ b/test/tests/TextItem.js @@ -19,7 +19,7 @@ test('PointText', function() { point: [100, 100], content: 'Hello World!' }); - equals(text.fillColor, { red: 0, green: 0, blue: 0 }, 'text.fillColor should be black by default'); + compareColors(text.fillColor, new Color(0, 0, 0), 'text.fillColor should be black by default'); comparePoints(text.point, { x: 100, y: 100 }); compareRectangles(text.bounds, { x: 100, y: 87.4, width: 77, height: 16.8 }); equals(function() { From 42bed586240c4e94b82988277f301e4dbff3cbdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 4 Jan 2014 19:01:17 +0100 Subject: [PATCH 22/26] Fix scoping issues in PaperScript code. --- src/core/PaperScript.js | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/core/PaperScript.js b/src/core/PaperScript.js index ee58b9eb..b939df31 100644 --- a/src/core/PaperScript.js +++ b/src/core/PaperScript.js @@ -14,17 +14,12 @@ * @name PaperScript * @namespace */ -var PaperScript = Base.exports.PaperScript = (function(root) { +var PaperScript = Base.exports.PaperScript = (function() { // Locally turn of exports and define for inlined acorn / esprima. // Just declaring the local vars is enough, as they will be undefined. var exports, define, // The scope into which the library is loaded. scope = this; -/*#*/ if (__options.version == 'dev') { - // As the above inclusion loads code into the root scope during dev, - // set scope to root, so we can find the library. - scope = root; -/*#*/ } // __options.version == 'dev' /*#*/ if (__options.parser == 'acorn') { /*#*/ include('../../bower_components/acorn/acorn.min.js', { exports: false }); /*#*/ } else if (__options.parser == 'esprima') { @@ -281,7 +276,7 @@ var PaperScript = Base.exports.PaperScript = (function(root) { // We need an additional line that returns the handlers in one object. code += '\nreturn { ' + handlers + ' };'; /*#*/ if (__options.environment == 'browser') { - if (root.InstallTrigger) { // Firefox + if (window.InstallTrigger) { // Firefox // Add a semi-colon at the start so Firefox doesn't swallow empty // lines and shift error messages. code = ';' + code; @@ -306,7 +301,7 @@ var PaperScript = Base.exports.PaperScript = (function(root) { lineNumber += (new Error().lineNumber - lineNumber) * 3; } try { - res = new Function(params, code).apply(scope, args); + res = Function(params, code).apply(scope, args); // NOTE: in order for the calculation of the above lineNumber // offset to work, we cannot add any statements before the above // line of code, nor can we put it into a separate function. @@ -314,10 +309,10 @@ var PaperScript = Base.exports.PaperScript = (function(root) { handle(e); } } else { - res = new Function(params, code).apply(scope, args); + res = Function(params, code).apply(scope, args); } /*#*/ } else { // !__options.environment == 'browser' - res = new Function(params, code).apply(scope, args); + res = Function(params, code).apply(scope, args); /*#*/ } // !__options.environment == 'browser' // Now install the 'global' tool and view handlers, and we're done! Base.each(toolHandlers, function(key) { @@ -428,4 +423,6 @@ var PaperScript = Base.exports.PaperScript = (function(root) { }; /*#*/ } // !__options.environment == 'browser' -})(this); +// Pass on `this` as the binding object, so we can reference Acorn both in +// development and in the built library. +}).call(this); From 9dea3f3b741f38edfc08001c08ed661adf215141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 4 Jan 2014 19:10:52 +0100 Subject: [PATCH 23/26] Implement Color component clamping for color conversion. --- src/style/Color.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/style/Color.js b/src/style/Color.js index aa3807ae..e97337c4 100644 --- a/src/style/Color.js +++ b/src/style/Color.js @@ -647,6 +647,24 @@ var Color = Base.extend(new function() { this._owner._changed(/*#=*/ Change.STYLE); }, + /** + * Returns a copy of the components array with all values clamped to + * valid numbers, based on the type of property they represent. + */ + _clamp: function() { + var components = this._components.slice(), + properties = this._properties; + if (this._type !== 'gradient') { + for (var i = 0, l = properties.length; i < l; i++) { + var value = components[i]; + components[i] = properties[i] === 'hue' + ? ((value % 360) + 360) % 360 + : value < 0 ? 0 : value > 1 ? 1 : value; + } + } + return components; + }, + /** * @return {Number[]} the converted components as an array */ @@ -655,11 +673,11 @@ var Color = Base.extend(new function() { return this._type === type ? this._components.slice() : (converter = converters[this._type + '-' + type]) - ? converter.apply(this, this._components) + ? converter.apply(this, this._clamp()) // Convert to and from rgb if no direct converter exists : converters['rgb-' + type].apply(this, converters[this._type + '-rgb'].apply(this, - this._components)); + this._clamp())); }, /** From 4302682c1c403dbb4d241b7d161dadd74e05ea01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 4 Jan 2014 21:57:29 +0100 Subject: [PATCH 24/26] Implement a better way of handling exceptions in PaperScript on Firefox and Chrome. Use dynamically inserted script tag rather than compiled function since Firefox reports correct line numbers there. --- src/core/Callback.js | 30 +++++--------------- src/core/PaperScript.js | 62 +++++++++++++++++------------------------ 2 files changed, 32 insertions(+), 60 deletions(-) diff --git a/src/core/Callback.js b/src/core/Callback.js index 080e023b..10d43b0d 100644 --- a/src/core/Callback.js +++ b/src/core/Callback.js @@ -77,32 +77,16 @@ var Callback = { if (!handlers) return false; var args = [].slice.call(arguments, 1), - PaperScript = paper.PaperScript, - handleException = PaperScript && PaperScript.handleException, that = this; - - function callHandlers() { - for (var i in handlers) { - // When the handler function returns false, prevent the default - // behaviour and stop propagation of the event by calling stop() - if (handlers[i].apply(that, args) === false - && event && event.stop) { - event.stop(); - break; - } + for (var i in handlers) { + // When the handler function returns false, prevent the default + // behaviour and stop propagation of the event by calling stop() + if (handlers[i].apply(that, args) === false + && event && event.stop) { + event.stop(); + break; } } - // See PaperScript.handleException for an explanation of the following. - // Firefox is to blame for the necessity of this... - if (handleException) { - try { - callHandlers(); - } catch (e) { - handleException(e); - } - } else { - callHandlers(); - } return true; }, diff --git a/src/core/PaperScript.js b/src/core/PaperScript.js index b939df31..6b113504 100644 --- a/src/core/PaperScript.js +++ b/src/core/PaperScript.js @@ -248,15 +248,15 @@ var PaperScript = Base.exports.PaperScript = (function() { // undefined arguments, so that their name exists, rather than // injecting a code line that defines them as variables. // They are exported again at the end of the function. - handlers = ['onFrame', 'onResize'].concat(toolHandlers), - res; + handlers = ['onFrame', 'onResize'].concat(toolHandlers); code = compile(code); // compile a list of paramter names for all variables that need to // appear as globals inside the script. At the same time, also collect // their values, so we can pass them on as arguments in the function // call. var params = ['_$_', '$_', 'view', 'tool'], - args = [_$_, $_ , view, tool]; + args = [_$_, $_ , view, tool], + func; // Look through all enumerable properties on the scope and expose these // too as pseudo-globals. for (var key in scope) { @@ -276,44 +276,32 @@ var PaperScript = Base.exports.PaperScript = (function() { // We need an additional line that returns the handlers in one object. code += '\nreturn { ' + handlers + ' };'; /*#*/ if (__options.environment == 'browser') { - if (window.InstallTrigger) { // Firefox - // Add a semi-colon at the start so Firefox doesn't swallow empty - // lines and shift error messages. - code = ';' + code; - // On Firefox, all error numbers inside evaled code are relative to - // the line where the eval happened. Totally silly, but that's how - // it is. So we're calculating the base of lineNumbers, to remove it - // again from reported errors. Luckily, Firefox is the only browser - // where we can define the lineNumber for exceptions. - var handle = PaperScript.handleException; - if (!handle) { - handle = PaperScript.handleException = function(e) { - throw e.lineNumber >= lineNumber - ? new Error(e.message, e.fileName, - e.lineNumber - lineNumber) - : e; - }; - // We're using a crazy hack to detect wether the library is - // minified or not: By generating a second error on the 2nd line - // and using the difference in line numbers to calculate the - // offset to the eval, it works in both casees. - var lineNumber = new Error().lineNumber; - lineNumber += (new Error().lineNumber - lineNumber) * 3; - } - try { - res = Function(params, code).apply(scope, args); - // NOTE: in order for the calculation of the above lineNumber - // offset to work, we cannot add any statements before the above - // line of code, nor can we put it into a separate function. - } catch (e) { - handle(e); - } + if (window.InstallTrigger || window.chrome) { // Firefox and Chrome + // On Firefox, all error numbers inside dynamically compiled code + // are relative to the line where the eval / compilation happened. + // To fix this issue, we're temporarily inserting a new script + // tag. We also use this on Chrome to fix an issue with compiled + // functions: + // https://code.google.com/p/chromium/issues/detail?id=331655 + var script = document.createElement('script'), + head = document.head; + // Do not add a new-line before the code on Chrome since the error + // messages are shifted by one line there... + if (!window.chrome) + code = '\n' + code; + script.appendChild(document.createTextNode( + 'paper._execute = function(' + params + ') {' + code + '\n}' + )); + head.appendChild(script); + func = paper._execute; + head.removeChild(script); } else { - res = Function(params, code).apply(scope, args); + func = Function(params, code); } /*#*/ } else { // !__options.environment == 'browser' - res = Function(params, code).apply(scope, args); + func = Function(params, code); /*#*/ } // !__options.environment == 'browser' + var res = func.apply(scope, args); // Now install the 'global' tool and view handlers, and we're done! Base.each(toolHandlers, function(key) { var value = res[key]; From 227d511fc0402efaaddb2250a9d05e42f3c4ae8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 4 Jan 2014 22:10:16 +0100 Subject: [PATCH 25/26] Only include the global handlers in the return statement that actually seem to be defined. --- src/core/PaperScript.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/core/PaperScript.js b/src/core/PaperScript.js index 6b113504..e6603cae 100644 --- a/src/core/PaperScript.js +++ b/src/core/PaperScript.js @@ -239,7 +239,7 @@ var PaperScript = Base.exports.PaperScript = (function() { var view = scope.getView(), // Only create a tool object if something resembling a tool handler // definition is contained in the code. - tool = /\s+on(?:Key|Mouse)(?:Up|Down|Move|Drag)/.test(code) + tool = /\s+on(?:Key|Mouse)(?:Up|Down|Move|Drag)\b/.test(code) ? new Tool() : null, toolHandlers = tool ? tool._events : [], @@ -270,11 +270,16 @@ var PaperScript = Base.exports.PaperScript = (function() { // end of the code execution, so we can retrieve their values from the // function call. handlers = Base.each(handlers, function(key) { - params.push(key); - this.push(key + ': ' + key); + // Check for each handler explicitely and only return them if they + // seem to exist. + if (new RegExp('\\s+' + key + '\\b').test(code)) { + params.push(key); + this.push(key + ': ' + key); + } }, []).join(', '); // We need an additional line that returns the handlers in one object. - code += '\nreturn { ' + handlers + ' };'; + if (handlers) + code += '\nreturn { ' + handlers + ' };'; /*#*/ if (__options.environment == 'browser') { if (window.InstallTrigger || window.chrome) { // Firefox and Chrome // On Firefox, all error numbers inside dynamically compiled code @@ -301,7 +306,7 @@ var PaperScript = Base.exports.PaperScript = (function() { /*#*/ } else { // !__options.environment == 'browser' func = Function(params, code); /*#*/ } // !__options.environment == 'browser' - var res = func.apply(scope, args); + var res = func.apply(scope, args) || {}; // Now install the 'global' tool and view handlers, and we're done! Base.each(toolHandlers, function(key) { var value = res[key]; From 22e62a05272141acf14ea7e33e5537031012835d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 4 Jan 2014 22:22:19 +0100 Subject: [PATCH 26/26] Only expose globals if they are in use in the PaperScript code. --- src/core/PaperScript.js | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/core/PaperScript.js b/src/core/PaperScript.js index e6603cae..62138899 100644 --- a/src/core/PaperScript.js +++ b/src/core/PaperScript.js @@ -248,23 +248,28 @@ var PaperScript = Base.exports.PaperScript = (function() { // undefined arguments, so that their name exists, rather than // injecting a code line that defines them as variables. // They are exported again at the end of the function. - handlers = ['onFrame', 'onResize'].concat(toolHandlers); - code = compile(code); - // compile a list of paramter names for all variables that need to - // appear as globals inside the script. At the same time, also collect - // their values, so we can pass them on as arguments in the function - // call. - var params = ['_$_', '$_', 'view', 'tool'], - args = [_$_, $_ , view, tool], + handlers = ['onFrame', 'onResize'].concat(toolHandlers), + // compile a list of paramter names for all variables that need to + // appear as globals inside the script. At the same time, also + // collect their values, so we can pass them on as arguments in the + // function call. + params = [], + args = [], func; - // Look through all enumerable properties on the scope and expose these - // too as pseudo-globals. - for (var key in scope) { - if (!/^_/.test(key)) { - params.push(key); - args.push(scope[key]); + code = compile(code); + function expose(scope, hidden) { + // Look through all enumerable properties on the scope and expose + // these too as pseudo-globals, but only if they seem to be in use. + for (var key in scope) { + if ((hidden || !/^_/.test(key)) && new RegExp( + '\\b' + key.replace(/\$/g, '\\$') + '\\b').test(code)) { + params.push(key); + args.push(scope[key]); + } } } + expose({ _$_: _$_, $_: $_, view: view, tool: tool }, true); + expose(scope); // Finally define the handler variable names as parameters and compose // the string describing the properties for the returned object at the // end of the code execution, so we can retrieve their values from the