Skip to content

Commit ee38c2b

Browse files
committed
Release version 0.12.16
1 parent 172033a commit ee38c2b

File tree

7 files changed

+69
-25
lines changed

7 files changed

+69
-25
lines changed

assets/js/paper.js

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Paper.js v0.12.15 - The Swiss Army Knife of Vector Graphics Scripting.
2+
* Paper.js v0.12.16 - The Swiss Army Knife of Vector Graphics Scripting.
33
* http://paperjs.org/
44
*
55
* Copyright (c) 2011 - 2020, Jürg Lehni & Jonathan Puckey
@@ -9,7 +9,7 @@
99
*
1010
* All rights reserved.
1111
*
12-
* Date: Wed Mar 17 10:49:48 2021 +0100
12+
* Date: Thu Oct 20 17:38:51 2022 +0200
1313
*
1414
***
1515
*
@@ -575,7 +575,7 @@ statics: {
575575
if (Base.isPlainObject(arg)) {
576576
arg.insert = false;
577577
if (useTarget) {
578-
args = args.concat([{ insert: true }]);
578+
args = args.concat([Item.INSERT]);
579579
}
580580
}
581581
}
@@ -821,7 +821,7 @@ var PaperScope = Base.extend({
821821
}
822822
},
823823

824-
version: "0.12.15",
824+
version: "0.12.16",
825825

