Bump version to v0.9.20

This commit is contained in:
Jürg Lehni 2014-08-25 14:48:05 +02:00
parent 99b06b061c
commit 73751040b7
9 changed files with 415 additions and 400 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "paper", "name": "paper",
"version": "0.9.19", "version": "0.9.20",
"description": "The Swiss Army Knife of Vector Graphics Scripting", "description": "The Swiss Army Knife of Vector Graphics Scripting",
"license": "MIT", "license": "MIT",
"homepage": "http://paperjs.org", "homepage": "http://paperjs.org",

View file

@ -1,6 +1,6 @@
{ {
"name": "paper", "name": "paper",
"version": "0.9.19", "version": "0.9.20",
"description": "The Swiss Army Knife of Vector Graphics Scripting", "description": "The Swiss Army Knife of Vector Graphics Scripting",
"license": "MIT", "license": "MIT",
"repo": "paperjs/paper.js", "repo": "paperjs/paper.js",

45
dist/paper-core.js vendored
View file

@ -1,5 +1,5 @@
/*! /*!
* Paper.js v0.9.19 - The Swiss Army Knife of Vector Graphics Scripting. * Paper.js v0.9.20 - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/ * http://paperjs.org/
* *
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
@ -9,7 +9,7 @@
* *
* All rights reserved. * All rights reserved.
* *
* Date: Sat Aug 16 18:31:16 2014 +0200 * Date: Mon Aug 25 14:21:13 2014 +0200
* *
*** ***
* *
@ -716,7 +716,7 @@ var PaperScope = Base.extend({
} }
}, },
version: '0.9.19', version: '0.9.20',
getView: function() { getView: function() {
return this.project && this.project.getView(); return this.project && this.project.getView();
@ -4905,8 +4905,7 @@ var HitResult = Base.extend({
center: false, center: false,
bounds: false, bounds: false,
guides: false, guides: false,
selected: false, selected: false
callback: null
}, options); }, options);
} }
} }
@ -5152,7 +5151,7 @@ var Segment = Base.extend({
_transformCoordinates: function(matrix, coords, change) { _transformCoordinates: function(matrix, coords, change) {
var point = this._point, var point = this._point,
handleIn = !change || !this._handleIn.isZero() handleIn = !change || !this._handleIn.isZero()
? this._handleIn : null, ? this._handleIn : null,
handleOut = !change || !this._handleOut.isZero() handleOut = !change || !this._handleOut.isZero()
? this._handleOut : null, ? this._handleOut : null,
@ -6019,7 +6018,7 @@ new function() {
} else if (qy <= dMax) { } else if (qy <= dMax) {
px = hullBottom[i][0]; px = hullBottom[i][0];
qx = hullBottom[i + 1][0]; qx = hullBottom[i + 1][0];
tProxy = px + (dMax - py) * (qx - px) / (qy - py); tProxy = px + (dMax - py) * (qx - px) / (qy - py);
} else { } else {
continue; continue;
} }
@ -7154,7 +7153,7 @@ var Path = PathItem.extend({
if (parameter === 0 || parameter === 1 && numSegments > 1) { if (parameter === 0 || parameter === 1 && numSegments > 1) {
if (!checkSegmentStroke(loc.getSegment())) if (!checkSegmentStroke(loc.getSegment()))
loc = null; loc = null;
} else if (!isCloseEnough(loc.getPoint(), strokePadding)) { } else if (!isCloseEnough(loc.getPoint(), strokePadding)) {
loc = null; loc = null;
} }
} }
@ -7668,7 +7667,7 @@ var Path = PathItem.extend({
} }
} }
var ext = Math.abs(extent), var ext = Math.abs(extent),
count = ext >= 360 ? 4 : Math.ceil(ext / 90), count = ext >= 360 ? 4 : Math.ceil(ext / 90),
inc = extent / count, inc = extent / count,
half = inc * Math.PI / 360, half = inc * Math.PI / 360,
z = 4 / 3 * Math.sin(half) / (1 + Math.cos(half)), z = 4 / 3 * Math.sin(half) / (1 + Math.cos(half)),
@ -8707,7 +8706,7 @@ Path.inject({
CompoundPath.inject({ CompoundPath.inject({
_getMonoCurves: function() { _getMonoCurves: function() {
var children = this._children, var children = this._children,
monoCurves = []; monoCurves = [];
for (var i = 0, l = children.length; i < l; i++) for (var i = 0, l = children.length; i < l; i++)
monoCurves.push.apply(monoCurves, children[i]._getMonoCurves()); monoCurves.push.apply(monoCurves, children[i]._getMonoCurves());
@ -8797,7 +8796,7 @@ var PathFlattener = Base.extend({
prevLen = prev ? prev.offset : 0; prevLen = prev ? prev.offset : 0;
return { return {
value: prevVal + (part.value - prevVal) value: prevVal + (part.value - prevVal)
* (offset - prevLen) / (part.offset - prevLen), * (offset - prevLen) / (part.offset - prevLen),
index: part.index index: part.index
}; };
} }
@ -8924,8 +8923,8 @@ var PathFitter = Base.extend({
var detC0C1 = C[0][0] * C[1][1] - C[1][0] * C[0][1], var detC0C1 = C[0][0] * C[1][1] - C[1][0] * C[0][1],
alpha1, alpha2; alpha1, alpha2;
if (Math.abs(detC0C1) > epsilon) { if (Math.abs(detC0C1) > epsilon) {
var detC0X = C[0][0] * X[1] - C[1][0] * X[0], var detC0X = C[0][0] * X[1] - C[1][0] * X[0],
detXC1 = X[0] * C[1][1] - X[1] * C[0][1]; detXC1 = X[0] * C[1][1] - X[1] * C[0][1];
alpha1 = detXC1 / detC0C1; alpha1 = detXC1 / detC0C1;
alpha2 = detC0X / detC0C1; alpha2 = detC0X / detC0C1;
} else { } else {
@ -9191,9 +9190,9 @@ var Color = Base.extend(new function() {
min = Math.min(r, g, b), min = Math.min(r, g, b),
delta = max - min, delta = max - min,
h = delta === 0 ? 0 h = delta === 0 ? 0
: ( max == r ? (g - b) / delta + (g < b ? 6 : 0) : ( max == r ? (g - b) / delta + (g < b ? 6 : 0)
: max == g ? (b - r) / delta + 2 : max == g ? (b - r) / delta + 2
: (r - g) / delta + 4) * 60; : (r - g) / delta + 4) * 60;
return [h, max === 0 ? 0 : delta / max, max]; return [h, max === 0 ? 0 : delta / max, max];
}, },
@ -9217,9 +9216,9 @@ var Color = Base.extend(new function() {
delta = max - min, delta = max - min,
achromatic = delta === 0, achromatic = delta === 0,
h = achromatic ? 0 h = achromatic ? 0
: ( max == r ? (g - b) / delta + (g < b ? 6 : 0) : ( max == r ? (g - b) / delta + (g < b ? 6 : 0)
: max == g ? (b - r) / delta + 2 : max == g ? (b - r) / delta + 2
: (r - g) / delta + 4) * 60, : (r - g) / delta + 4) * 60,
l = (max + min) / 2, l = (max + min) / 2,
s = achromatic ? 0 : l < 0.5 s = achromatic ? 0 : l < 0.5
? delta / (max + min) ? delta / (max + min)
@ -9747,7 +9746,7 @@ var Gradient = Base.extend({
equals: function(gradient) { equals: function(gradient) {
if (gradient === this) if (gradient === this)
return true; return true;
if (gradient && this._class === gradient._class if (gradient && this._class === gradient._class
&& this._stops.length === gradient._stops.length) { && this._stops.length === gradient._stops.length) {
for (var i = 0, l = this._stops.length; i < l; i++) { for (var i = 0, l = this._stops.length; i < l; i++) {
if (!this._stops[i].equals(gradient._stops[i])) if (!this._stops[i].equals(gradient._stops[i]))
@ -10163,7 +10162,7 @@ var DomElement = new function() {
rect = { left: 0, top: 0, width: 0, height: 0 }; rect = { left: 0, top: 0, width: 0, height: 0 };
} }
var x = rect.left - (html.clientLeft || body.clientLeft || 0), var x = rect.left - (html.clientLeft || body.clientLeft || 0),
y = rect.top - (html.clientTop || body.clientTop || 0); y = rect.top - (html.clientTop || body.clientTop || 0);
if (!viewport) { if (!viewport) {
var view = doc.defaultView; var view = doc.defaultView;
x += view.pageXOffset || html.scrollLeft || body.scrollLeft; x += view.pageXOffset || html.scrollLeft || body.scrollLeft;
@ -10603,6 +10602,8 @@ var View = Base.extend(Callback, {
_id: 0, _id: 0,
create: function(project, element) { create: function(project, element) {
if (typeof element === 'string')
element = document.getElementById(element);
return new CanvasView(project, element); return new CanvasView(project, element);
} }
} }
@ -11146,7 +11147,7 @@ var ToolEvent = Event.extend({
getDelta: function() { getDelta: function() {
return !this._delta && this.tool._lastPoint return !this._delta && this.tool._lastPoint
? this.tool._point.subtract(this.tool._lastPoint) ? this.tool._point.subtract(this.tool._lastPoint)
: this._delta; : this._delta;
}, },
@ -11632,8 +11633,8 @@ var BlendMode = new function() {
return; return;
var dstData = dstContext.getImageData(offset.x, offset.y, var dstData = dstContext.getImageData(offset.x, offset.y,
srcCanvas.width, srcCanvas.height), srcCanvas.width, srcCanvas.height),
dst = dstData.data, dst = dstData.data,
src = srcContext.getImageData(0, 0, src = srcContext.getImageData(0, 0,
srcCanvas.width, srcCanvas.height).data; srcCanvas.width, srcCanvas.height).data;
for (var i = 0, l = dst.length; i < l; i += 4) { for (var i = 0, l = dst.length; i < l; i += 4) {
sr = src[i]; sr = src[i];

File diff suppressed because one or more lines are too long

137
dist/paper-full.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

45
dist/paper-node.js vendored
View file

@ -1,5 +1,5 @@
/*! /*!
* Paper.js v0.9.19 - The Swiss Army Knife of Vector Graphics Scripting. * Paper.js v0.9.20 - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/ * http://paperjs.org/
* *
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
@ -9,7 +9,7 @@
* *
* All rights reserved. * All rights reserved.
* *
* Date: Sat Aug 16 18:31:16 2014 +0200 * Date: Mon Aug 25 14:21:13 2014 +0200
* *
*** ***
* *
@ -706,7 +706,7 @@ var PaperScope = Base.extend({
} }
}, },
version: '0.9.19', version: '0.9.20',
getView: function() { getView: function() {
return this.project && this.project.getView(); return this.project && this.project.getView();
@ -4910,8 +4910,7 @@ var HitResult = Base.extend({
center: false, center: false,
bounds: false, bounds: false,
guides: false, guides: false,
selected: false, selected: false
callback: null
}, options); }, options);
} }
} }
@ -5157,7 +5156,7 @@ var Segment = Base.extend({
_transformCoordinates: function(matrix, coords, change) { _transformCoordinates: function(matrix, coords, change) {
var point = this._point, var point = this._point,
handleIn = !change || !this._handleIn.isZero() handleIn = !change || !this._handleIn.isZero()
? this._handleIn : null, ? this._handleIn : null,
handleOut = !change || !this._handleOut.isZero() handleOut = !change || !this._handleOut.isZero()
? this._handleOut : null, ? this._handleOut : null,
@ -6024,7 +6023,7 @@ new function() {
} else if (qy <= dMax) { } else if (qy <= dMax) {
px = hullBottom[i][0]; px = hullBottom[i][0];
qx = hullBottom[i + 1][0]; qx = hullBottom[i + 1][0];
tProxy = px + (dMax - py) * (qx - px) / (qy - py); tProxy = px + (dMax - py) * (qx - px) / (qy - py);
} else { } else {
continue; continue;
} }
@ -7159,7 +7158,7 @@ var Path = PathItem.extend({
if (parameter === 0 || parameter === 1 && numSegments > 1) { if (parameter === 0 || parameter === 1 && numSegments > 1) {
if (!checkSegmentStroke(loc.getSegment())) if (!checkSegmentStroke(loc.getSegment()))
loc = null; loc = null;
} else if (!isCloseEnough(loc.getPoint(), strokePadding)) { } else if (!isCloseEnough(loc.getPoint(), strokePadding)) {
loc = null; loc = null;
} }
} }
@ -7673,7 +7672,7 @@ var Path = PathItem.extend({
} }
} }
var ext = Math.abs(extent), var ext = Math.abs(extent),
count = ext >= 360 ? 4 : Math.ceil(ext / 90), count = ext >= 360 ? 4 : Math.ceil(ext / 90),
inc = extent / count, inc = extent / count,
half = inc * Math.PI / 360, half = inc * Math.PI / 360,
z = 4 / 3 * Math.sin(half) / (1 + Math.cos(half)), z = 4 / 3 * Math.sin(half) / (1 + Math.cos(half)),
@ -8712,7 +8711,7 @@ Path.inject({
CompoundPath.inject({ CompoundPath.inject({
_getMonoCurves: function() { _getMonoCurves: function() {
var children = this._children, var children = this._children,
monoCurves = []; monoCurves = [];
for (var i = 0, l = children.length; i < l; i++) for (var i = 0, l = children.length; i < l; i++)
monoCurves.push.apply(monoCurves, children[i]._getMonoCurves()); monoCurves.push.apply(monoCurves, children[i]._getMonoCurves());
@ -8802,7 +8801,7 @@ var PathFlattener = Base.extend({
prevLen = prev ? prev.offset : 0; prevLen = prev ? prev.offset : 0;
return { return {
value: prevVal + (part.value - prevVal) value: prevVal + (part.value - prevVal)
* (offset - prevLen) / (part.offset - prevLen), * (offset - prevLen) / (part.offset - prevLen),
index: part.index index: part.index
}; };
} }
@ -8929,8 +8928,8 @@ var PathFitter = Base.extend({
var detC0C1 = C[0][0] * C[1][1] - C[1][0] * C[0][1], var detC0C1 = C[0][0] * C[1][1] - C[1][0] * C[0][1],
alpha1, alpha2; alpha1, alpha2;
if (Math.abs(detC0C1) > epsilon) { if (Math.abs(detC0C1) > epsilon) {
var detC0X = C[0][0] * X[1] - C[1][0] * X[0], var detC0X = C[0][0] * X[1] - C[1][0] * X[0],
detXC1 = X[0] * C[1][1] - X[1] * C[0][1]; detXC1 = X[0] * C[1][1] - X[1] * C[0][1];
alpha1 = detXC1 / detC0C1; alpha1 = detXC1 / detC0C1;
alpha2 = detC0X / detC0C1; alpha2 = detC0X / detC0C1;
} else { } else {
@ -9196,9 +9195,9 @@ var Color = Base.extend(new function() {
min = Math.min(r, g, b), min = Math.min(r, g, b),
delta = max - min, delta = max - min,
h = delta === 0 ? 0 h = delta === 0 ? 0
: ( max == r ? (g - b) / delta + (g < b ? 6 : 0) : ( max == r ? (g - b) / delta + (g < b ? 6 : 0)
: max == g ? (b - r) / delta + 2 : max == g ? (b - r) / delta + 2
: (r - g) / delta + 4) * 60; : (r - g) / delta + 4) * 60;
return [h, max === 0 ? 0 : delta / max, max]; return [h, max === 0 ? 0 : delta / max, max];
}, },
@ -9222,9 +9221,9 @@ var Color = Base.extend(new function() {
delta = max - min, delta = max - min,
achromatic = delta === 0, achromatic = delta === 0,
h = achromatic ? 0 h = achromatic ? 0
: ( max == r ? (g - b) / delta + (g < b ? 6 : 0) : ( max == r ? (g - b) / delta + (g < b ? 6 : 0)
: max == g ? (b - r) / delta + 2 : max == g ? (b - r) / delta + 2
: (r - g) / delta + 4) * 60, : (r - g) / delta + 4) * 60,
l = (max + min) / 2, l = (max + min) / 2,
s = achromatic ? 0 : l < 0.5 s = achromatic ? 0 : l < 0.5
? delta / (max + min) ? delta / (max + min)
@ -9752,7 +9751,7 @@ var Gradient = Base.extend({
equals: function(gradient) { equals: function(gradient) {
if (gradient === this) if (gradient === this)
return true; return true;
if (gradient && this._class === gradient._class if (gradient && this._class === gradient._class
&& this._stops.length === gradient._stops.length) { && this._stops.length === gradient._stops.length) {
for (var i = 0, l = this._stops.length; i < l; i++) { for (var i = 0, l = this._stops.length; i < l; i++) {
if (!this._stops[i].equals(gradient._stops[i])) if (!this._stops[i].equals(gradient._stops[i]))
@ -10024,7 +10023,7 @@ var jsdom = require('jsdom'),
domToHtml = require('jsdom/lib/jsdom/browser/domtohtml').domToHtml, domToHtml = require('jsdom/lib/jsdom/browser/domtohtml').domToHtml,
Canvas = require('canvas'), Canvas = require('canvas'),
document = jsdom.jsdom('<html><body></body></html>'), document = jsdom.jsdom('<html><body></body></html>'),
window = document.createWindow(), window = document.parentWindow,
navigator = window.navigator, navigator = window.navigator,
HTMLCanvasElement = Canvas, HTMLCanvasElement = Canvas,
Image = Canvas.Image; Image = Canvas.Image;
@ -10203,7 +10202,7 @@ var DomElement = new function() {
rect = { left: 0, top: 0, width: 0, height: 0 }; rect = { left: 0, top: 0, width: 0, height: 0 };
} }
var x = rect.left - (html.clientLeft || body.clientLeft || 0), var x = rect.left - (html.clientLeft || body.clientLeft || 0),
y = rect.top - (html.clientTop || body.clientTop || 0); y = rect.top - (html.clientTop || body.clientTop || 0);
if (!viewport) { if (!viewport) {
var view = doc.defaultView; var view = doc.defaultView;
x += view.pageXOffset || html.scrollLeft || body.scrollLeft; x += view.pageXOffset || html.scrollLeft || body.scrollLeft;
@ -10995,8 +10994,8 @@ var BlendMode = new function() {
return; return;
var dstData = dstContext.getImageData(offset.x, offset.y, var dstData = dstContext.getImageData(offset.x, offset.y,
srcCanvas.width, srcCanvas.height), srcCanvas.width, srcCanvas.height),
dst = dstData.data, dst = dstData.data,
src = srcContext.getImageData(0, 0, src = srcContext.getImageData(0, 0,
srcCanvas.width, srcCanvas.height).data; srcCanvas.width, srcCanvas.height).data;
for (var i = 0, l = dst.length; i < l; i += 4) { for (var i = 0, l = dst.length; i < l; i += 4) {
sr = src[i]; sr = src[i];
@ -12090,7 +12089,7 @@ Base.exports.PaperScript = (function() {
code = compile(code, url, options); code = compile(code, url, options);
function expose(scope, hidden) { function expose(scope, hidden) {
for (var key in scope) { for (var key in scope) {
if ((hidden || !/^_/.test(key)) && new RegExp('[\\b\\s\\W]' if ((hidden || !/^_/.test(key)) && new RegExp('([\\b\\s\\W]|^)'
+ key.replace(/\$/g, '\\$') + '\\b').test(code)) { + key.replace(/\$/g, '\\$') + '\\b').test(code)) {
params.push(key); params.push(key);
args.push(scope[key]); args.push(scope[key]);

View file

@ -1,6 +1,6 @@
{ {
"name": "paper", "name": "paper",
"version": "0.9.19", "version": "0.9.20",
"description": "The Swiss Army Knife of Vector Graphics Scripting", "description": "The Swiss Army Knife of Vector Graphics Scripting",
"license": "MIT", "license": "MIT",
"homepage": "http://paperjs.org", "homepage": "http://paperjs.org",

View file

@ -17,7 +17,7 @@
// The paper.js version. // The paper.js version.
// NOTE: Adjust value here before calling publish.sh, which then updates and // NOTE: Adjust value here before calling publish.sh, which then updates and
// publishes the various JSON package files automatically. // publishes the various JSON package files automatically.
var version = '0.9.19'; var version = '0.9.20';
var __options = { var __options = {
// If this file is loaded in the browser, we're in dev mode through load.js // If this file is loaded in the browser, we're in dev mode through load.js