paper 0.12.14 → 0.12.16
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 +22 -0
- package/README.md +2 -2
- package/dist/docs/assets/js/paper.js +32 -19
- 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 +32 -19
- package/dist/paper-core.min.js +3 -3
- package/dist/paper-full.js +32 -19
- package/dist/paper-full.min.js +3 -3
- package/dist/paper.d.ts +7 -4
- package/package.json +17 -15
package/dist/paper-full.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Paper.js v0.12.
|
|
2
|
+
* Paper.js v0.12.16 - 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 Oct 20 17:38:51 2022 +0200
|
|
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.16",
|
|
825
825
|
|
|
826
826
|
getView: function() {
|
|
827
827
|
var project = this.project;
|
|
@@ -1221,6 +1221,7 @@ var Numerical = new function() {
|
|
|
1221
1221
|
CURVETIME_EPSILON: 1e-8,
|
|
1222
1222
|
GEOMETRIC_EPSILON: 1e-7,
|
|
1223
1223
|
TRIGONOMETRIC_EPSILON: 1e-8,
|
|
1224
|
+
ANGULAR_EPSILON: 1e-5,
|
|
1224
1225
|
KAPPA: 4 * (sqrt(2) - 1) / 3,
|
|
1225
1226
|
|
|
1226
1227
|
isZero: function(val) {
|
|
@@ -3138,6 +3139,7 @@ var Item = Base.extend(Emitter, {
|
|
|
3138
3139
|
return extend.base.apply(this, arguments);
|
|
3139
3140
|
},
|
|
3140
3141
|
|
|
3142
|
+
INSERT: { insert: true },
|
|
3141
3143
|
NO_INSERT: { insert: false }
|
|
3142
3144
|
},
|
|
3143
3145
|
|
|
@@ -3224,13 +3226,13 @@ new function() {
|
|
|
3224
3226
|
matrix._owner = this;
|
|
3225
3227
|
this._style = new Style(project._currentStyle, this, project);
|
|
3226
3228
|
if (internal || hasProps && props.insert == false
|
|
3227
|
-
|| !settings.insertItems && !(hasProps && props.insert
|
|
3229
|
+
|| !settings.insertItems && !(hasProps && props.insert == true)) {
|
|
3228
3230
|
this._setProject(project);
|
|
3229
3231
|
} else {
|
|
3230
3232
|
(hasProps && props.parent || project)
|
|
3231
3233
|
._insertItem(undefined, this, true);
|
|
3232
3234
|
}
|
|
3233
|
-
if (hasProps && props !== Item.NO_INSERT) {
|
|
3235
|
+
if (hasProps && props !== Item.NO_INSERT && props !== Item.INSERT) {
|
|
3234
3236
|
this.set(props, {
|
|
3235
3237
|
internal: true, insert: true, project: true, parent: true
|
|
3236
3238
|
});
|
|
@@ -3903,9 +3905,7 @@ new function() {
|
|
|
3903
3905
|
resolution = arg0;
|
|
3904
3906
|
insert = arg1;
|
|
3905
3907
|
}
|
|
3906
|
-
if (raster) {
|
|
3907
|
-
raster.matrix.reset(true);
|
|
3908
|
-
} else {
|
|
3908
|
+
if (!raster) {
|
|
3909
3909
|
raster = new Raster(Item.NO_INSERT);
|
|
3910
3910
|
}
|
|
3911
3911
|
var bounds = this.getStrokeBounds(),
|
|
@@ -3924,7 +3924,7 @@ new function() {
|
|
|
3924
3924
|
this.draw(ctx, new Base({ matrices: [matrix] }));
|
|
3925
3925
|
ctx.restore();
|
|
3926
3926
|
}
|
|
3927
|
-
raster.
|
|
3927
|
+
raster._matrix.set(
|
|
3928
3928
|
new Matrix()
|
|
3929
3929
|
.translate(topLeft.add(boundsSize.divide(2)))
|
|
3930
3930
|
.scale(1 / scale)
|
|
@@ -5733,11 +5733,16 @@ var Raster = Item.extend({
|
|
|
5733
5733
|
rect.width, rect.height);
|
|
5734
5734
|
},
|
|
5735
5735
|
|
|
5736
|
-
|
|
5736
|
+
putImageData: function(data ) {
|
|
5737
5737
|
var point = Point.read(arguments, 1);
|
|
5738
5738
|
this.getContext(true).putImageData(data, point.x, point.y);
|
|
5739
5739
|
},
|
|
5740
5740
|
|
|
5741
|
+
setImageData: function(data) {
|
|
5742
|
+
this.setSize(data);
|
|
5743
|
+
this.getContext(true).putImageData(data, 0, 0);
|
|
5744
|
+
},
|
|
5745
|
+
|
|
5741
5746
|
_getBounds: function(matrix, options) {
|
|
5742
5747
|
var rect = new Rectangle(this._size).setCenter(0, 0);
|
|
5743
5748
|
return matrix ? matrix._transformBounds(rect) : rect;
|
|
@@ -9669,9 +9674,11 @@ new function() {
|
|
|
9669
9674
|
}
|
|
9670
9675
|
}
|
|
9671
9676
|
if (extent) {
|
|
9672
|
-
var epsilon = 1e-
|
|
9677
|
+
var epsilon = 1e-5,
|
|
9673
9678
|
ext = abs(extent),
|
|
9674
|
-
count = ext >= 360
|
|
9679
|
+
count = ext >= 360
|
|
9680
|
+
? 4
|
|
9681
|
+
: Math.ceil((ext - epsilon) / 90),
|
|
9675
9682
|
inc = extent / count,
|
|
9676
9683
|
half = inc * Math.PI / 360,
|
|
9677
9684
|
z = 4 / 3 * Math.sin(half) / (1 + Math.cos(half)),
|
|
@@ -9979,10 +9986,14 @@ Path.inject({ statics: new function() {
|
|
|
9979
9986
|
|
|
9980
9987
|
function createPath(segments, closed, args) {
|
|
9981
9988
|
var props = Base.getNamed(args),
|
|
9982
|
-
path = new Path(props &&
|
|
9989
|
+
path = new Path(props && (
|
|
9990
|
+
props.insert == true ? Item.INSERT
|
|
9991
|
+
: props.insert == false ? Item.NO_INSERT
|
|
9992
|
+
: null
|
|
9993
|
+
));
|
|
9983
9994
|
path._add(segments);
|
|
9984
9995
|
path._closed = closed;
|
|
9985
|
-
return path.set(props,
|
|
9996
|
+
return path.set(props, Item.INSERT);
|
|
9986
9997
|
}
|
|
9987
9998
|
|
|
9988
9999
|
function createEllipse(center, radius, args) {
|
|
@@ -11700,7 +11711,9 @@ var Color = Base.extend(new function() {
|
|
|
11700
11711
|
if (!color) {
|
|
11701
11712
|
if (window) {
|
|
11702
11713
|
if (!colorCtx) {
|
|
11703
|
-
colorCtx = CanvasProvider.getContext(1, 1
|
|
11714
|
+
colorCtx = CanvasProvider.getContext(1, 1, {
|
|
11715
|
+
willReadFrequently: true
|
|
11716
|
+
});
|
|
11704
11717
|
colorCtx.globalCompositeOperation = 'copy';
|
|
11705
11718
|
}
|
|
11706
11719
|
colorCtx.fillStyle = 'rgba(0,0,0,0)';
|
|
@@ -14328,7 +14341,7 @@ var Http = {
|
|
|
14328
14341
|
var CanvasProvider = Base.exports.CanvasProvider = {
|
|
14329
14342
|
canvases: [],
|
|
14330
14343
|
|
|
14331
|
-
getCanvas: function(width, height) {
|
|
14344
|
+
getCanvas: function(width, height, options) {
|
|
14332
14345
|
if (!window)
|
|
14333
14346
|
return null;
|
|
14334
14347
|
var canvas,
|
|
@@ -14343,7 +14356,7 @@ var CanvasProvider = Base.exports.CanvasProvider = {
|
|
|
14343
14356
|
canvas = document.createElement('canvas');
|
|
14344
14357
|
clear = false;
|
|
14345
14358
|
}
|
|
14346
|
-
var ctx = canvas.getContext('2d');
|
|
14359
|
+
var ctx = canvas.getContext('2d', options || {});
|
|
14347
14360
|
if (!ctx) {
|
|
14348
14361
|
throw new Error('Canvas ' + canvas +
|
|
14349
14362
|
' is unable to provide a 2D context.');
|
|
@@ -14559,7 +14572,7 @@ var BlendMode = new function() {
|
|
|
14559
14572
|
this[mode] = true;
|
|
14560
14573
|
}, {});
|
|
14561
14574
|
|
|
14562
|
-
var ctx = CanvasProvider.getContext(1, 1);
|
|
14575
|
+
var ctx = CanvasProvider.getContext(1, 1, { willReadFrequently: true });
|
|
14563
14576
|
if (ctx) {
|
|
14564
14577
|
Base.each(modes, function(func, mode) {
|
|
14565
14578
|
var darken = mode === 'darken',
|