826826
getView: function() {
827827
var project = this.project;
@@ -1221,6 +1221,7 @@ var Numerical = new function() {
12211221
CURVETIME_EPSILON: 1e-8,
12221222
GEOMETRIC_EPSILON: 1e-7,
12231223
TRIGONOMETRIC_EPSILON: 1e-8,
1224+
ANGULAR_EPSILON: 1e-5,
12241225
KAPPA: 4 * (sqrt(2) - 1) / 3,
12251226

12261227
isZero: function(val) {
@@ -3138,6 +3139,7 @@ var Item = Base.extend(Emitter, {
31383139
return extend.base.apply(this, arguments);
31393140
},
31403141

3142+
INSERT: { insert: true },
31413143
NO_INSERT: { insert: false }
31423144
},
31433145

@@ -3224,13 +3226,13 @@ new function() {
32243226
matrix._owner = this;
32253227
this._style = new Style(project._currentStyle, this, project);
32263228
if (internal || hasProps && props.insert == false
3227-
|| !settings.insertItems && !(hasProps && props.insert === true)) {
3229+
|| !settings.insertItems && !(hasProps && props.insert == true)) {
32283230
this._setProject(project);
32293231
} else {
32303232
(hasProps && props.parent || project)
32313233
._insertItem(undefined, this, true);
32323234
}
3233-
if (hasProps && props !== Item.NO_INSERT) {
3235+
if (hasProps && props !== Item.NO_INSERT && props !== Item.INSERT) {
32343236
this.set(props, {
32353237
internal: true, insert: true, project: true, parent: true
32363238
});
@@ -3903,9 +3905,7 @@ new function() {
39033905
resolution = arg0;
39043906
insert = arg1;
39053907
}
3906-
if (raster) {
3907-
raster.matrix.reset(true);
3908-
} else {
3908+
if (!raster) {
39093909
raster = new Raster(Item.NO_INSERT);
39103910
}
39113911
var bounds = this.getStrokeBounds(),
@@ -3924,7 +3924,7 @@ new function() {
39243924
this.draw(ctx, new Base({ matrices: [matrix] }));
39253925
ctx.restore();
39263926
}
3927-
raster.transform(
3927+
raster._matrix.set(
39283928
new Matrix()
39293929
.translate(topLeft.add(boundsSize.divide(2)))
39303930
.scale(1 / scale)
@@ -5733,11 +5733,16 @@ var Raster = Item.extend({
57335733
rect.width, rect.height);
57345734
},
57355735

5736-
setImageData: function(data ) {
5736+
putImageData: function(data ) {
57375737
var point = Point.read(arguments, 1);
57385738
this.getContext(true).putImageData(data, point.x, point.y);
57395739
},
57405740

5741+
setImageData: function(data) {
5742+
this.setSize(data);
5743+
this.getContext(true).putImageData(data, 0, 0);
5744+
},
5745+
57415746
_getBounds: function(matrix, options) {
57425747
var rect = new Rectangle(this._size).setCenter(0, 0);
57435748
return matrix ? matrix._transformBounds(rect) : rect;
@@ -9669,9 +9674,11 @@ new function() {
96699674
}
96709675
}
96719676
if (extent) {
9672-
var epsilon = 1e-7,
9677+
var epsilon = 1e-5,
96739678
ext = abs(extent),
9674-
count = ext >= 360 ? 4 : Math.ceil((ext - epsilon) / 90),
9679+
count = ext >= 360
9680+
? 4
9681+
: Math.ceil((ext - epsilon) / 90),
96759682
inc = extent / count,
96769683
half = inc * Math.PI / 360,
96779684
z = 4 / 3 * Math.sin(half) / (1 + Math.cos(half)),
@@ -9979,10 +9986,14 @@ Path.inject({ statics: new function() {
99799986

99809987
function createPath(segments, closed, args) {
99819988
var props = Base.getNamed(args),
9982-
path = new Path(props && props.insert == false && Item.NO_INSERT);
9989+
path = new Path(props && (
9990+
props.insert == true ? Item.INSERT
9991+
: props.insert == false ? Item.NO_INSERT
9992+
: null
9993+
));
99839994
path._add(segments);
99849995
path._closed = closed;
9985-
return path.set(props, { insert: true });
9996+
return path.set(props, Item.INSERT);
99869997
}
99879998

99889999
function createEllipse(center, radius, args) {
@@ -11700,7 +11711,9 @@ var Color = Base.extend(new function() {
1170011711
if (!color) {
1170111712
if (window) {
1170211713
if (!colorCtx) {
11703-
colorCtx = CanvasProvider.getContext(1, 1);
11714+
colorCtx = CanvasProvider.getContext(1, 1, {
11715+
willReadFrequently: true
11716+
});
1170411717
colorCtx.globalCompositeOperation = 'copy';
1170511718
}
1170611719
colorCtx.fillStyle = 'rgba(0,0,0,0)';
@@ -14328,7 +14341,7 @@ var Http = {
1432814341
var CanvasProvider = Base.exports.CanvasProvider = {
1432914342
canvases: [],
1433014343

14331-
getCanvas: function(width, height) {
14344+
getCanvas: function(width, height, options) {
1433214345
if (!window)
1433314346
return null;
1433414347
var canvas,
@@ -14343,7 +14356,7 @@ var CanvasProvider = Base.exports.CanvasProvider = {
1434314356
canvas = document.createElement('canvas');
1434414357
clear = false;
1434514358
}
14346-
var ctx = canvas.getContext('2d');
14359+
var ctx = canvas.getContext('2d', options || {});
1434714360
if (!ctx) {
1434814361
throw new Error('Canvas ' + canvas +
1434914362
' is unable to provide a 2D context.');
@@ -14559,7 +14572,7 @@ var BlendMode = new function() {
1455914572
this[mode] = true;
1456014573
}, {});
1456114574

14562-
var ctx = CanvasProvider.getContext(1, 1);
14575+
var ctx = CanvasProvider.getContext(1, 1, { willReadFrequently: true });
1456314576
if (ctx) {
1456414577
Base.each(modes, function(func, mode) {
1456514578
var darken = mode === 'darken',

content/08-Reference/Raster/class.txt

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,9 +1157,9 @@ raster.on('load', function() {
11571157
</div>
11581158

11591159

1160-
<div id="setimagedata-data-point" class="member">
1160+
<div id="putimagedata-data-point" class="member">
11611161
<div class="member-link">
1162-
<a name="setimagedata-data-point" href="#setimagedata-data-point"><tt><b>setImageData</b>(data, point)</tt></a>
1162+
<a name="putimagedata-data-point" href="#putimagedata-data-point"><tt><b>putImageData</b>(data, point)</tt></a>
11631163
</div>
11641164
<div class="member-description hidden">
11651165
<div class="member-text">
@@ -1190,6 +1190,37 @@ raster.on('load', function() {
11901190

11911191

11921192

1193+
</div>
1194+
</div>
1195+
</div>
1196+
1197+
1198+
<div id="setimagedata-data" class="member">
1199+
<div class="member-link">
1200+
<a name="setimagedata-data" href="#setimagedata-data"><tt><b>setImageData</b>(data)</tt></a>
1201+
</div>
1202+
<div class="member-description hidden">
1203+
<div class="member-text">
1204+
1205+
1206+
1207+
<ul class="member-list">
1208+
<h4>Parameters:</h4>
1209+
1210+
<li>
1211+
<tt>data:</tt>
1212+
<tt>ImageData</tt>
1213+
1214+
1215+
</li>
1216+
1217+
</ul>
1218+
1219+
1220+
1221+
1222+
1223+
11931224
</div>
11941225
</div>
11951226
</div>

content/08-Reference/Segment/class.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
<p>The Segment object represents the points of a path through which its <a href="/reference/curve"><tt>Curve</tt></a> objects pass. The segments of a path can be accessed through its <a href="/reference/path#segments"><tt>path.segments</tt></a> array.</p>
5-
<p>Each segment consists of an anchor point (<a href="/reference/segment#point"><tt>segment.point</tt></a>) and optionaly an incoming and an outgoing handle (<a href="/reference/segment#handlein"><tt>segment.handleIn</tt></a> and <a href="/reference/segment#handleout"><tt>segment.handleOut</tt></a>), describing the tangents of the two <a href="/reference/curve"><tt>Curve</tt></a> objects that are connected by this segment.</p>
5+
<p>Each segment consists of an anchor point (<a href="/reference/segment#point"><tt>segment.point</tt></a>) and optionally an incoming and an outgoing handle (<a href="/reference/segment#handlein"><tt>segment.handleIn</tt></a> and <a href="/reference/segment#handleout"><tt>segment.handleOut</tt></a>), describing the tangents of the two <a href="/reference/curve"><tt>Curve</tt></a> objects that are connected by this segment.</p>
66

77
</div>
88

content/08-Reference/Shape/class.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ var shape = new Shape.Rectangle({
450450

451451
<script type="text/paperscript" canvas="canvas-9">
452452
var shape = new Shape.Rectangle({
453-
topLeft: [20, 20],
453+
topLeft: [20, 20],
454454
bottomRight: [80, 80],
455455
radius: 10,
456456
strokeColor: 'black'

content/08-Reference/classes.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h1>Index<span class="version text">0.12.15</span></h1>
1+
<h1>Index<span class="version text">0.12.16</span></h1>
22
<div class="reference"><ul class="reference-classes"><li><a href="/reference/global">Global Scope</a></li>
33
<li>
44
<h2>Basic Types</h2>
1.63 MB
Binary file not shown.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "paperjs.org",
3-
"version": "0.12.15",
3+
"version": "0.12.16",
44
"description": "The source of the Paper.js website http://paperjs.org, translated to the static pages in https://github.com/paperjs/paperjs.github.io by running it through https://github.com/studiomoniker/woods",
55
"license": "MIT",
66
"homepage": "http://paperjs.org",

0 commit comments

Comments
 (0)