paper 0.12.15 → 0.12.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +2 -2
- package/dist/docs/assets/js/paper.js +35 -22
- package/dist/docs/classes/Color.html +2 -2
- package/dist/docs/classes/CompoundPath.html +2 -2
- package/dist/docs/classes/Curve.html +2 -2
- package/dist/docs/classes/CurveLocation.html +2 -2
- package/dist/docs/classes/Event.html +2 -2
- package/dist/docs/classes/Gradient.html +2 -2
- package/dist/docs/classes/GradientStop.html +2 -2
- package/dist/docs/classes/Group.html +2 -2
- package/dist/docs/classes/HitResult.html +2 -2
- package/dist/docs/classes/Item.html +2 -2
- package/dist/docs/classes/Key.html +2 -2
- package/dist/docs/classes/KeyEvent.html +2 -2
- package/dist/docs/classes/Layer.html +2 -2
- package/dist/docs/classes/Matrix.html +2 -2
- package/dist/docs/classes/MouseEvent.html +2 -2
- package/dist/docs/classes/PaperScope.html +2 -2
- package/dist/docs/classes/PaperScript.html +2 -2
- package/dist/docs/classes/Path.html +2 -2
- package/dist/docs/classes/PathItem.html +2 -2
- package/dist/docs/classes/Point.html +2 -2
- package/dist/docs/classes/PointText.html +2 -2
- package/dist/docs/classes/Project.html +2 -2
- package/dist/docs/classes/Raster.html +35 -4
- package/dist/docs/classes/Rectangle.html +2 -2
- package/dist/docs/classes/Segment.html +3 -3
- package/dist/docs/classes/Shape.html +3 -3
- package/dist/docs/classes/Size.html +2 -2
- package/dist/docs/classes/Style.html +2 -2
- package/dist/docs/classes/SymbolDefinition.html +2 -2
- package/dist/docs/classes/SymbolItem.html +2 -2
- package/dist/docs/classes/TextItem.html +2 -2
- package/dist/docs/classes/Tool.html +2 -2
- package/dist/docs/classes/ToolEvent.html +2 -2
- package/dist/docs/classes/Tween.html +2 -2
- package/dist/docs/classes/View.html +2 -2
- package/dist/docs/classes/global.html +2 -2
- package/dist/docs/classes/index.html +2 -2
- package/dist/docs/index.html +1 -1
- package/dist/paper-core.js +35 -22
- package/dist/paper-core.min.js +3 -3
- package/dist/paper-full.js +35 -22
- package/dist/paper-full.min.js +3 -3
- package/dist/paper.d.ts +171 -146
- package/package.json +9 -9
|
@@ -910,8 +910,8 @@ var circle = new Path.Circle({
|
|
|
910
910
|
|
|
911
911
|
<!-- =========================== copyright notice ========================== -->
|
|
912
912
|
<p class="footer">
|
|
913
|
-
Paper.js v0.12.
|
|
914
|
-
Copyright © 2011—
|
|
913
|
+
Paper.js v0.12.17<br>
|
|
914
|
+
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
|
915
915
|
<div class="content-end"></div>
|
|
916
916
|
|
|
917
917
|
|
|
@@ -302,8 +302,8 @@ for (var i = 0; i < 100; i++) {
|
|
|
302
302
|
|
|
303
303
|
<!-- =========================== copyright notice ========================== -->
|
|
304
304
|
<p class="footer">
|
|
305
|
-
Paper.js v0.12.
|
|
306
|
-
Copyright © 2011—
|
|
305
|
+
Paper.js v0.12.17<br>
|
|
306
|
+
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
|
307
307
|
<div class="content-end"></div>
|
|
308
308
|
|
|
309
309
|
|
|
@@ -6746,8 +6746,8 @@ path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
|
|
|
6746
6746
|
|
|
6747
6747
|
<!-- =========================== copyright notice ========================== -->
|
|
6748
6748
|
<p class="footer">
|
|
6749
|
-
Paper.js v0.12.
|
|
6750
|
-
Copyright © 2011—
|
|
6749
|
+
Paper.js v0.12.17<br>
|
|
6750
|
+
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
|
6751
6751
|
<div class="content-end"></div>
|
|
6752
6752
|
|
|
6753
6753
|
|
|
@@ -6860,8 +6860,8 @@ path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
|
|
|
6860
6860
|
|
|
6861
6861
|
<!-- =========================== copyright notice ========================== -->
|
|
6862
6862
|
<p class="footer">
|
|
6863
|
-
Paper.js v0.12.
|
|
6864
|
-
Copyright © 2011—
|
|
6863
|
+
Paper.js v0.12.17<br>
|
|
6864
|
+
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
|
6865
6865
|
<div class="content-end"></div>
|
|
6866
6866
|
|
|
6867
6867
|
|
|
@@ -752,8 +752,8 @@ tool.onKeyDown = function(event) {
|
|
|
752
752
|
|
|
753
753
|
<!-- =========================== copyright notice ========================== -->
|
|
754
754
|
<p class="footer">
|
|
755
|
-
Paper.js v0.12.
|
|
756
|
-
Copyright © 2011—
|
|
755
|
+
Paper.js v0.12.17<br>
|
|
756
|
+
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
|
757
757
|
<div class="content-end"></div>
|
|
758
758
|
|
|
759
759
|
|
|
@@ -437,8 +437,8 @@ function onMouseUp(event) {
|
|
|
437
437
|
|
|
438
438
|
<!-- =========================== copyright notice ========================== -->
|
|
439
439
|
<p class="footer">
|
|
440
|
-
Paper.js v0.12.
|
|
441
|
-
Copyright © 2011—
|
|
440
|
+
Paper.js v0.12.17<br>
|
|
441
|
+
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
|
442
442
|
<div class="content-end"></div>
|
|
443
443
|
|
|
444
444
|
|
|
@@ -365,8 +365,8 @@ setTimeout(function(){
|
|
|
365
365
|
|
|
366
366
|
<!-- =========================== copyright notice ========================== -->
|
|
367
367
|
<p class="footer">
|
|
368
|
-
Paper.js v0.12.
|
|
369
|
-
Copyright © 2011—
|
|
368
|
+
Paper.js v0.12.17<br>
|
|
369
|
+
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
|
370
370
|
<div class="content-end"></div>
|
|
371
371
|
|
|
372
372
|
|
|
@@ -1763,8 +1763,8 @@ function onMouseDown(event) {
|
|
|
1763
1763
|
|
|
1764
1764
|
<!-- =========================== copyright notice ========================== -->
|
|
1765
1765
|
<p class="footer">
|
|
1766
|
-
Paper.js v0.12.
|
|
1767
|
-
Copyright © 2011—
|
|
1766
|
+
Paper.js v0.12.17<br>
|
|
1767
|
+
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
|
1768
1768
|
<div class="content-end"></div>
|
|
1769
1769
|
|
|
1770
1770
|
|
|
@@ -416,8 +416,8 @@
|
|
|
416
416
|
|
|
417
417
|
<!-- =========================== copyright notice ========================== -->
|
|
418
418
|
<p class="footer">
|
|
419
|
-
Paper.js v0.12.
|
|
420
|
-
Copyright © 2011—
|
|
419
|
+
Paper.js v0.12.17<br>
|
|
420
|
+
Copyright © 2011—2022 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
|
421
421
|
<div class="content-end"></div>
|
|
422
422
|
|
|
423
423
|
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
|
-
<title>Paper.js v0.12.
|
|
5
|
+
<title>Paper.js v0.12.17</title>
|
|
6
6
|
<base target="class-frame">
|
|
7
7
|
<link href="../assets/css/docs.css" rel="stylesheet" type="text/css">
|
|
8
8
|
</head>
|
|
9
9
|
<body class="reference">
|
|
10
10
|
<div class="reference-index">
|
|
11
|
-
<h1>Paper.js<span class="version">0.12.
|
|
11
|
+
<h1>Paper.js<span class="version">0.12.17</span></h1>
|
|
12
12
|
<ul class="reference-classes"><li><a href="../classes/global.html">Global Scope</a></li>
|
|
13
13
|
<li>
|
|
14
14
|
<h2>Basic Types</h2>
|
package/dist/docs/index.html
CHANGED
package/dist/paper-core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Paper.js v0.12.
|
|
2
|
+
* Paper.js v0.12.17 - The Swiss Army Knife of Vector Graphics Scripting.
|
|
3
3
|
* http://paperjs.org/
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2011 - 2020, Jürg Lehni & Jonathan Puckey
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* All rights reserved.
|
|
11
11
|
*
|
|
12
|
-
* Date:
|
|
12
|
+
* Date: Thu Nov 3 21:15:36 2022 +0100
|
|
13
13
|
*
|
|
14
14
|
***
|
|
15
15
|
*
|
|
@@ -575,7 +575,7 @@ statics: {
|
|
|
575
575
|
if (Base.isPlainObject(arg)) {
|
|
576
576
|
arg.insert = false;
|
|
577
577
|
if (useTarget) {
|
|
578
|
-
args = args.concat([
|
|
578
|
+
args = args.concat([Item.INSERT]);
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
581
|
}
|
|
@@ -821,7 +821,7 @@ var PaperScope = Base.extend({
|
|
|
821
821
|
}
|
|
822
822
|
},
|
|
823
823
|
|
|
824
|
-
version: "0.12.
|
|
824
|
+
version: "0.12.17",
|
|
825
825
|
|
|
826
826
|
getView: function() {
|
|
827
827
|
var project = this.project;
|
|
@@ -1218,6 +1218,7 @@ var Numerical = new function() {
|
|
|
1218
1218
|
CURVETIME_EPSILON: 1e-8,
|
|
1219
1219
|
GEOMETRIC_EPSILON: 1e-7,
|
|
1220
1220
|
TRIGONOMETRIC_EPSILON: 1e-8,
|
|
1221
|
+
ANGULAR_EPSILON: 1e-5,
|
|
1221
1222
|
KAPPA: 4 * (sqrt(2) - 1) / 3,
|
|
1222
1223
|
|
|
1223
1224
|
isZero: function(val) {
|
|
@@ -3135,6 +3136,7 @@ var Item = Base.extend(Emitter, {
|
|
|
3135
3136
|
return extend.base.apply(this, arguments);
|
|
3136
3137
|
},
|
|
3137
3138
|
|
|
3139
|
+
INSERT: { insert: true },
|
|
3138
3140
|
NO_INSERT: { insert: false }
|
|
3139
3141
|
},
|
|
3140
3142
|
|
|
@@ -3221,13 +3223,13 @@ new function() {
|
|
|
3221
3223
|
matrix._owner = this;
|
|
3222
3224
|
this._style = new Style(project._currentStyle, this, project);
|
|
3223
3225
|
if (internal || hasProps && props.insert == false
|
|
3224
|
-
|| !settings.insertItems && !(hasProps && props.insert
|
|
3226
|
+
|| !settings.insertItems && !(hasProps && props.insert == true)) {
|
|
3225
3227
|
this._setProject(project);
|
|
3226
3228
|
} else {
|
|
3227
3229
|
(hasProps && props.parent || project)
|
|
3228
3230
|
._insertItem(undefined, this, true);
|
|
3229
3231
|
}
|
|
3230
|
-
if (hasProps && props !== Item.NO_INSERT) {
|
|
3232
|
+
if (hasProps && props !== Item.NO_INSERT && props !== Item.INSERT) {
|
|
3231
3233
|
this.set(props, {
|
|
3232
3234
|
internal: true, insert: true, project: true, parent: true
|
|
3233
3235
|
});
|
|
@@ -3900,9 +3902,7 @@ new function() {
|
|
|
3900
3902
|
resolution = arg0;
|
|
3901
3903
|
insert = arg1;
|
|
3902
3904
|
}
|
|
3903
|
-
if (raster) {
|
|
3904
|
-
raster.matrix.reset(true);
|
|
3905
|
-
} else {
|
|
3905
|
+
if (!raster) {
|
|
3906
3906
|
raster = new Raster(Item.NO_INSERT);
|
|
3907
3907
|
}
|
|
3908
3908
|
var bounds = this.getStrokeBounds(),
|
|
@@ -3921,7 +3921,7 @@ new function() {
|
|
|
3921
3921
|
this.draw(ctx, new Base({ matrices: [matrix] }));
|
|
3922
3922
|
ctx.restore();
|
|
3923
3923
|
}
|
|
3924
|
-
raster.
|
|
3924
|
+
raster._matrix.set(
|
|
3925
3925
|
new Matrix()
|
|
3926
3926
|
.translate(topLeft.add(boundsSize.divide(2)))
|
|
3927
3927
|
.scale(1 / scale)
|
|
@@ -5730,11 +5730,16 @@ var Raster = Item.extend({
|
|
|
5730
5730
|
rect.width, rect.height);
|
|
5731
5731
|
},
|
|
5732
5732
|
|
|
5733
|
-
|
|
5733
|
+
putImageData: function(data ) {
|
|
5734
5734
|
var point = Point.read(arguments, 1);
|
|
5735
5735
|
this.getContext(true).putImageData(data, point.x, point.y);
|
|
5736
5736
|
},
|
|
5737
5737
|
|
|
5738
|
+
setImageData: function(data) {
|
|
5739
|
+
this.setSize(data);
|
|
5740
|
+
this.getContext(true).putImageData(data, 0, 0);
|
|
5741
|
+
},
|
|
5742
|
+
|
|
5738
5743
|
_getBounds: function(matrix, options) {
|
|
5739
5744
|
var rect = new Rectangle(this._size).setCenter(0, 0);
|
|
5740
5745
|
return matrix ? matrix._transformBounds(rect) : rect;
|
|
@@ -9666,9 +9671,11 @@ new function() {
|
|
|
9666
9671
|
}
|
|
9667
9672
|
}
|
|
9668
9673
|
if (extent) {
|
|
9669
|
-
var epsilon = 1e-
|
|
9674
|
+
var epsilon = 1e-5,
|
|
9670
9675
|
ext = abs(extent),
|
|
9671
|
-
count = ext >= 360
|
|
9676
|
+
count = ext >= 360
|
|
9677
|
+
? 4
|
|
9678
|
+
: Math.ceil((ext - epsilon) / 90),
|
|
9672
9679
|
inc = extent / count,
|
|
9673
9680
|
half = inc * Math.PI / 360,
|
|
9674
9681
|
z = 4 / 3 * Math.sin(half) / (1 + Math.cos(half)),
|
|
@@ -9976,10 +9983,14 @@ Path.inject({ statics: new function() {
|
|
|
9976
9983
|
|
|
9977
9984
|
function createPath(segments, closed, args) {
|
|
9978
9985
|
var props = Base.getNamed(args),
|
|
9979
|
-
path = new Path(props &&
|
|
9986
|
+
path = new Path(props && (
|
|
9987
|
+
props.insert == true ? Item.INSERT
|
|
9988
|
+
: props.insert == false ? Item.NO_INSERT
|
|
9989
|
+
: null
|
|
9990
|
+
));
|
|
9980
9991
|
path._add(segments);
|
|
9981
9992
|
path._closed = closed;
|
|
9982
|
-
return path.set(props,
|
|
9993
|
+
return path.set(props, Item.INSERT);
|
|
9983
9994
|
}
|
|
9984
9995
|
|
|
9985
9996
|
function createEllipse(center, radius, args) {
|
|
@@ -11697,7 +11708,9 @@ var Color = Base.extend(new function() {
|
|
|
11697
11708
|
if (!color) {
|
|
11698
11709
|
if (window) {
|
|
11699
11710
|
if (!colorCtx) {
|
|
11700
|
-
colorCtx = CanvasProvider.getContext(1, 1
|
|
11711
|
+
colorCtx = CanvasProvider.getContext(1, 1, {
|
|
11712
|
+
willReadFrequently: true
|
|
11713
|
+
});
|
|
11701
11714
|
colorCtx.globalCompositeOperation = 'copy';
|
|
11702
11715
|
}
|
|
11703
11716
|
colorCtx.fillStyle = 'rgba(0,0,0,0)';
|
|
@@ -14325,7 +14338,7 @@ var Http = {
|
|
|
14325
14338
|
var CanvasProvider = Base.exports.CanvasProvider = {
|
|
14326
14339
|
canvases: [],
|
|
14327
14340
|
|
|
14328
|
-
getCanvas: function(width, height) {
|
|
14341
|
+
getCanvas: function(width, height, options) {
|
|
14329
14342
|
if (!window)
|
|
14330
14343
|
return null;
|
|
14331
14344
|
var canvas,
|
|
@@ -14340,7 +14353,7 @@ var CanvasProvider = Base.exports.CanvasProvider = {
|
|
|
14340
14353
|
canvas = document.createElement('canvas');
|
|
14341
14354
|
clear = false;
|
|
14342
14355
|
}
|
|
14343
|
-
var ctx = canvas.getContext('2d');
|
|
14356
|
+
var ctx = canvas.getContext('2d', options || {});
|
|
14344
14357
|
if (!ctx) {
|
|
14345
14358
|
throw new Error('Canvas ' + canvas +
|
|
14346
14359
|
' is unable to provide a 2D context.');
|
|
@@ -14356,9 +14369,9 @@ var CanvasProvider = Base.exports.CanvasProvider = {
|
|
|
14356
14369
|
return canvas;
|
|
14357
14370
|
},
|
|
14358
14371
|
|
|
14359
|
-
getContext: function(width, height) {
|
|
14360
|
-
var canvas = this.getCanvas(width, height);
|
|
14361
|
-
return canvas ? canvas.getContext('2d') : null;
|
|
14372
|
+
getContext: function(width, height, options) {
|
|
14373
|
+
var canvas = this.getCanvas(width, height, options);
|
|
14374
|
+
return canvas ? canvas.getContext('2d', options || {}) : null;
|
|
14362
14375
|
},
|
|
14363
14376
|
|
|
14364
14377
|
release: function(obj) {
|
|
@@ -14556,7 +14569,7 @@ var BlendMode = new function() {
|
|
|
14556
14569
|
this[mode] = true;
|
|
14557
14570
|
}, {});
|
|
14558
14571
|
|
|
14559
|
-
var ctx = CanvasProvider.getContext(1, 1);
|
|
14572
|
+
var ctx = CanvasProvider.getContext(1, 1, { willReadFrequently: true });
|
|
14560
14573
|
if (ctx) {
|
|
14561
14574
|
Base.each(modes, function(func, mode) {
|
|
14562
14575
|
var darken = mode === 'darken',
|