paper 0.13.0 → 0.15.0

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +337 -0
  2. package/README.md +19 -14
  3. package/dist/docs/assets/js/paper.js +7351 -1706
  4. package/dist/docs/classes/AreaText.html +8658 -0
  5. package/dist/docs/classes/ChangeFlag.html +385 -0
  6. package/dist/docs/classes/Color.html +2 -1
  7. package/dist/docs/classes/CompoundPath.html +208 -69
  8. package/dist/docs/classes/Curve.html +2 -1
  9. package/dist/docs/classes/CurveLocation.html +2 -1
  10. package/dist/docs/classes/Event.html +5 -4
  11. package/dist/docs/classes/Gradient.html +2 -1
  12. package/dist/docs/classes/GradientStop.html +2 -1
  13. package/dist/docs/classes/Group.html +204 -17
  14. package/dist/docs/classes/HitResult.html +4 -2
  15. package/dist/docs/classes/HostItem.html +6786 -0
  16. package/dist/docs/classes/Item.html +193 -17
  17. package/dist/docs/classes/Key.html +2 -1
  18. package/dist/docs/classes/KeyEvent.html +5 -4
  19. package/dist/docs/classes/Layer.html +201 -17
  20. package/dist/docs/classes/Matrix.html +2 -1
  21. package/dist/docs/classes/MouseEvent.html +5 -4
  22. package/dist/docs/classes/PaperScope.html +5 -2
  23. package/dist/docs/classes/PaperScript.html +6 -2
  24. package/dist/docs/classes/Path.html +183 -70
  25. package/dist/docs/classes/PathItem.html +326 -187
  26. package/dist/docs/classes/PathText.html +8528 -0
  27. package/dist/docs/classes/Point.html +13 -2
  28. package/dist/docs/classes/PointText.html +1404 -63
  29. package/dist/docs/classes/Project.html +221 -1
  30. package/dist/docs/classes/Raster.html +136 -17
  31. package/dist/docs/classes/Rectangle.html +3 -2
  32. package/dist/docs/classes/Segment.html +2 -1
  33. package/dist/docs/classes/Shape.html +136 -17
  34. package/dist/docs/classes/Size.html +4 -2
  35. package/dist/docs/classes/Style.html +768 -15
  36. package/dist/docs/classes/SymbolDefinition.html +2 -1
  37. package/dist/docs/classes/SymbolItem.html +136 -17
  38. package/dist/docs/classes/TextItem.html +1566 -222
  39. package/dist/docs/classes/TextRange.html +186 -0
  40. package/dist/docs/classes/TextStory.html +355 -0
  41. package/dist/docs/classes/Tool.html +127 -1
  42. package/dist/docs/classes/ToolEvent.html +57 -4
  43. package/dist/docs/classes/Tween.html +17 -1
  44. package/dist/docs/classes/View.html +148 -5
  45. package/dist/docs/classes/global.html +2 -1
  46. package/dist/docs/classes/index.html +2 -2
  47. package/dist/docs/index.html +1 -1
  48. package/dist/paper-core.js +7160 -1663
  49. package/dist/paper-core.min.js +3 -3
  50. package/dist/paper-full.js +7351 -1706
  51. package/dist/paper-full.min.js +3 -3
  52. package/dist/paper-hosted.js +24058 -0
  53. package/dist/paper.d.ts +1996 -155
  54. package/examples/Scripts/AreaText.html +65 -0
  55. package/examples/Scripts/PathText.html +48 -0
  56. package/examples/Scripts/TextRanges.html +51 -0
  57. package/package.json +8 -11
@@ -20,6 +20,7 @@
20
20
  <p>The Layer item represents a layer in a Paper.js project.</p>
21
21
  <p>The layer which is currently active can be accessed through <a href="../classes/Project.html#activelayer"><tt>project.activeLayer</tt></a>. An array of all layers in a project can be accessed through <a href="../classes/Project.html#layers"><tt>project.layers</tt></a>.</p>
22
22
 
23
+
23
24
  </div>
24
25
 
25
26
  <!-- =============================== constructors ========================== -->
@@ -187,6 +188,32 @@ console.log(project.activeLayer == firstLayer); // true</code></pre>
187
188
  <div class="reference-members"><h2>Properties inherited from <a href="../classes/Item.html"><tt>Item</tt></a></h2>
188
189
 
189
190
 
191
+ <div id="key" class="member">
192
+ <div class="member-link">
193
+ <a name="key" href="#key"><tt><b>key</b></tt></a>
194
+ </div>
195
+ <div class="member-description hidden">
196
+
197
+ <div class="member-text">
198
+ <p>The key of the host&rsquo;s node that the item represents, in a project backed by a host document, see <a href="../classes/Project.html#host"><tt>project.host</tt></a>. It can only be set once, on an item created by a script, to register the key that the host gave its new node.</p>
199
+
200
+
201
+
202
+ <ul class="member-list">
203
+ <h4>Type:</h4>
204
+ <li>
205
+ <tt>Number</tt>
206
+ </li>
207
+ </ul>
208
+
209
+
210
+
211
+ </div>
212
+
213
+ </div>
214
+ </div>
215
+
216
+
190
217
  <div id="id" class="member">
191
218
  <div class="member-link">
192
219
  <a name="id" href="#id"><tt><b>id</b></tt></a>
@@ -533,7 +560,7 @@ path.visible = false;
533
560
  <div class="member-description hidden">
534
561
 
535
562
  <div class="member-text">
536
- <p>The blend mode with which the item is composited onto the canvas. Both the standard canvas compositing modes, as well as the new CSS blend modes are supported. If blend-modes cannot be rendered natively, they are emulated. Be aware that emulation can have an impact on performance.</p>
563
+ <p>The blend mode with which the item is composited onto the canvas. Both the standard canvas compositing modes, as well as the new CSS blend modes are supported. Where the canvas doesn&rsquo;t support a CSS blend mode natively, it draws as <code>&#39;normal&#39;</code>. Paper.js&rsquo;s own modes <code>&#39;add&#39;</code>, <code>&#39;subtract&#39;</code>, <code>&#39;average&#39;</code>, <code>&#39;pin-light&#39;</code> and <code>&#39;negation&#39;</code> are emulated, which can have an impact on performance.</p>
537
564
 
538
565
 
539
566
  <ul class="member-list">
@@ -686,6 +713,42 @@ circle2.opacity = 0.5;
686
713
  </div>
687
714
 
688
715
 
716
+ <div id="textwrap" class="member">
717
+ <div class="member-link">
718
+ <a name="textwrap" href="#textwrap"><tt><b>textWrap</b></tt></a>
719
+ </div>
720
+ <div class="member-description hidden">
721
+
722
+ <div class="member-text">
723
+ <p>Specifies whether, and how, the item pushes aside the text of the <a href="../classes/AreaText.html"><tt>AreaText</tt></a> items below it in its layer: <code>null</code>, or an object with <code>offset</code>, the space kept between them, and <code>invert</code>, to let the text flow inside it instead. <code>true</code> sets the defaults.</p>
724
+
725
+
726
+
727
+ <ul class="member-list">
728
+ <h4>Default:</h4>
729
+ <li><tt>null</tt></li>
730
+ </ul>
731
+
732
+ <ul class="member-list">
733
+ <h4>Type:</h4>
734
+ <li>
735
+ <tt>Object</tt>
736
+ </li>
737
+ </ul>
738
+
739
+
740
+ <h4>Example:</h4>
741
+
742
+
743
+ <pre><code>var circle = new Path.Circle({ center: [100, 100], radius: 40 });
744
+ circle.textWrap = { offset: 10 };</code></pre>
745
+
746
+ </div>
747
+
748
+ </div>
749
+ </div>
750
+
751
+
689
752
  <div id="selected" class="member">
690
753
  <div class="member-link">
691
754
  <a name="selected" href="#selected"><tt><b>selected</b></tt></a>
@@ -743,6 +806,32 @@ path.selected = true; // Select the path
743
806
  </div>
744
807
 
745
808
 
809
+ </div>
810
+
811
+ </div>
812
+ </div>
813
+
814
+
815
+ <div id="fullyselected" class="member">
816
+ <div class="member-link">
817
+ <a name="fullyselected" href="#fullyselected"><tt><b>fullySelected</b></tt></a>
818
+ </div>
819
+ <div class="member-description hidden">
820
+
821
+ <div class="member-text">
822
+ <p>Specifies whether the item and all its descendants are selected. Setting it selects or deselects them all.</p>
823
+
824
+
825
+
826
+ <ul class="member-list">
827
+ <h4>Type:</h4>
828
+ <li>
829
+ <tt>Boolean</tt>
830
+ </li>
831
+ </ul>
832
+
833
+
834
+
746
835
  </div>
747
836
 
748
837
  </div>
@@ -982,6 +1071,7 @@ circle.position.x += 100;
982
1071
 
983
1072
  <div class="member-text">
984
1073
  <p>The bounding rectangle of the item including stroke width.</p>
1074
+ <p>Setting it fits the item&rsquo;s <a href="../classes/Item.html#bounds"><tt>bounds</tt></a> into the given rectangle minus the extent of the stroke on each side, also where this extent changes with the item&rsquo;s proportions, as with miters. A rectangle smaller than the stroke itself shrinks the bounds to its center.</p>
985
1075
 
986
1076
 
987
1077
 
@@ -1270,6 +1360,34 @@ circle.position.x += 100;
1270
1360
 
1271
1361
 
1272
1362
 
1363
+ </div>
1364
+
1365
+ </div>
1366
+ </div>
1367
+
1368
+
1369
+ <div id="scope" class="member">
1370
+ <div class="member-link">
1371
+ <a name="scope" href="#scope"><tt><b>scope</b></tt></a>
1372
+ </div>
1373
+ <div class="member-description hidden">
1374
+
1375
+ <div class="member-text">
1376
+ <p>The scope that this item belongs to, through its project.</p>
1377
+
1378
+ <p>Read only.</p>
1379
+
1380
+
1381
+
1382
+ <ul class="member-list">
1383
+ <h4>Type:</h4>
1384
+ <li>
1385
+ <a href="../classes/PaperScope.html"><tt>PaperScope</tt></a>
1386
+ </li>
1387
+ </ul>
1388
+
1389
+
1390
+
1273
1391
  </div>
1274
1392
 
1275
1393
  </div>
@@ -1885,7 +2003,7 @@ path3.strokeJoin = 'bevel';
1885
2003
  <div class="member-description hidden">
1886
2004
 
1887
2005
  <div class="member-text">
1888
- <p>Specifies whether the stroke is to be drawn taking the current affine transformation into account (the default behavior), or whether it should appear as a non-scaling stroke.</p>
2006
+ <p>Specifies whether the stroke is to be drawn taking the current affine transformation into account (the default behavior), or whether it should appear as a non-scaling stroke. On text, non-scaling strokes are exact for uniform scaling only, as the glyphs are always stroked through the transformation.</p>
1889
2007
 
1890
2008
 
1891
2009
 
@@ -3093,9 +3211,9 @@ for (var i = 0; i < 20; i++) {
3093
3211
  <p>Rasterizes the item into a newly created Raster object. The item itself is not removed after rasterization.</p>
3094
3212
  <ul class="member-list">
3095
3213
  <h4>Options:</h4>
3096
- <li><tt>resolution: <tt>Number</tt></tt> &mdash; the desired resolution to be used when rasterizing, in pixels per inch (DPI). If not specified, the value of <code>view.resolution</code> is used by default. &mdash;&nbsp;default: <tt>view.resolution</tt></li>
3097
- <li><tt>raster: <a href="../classes/Raster.html"><tt>Raster</tt></a></tt> &mdash; specifies a raster to be reused when rasterizing. If the raster has the desired size already, then the underlying canvas is reused and no new memory needs to be allocated. If no raster is provided, a new raster item is created and returned instead. &mdash;&nbsp;default: <tt>null</tt></li>
3098
- <li><tt>insert: <tt>Boolean</tt></tt> &mdash; specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the rasterized item. &mdash;&nbsp;default: <tt>true</tt></li>
3214
+ <li><tt>options.resolution: <tt>Number</tt></tt> &mdash; the desired resolution to be used when rasterizing, in pixels per inch (DPI). If not specified, the value of <code>view.resolution</code> is used by default. &mdash;&nbsp;default: <tt>view.resolution</tt></li>
3215
+ <li><tt>options.raster: <a href="../classes/Raster.html"><tt>Raster</tt></a></tt> &mdash; specifies a raster to be reused when rasterizing. If the raster has the desired size already, then the underlying canvas is reused and no new memory needs to be allocated. If no raster is provided, a new raster item is created and returned instead. &mdash;&nbsp;default: <tt>null</tt></li>
3216
+ <li><tt>options.insert: <tt>Boolean</tt></tt> &mdash; specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the rasterized item. &mdash;&nbsp;default: <tt>true</tt></li>
3099
3217
  </ul>
3100
3218
 
3101
3219
  <ul class="member-list">
@@ -3280,7 +3398,7 @@ function onMouseDown(event) {
3280
3398
  </div>
3281
3399
  <div class="member-description hidden">
3282
3400
  <div class="member-text">
3283
-
3401
+ <p>Checks whether the item overlaps with the given item: whether their outlines cross, or one contains the other, as <a href="../classes/Rectangle.html#intersects-rect"><tt>rectangle.intersects(rect)</tt></a> does for rectangles. Items other than paths and shapes are checked through their bounds. To only check whether outlines cross, use <a href="../classes/PathItem.html#getintersections-path"><tt>pathItem.getIntersections(path)</tt></a>.</p>
3284
3402
 
3285
3403
 
3286
3404
  <ul class="member-list">
@@ -3300,7 +3418,7 @@ function onMouseDown(event) {
3300
3418
  <h4>Returns:</h4>
3301
3419
 
3302
3420
  <li>
3303
- <tt><tt>Boolean</tt></tt>
3421
+ <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the items overlap, <tt>false</tt> otherwise
3304
3422
  </li>
3305
3423
 
3306
3424
 
@@ -3796,6 +3914,7 @@ function onMouseDown(event) {
3796
3914
  <div class="member-text">
3797
3915
  <p>Converts the provided SVG content into Paper.js items and adds them to the this item&rsquo;s children list. Note that the item is not cleared first. You can call <a href="../classes/Item.html#removechildren"><tt>item.removeChildren</tt></a>() to do so.</p>
3798
3916
  <p><code>&lt;symbol&gt;</code> elements are imported as <a href="../classes/SymbolDefinition.html"><tt>SymbolDefinition</tt></a> items, and the <code>&lt;use&gt;</code> elements that place them as <a href="../classes/SymbolItem.html"><tt>SymbolItem</tt></a> items. The styles that <code>&lt;use&gt;</code> elements inherit don&rsquo;t reach the symbols&rsquo; content.</p>
3917
+ <p>URLs are fetched as they are, so validate URLs that come from untrusted sources first, especially on servers, where they could reach internal addresses.</p>
3799
3918
  <ul class="member-list">
3800
3919
  <h4>Options:</h4>
3801
3920
  <li><tt>options.expandShapes: <tt>Boolean</tt></tt> &mdash; whether imported shape items should be expanded to path items &mdash;&nbsp;default: <tt>false</tt></li>
@@ -4349,11 +4468,11 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
4349
4468
 
4350
4469
  <div id="replacewith-item" class="member">
4351
4470
  <div class="member-link">
4352
- <a name="replacewith-item" href="#replacewith-item"><tt><b>replaceWith</b>(item)</tt></a>
4471
+ <a name="replacewith-item" href="#replacewith-item"><tt><b>replaceWith</b>(...item)</tt></a>
4353
4472
  </div>
4354
4473
  <div class="member-description hidden">
4355
4474
  <div class="member-text">
4356
- <p>Replaces this item with the provided new item which will takes its place in the project hierarchy instead.</p>
4475
+ <p>Replaces this item with the provided new items which will take its place in the project hierarchy instead, in the given order. This also ungroups a group, e.g. <code>group.replaceWith(…group.children)</code>, but note that the items keep their own matrices, see <a href="../classes/Group.html#ungroup"><tt>group.ungroup</tt></a>().</p>
4357
4476
 
4358
4477
 
4359
4478
  <ul class="member-list">
@@ -4362,7 +4481,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
4362
4481
  <li>
4363
4482
  <tt>item:</tt>
4364
4483
  <a href="../classes/Item.html"><tt>Item</tt></a>
4365
- &mdash;&nbsp;the item that will replace this item
4484
+ &mdash;&nbsp;the items that will replace this item
4366
4485
 
4367
4486
  </li>
4368
4487
 
@@ -4535,7 +4654,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
4535
4654
  </div>
4536
4655
  <div class="member-description hidden">
4537
4656
  <div class="member-text">
4538
- <p>Checks whether the item has a fill.</p>
4657
+ <p>Checks whether the item has a visible fill, a fill color with an alpha above 0. Hit-tests also hit transparent fills, see <a href="../classes/Item.html#hittest"><tt>hitTest</tt></a>.</p>
4539
4658
 
4540
4659
 
4541
4660
 
@@ -4543,7 +4662,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
4543
4662
  <h4>Returns:</h4>
4544
4663
 
4545
4664
  <li>
4546
- <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the item has a fill, <tt>false</tt> otherwise
4665
+ <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the item has a visible fill, <tt>false</tt> otherwise
4547
4666
  </li>
4548
4667
 
4549
4668
 
@@ -6177,10 +6296,10 @@ function onMouseDown(event) {
6177
6296
  <p>Removes the item when the events specified in the passed options object occur.</p>
6178
6297
  <ul class="member-list">
6179
6298
  <h4>Options:</h4>
6180
- <li><tt>options.move: undefined</tt> &mdash; {Boolean) remove the item when the next <a href="../classes/Tool.html#onmousemove"><tt>tool.onMouseMove</tt></a> event is fired.</li>
6181
- <li><tt>options.drag: undefined</tt> &mdash; {Boolena) remove the item when the next <a href="../classes/Tool.html#onmousedrag"><tt>tool.onMouseDrag</tt></a> event is fired.</li>
6182
- <li><tt>options.down: undefined</tt> &mdash; {Boolean) remove the item when the next <a href="../classes/Tool.html#onmousedown"><tt>tool.onMouseDown</tt></a> event is fired.</li>
6183
- <li><tt>options.up: undefined</tt> &mdash; {Boolean) remove the item when the next <a href="../classes/Tool.html#onmouseup"><tt>tool.onMouseUp</tt></a> event is fired.</li>
6299
+ <li><tt>options.move: <tt>Boolean</tt></tt> &mdash; remove the item when the next <a href="../classes/Tool.html#onmousemove"><tt>tool.onMouseMove</tt></a> event is fired.</li>
6300
+ <li><tt>options.drag: <tt>Boolean</tt></tt> &mdash; remove the item when the next <a href="../classes/Tool.html#onmousedrag"><tt>tool.onMouseDrag</tt></a> event is fired.</li>
6301
+ <li><tt>options.down: <tt>Boolean</tt></tt> &mdash; remove the item when the next <a href="../classes/Tool.html#onmousedown"><tt>tool.onMouseDown</tt></a> event is fired.</li>
6302
+ <li><tt>options.up: <tt>Boolean</tt></tt> &mdash; remove the item when the next <a href="../classes/Tool.html#onmouseup"><tt>tool.onMouseUp</tt></a> event is fired.</li>
6184
6303
  </ul>
6185
6304
 
6186
6305
  <ul class="member-list">
@@ -6872,14 +6991,79 @@ function onFrame(event) {
6872
6991
  </div>
6873
6992
  </div>
6874
6993
 
6994
+
6995
+ <div id="isolated" class="member">
6996
+ <div class="member-link">
6997
+ <a name="isolated" href="#isolated"><tt><b>isolated</b></tt></a>
6998
+ </div>
6999
+ <div class="member-description hidden">
7000
+
7001
+ <div class="member-text">
7002
+ <p>Specifies whether the group is isolated, drawn through a temporary canvas, so that the blend modes of its children only apply within it, like CSS&rsquo;s <code>isolation: isolate</code>. Without it, a compositing mode such as <code>&#39;destination-out&#39;</code> affects everything drawn below the group, also in other layers. Groups with an <a href="../classes/Item.html#opacity"><tt>item.opacity</tt></a> below 1 or a <a href="../classes/Item.html#blendmode"><tt>item.blendMode</tt></a> are isolated anyway.</p>
7003
+
7004
+
7005
+
7006
+ <ul class="member-list">
7007
+ <h4>Default:</h4>
7008
+ <li><tt>false</tt></li>
7009
+ </ul>
7010
+
7011
+ <ul class="member-list">
7012
+ <h4>Type:</h4>
7013
+ <li>
7014
+ <tt>Boolean</tt>
7015
+ </li>
7016
+ </ul>
7017
+
7018
+
7019
+
7020
+ </div>
7021
+
7022
+ </div>
7023
+ </div>
7024
+
7025
+ </div>
7026
+
7027
+
7028
+ <!-- =========================== inherited methods ========================= -->
7029
+ <div class="reference-members"><h2>Methods inherited from <a href="../classes/Group.html"><tt>Group</tt></a></h2>
7030
+
7031
+
7032
+ <div id="ungroup" class="member">
7033
+ <div class="member-link">
7034
+ <a name="ungroup" href="#ungroup"><tt><b>ungroup</b>()</tt></a>
7035
+ </div>
7036
+ <div class="member-description hidden">
7037
+ <div class="member-text">
7038
+ <p>Replaces the group with its children, which keep their appearance: the group&rsquo;s matrix is applied to them, and its clipping mask is released.</p>
7039
+
7040
+
7041
+
7042
+ <ul class="member-list">
7043
+ <h4>Returns:</h4>
7044
+
7045
+ <li>
7046
+ <tt>Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects</tt>&nbsp;&mdash;&nbsp;the children, or <code>null</code> if the group has no parent
7047
+ </li>
7048
+
7049
+
7050
+ </ul>
7051
+
7052
+
7053
+
7054
+
7055
+
7056
+ </div>
7057
+ </div>
6875
7058
  </div>
6876
7059
 
7060
+ </div>
6877
7061
 
6878
7062
 
6879
7063
 
6880
7064
  <!-- =========================== copyright notice ========================== -->
6881
7065
  <p class="footer">
6882
- Paper.js v0.13.0<br>
7066
+ Paper.js v0.15.0<br>
6883
7067
  Copyright &#169; 2011—2026 <a href="http://www.lehni.org" target="_blank">J&uuml;rg Lehni</a> &amp; <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
6884
7068
  <div class="content-end"></div>
6885
7069
 
@@ -24,6 +24,7 @@
24
24
  <p>Note the locations of b and c.</p>
25
25
  <p>This class is optimized for speed and minimizes calculations based on its knowledge of the underlying matrix (as opposed to say simply performing matrix multiplication).</p>
26
26
 
27
+
27
28
  </div>
28
29
 
29
30
  <!-- =============================== constructors ========================== -->
@@ -1735,7 +1736,7 @@ Array of <tt>Numbers</tt>
1735
1736
 
1736
1737
  <!-- =========================== copyright notice ========================== -->
1737
1738
  <p class="footer">
1738
- Paper.js v0.13.0<br>
1739
+ Paper.js v0.15.0<br>
1739
1740
  Copyright &#169; 2011—2026 <a href="http://www.lehni.org" target="_blank">J&uuml;rg Lehni</a> &amp; <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
1740
1741
  <div class="content-end"></div>
1741
1742
 
@@ -19,6 +19,7 @@
19
19
 
20
20
  <p>The MouseEvent object is received by the <a href="../classes/Item.html"><tt>Item</tt></a>&rsquo;s mouse event handlers <a href="../classes/Item.html#onmousedown"><tt>item.onMouseDown</tt></a>, <a href="../classes/Item.html#onmousedrag"><tt>item.onMouseDrag</tt></a>, <a href="../classes/Item.html#onmousemove"><tt>item.onMouseMove</tt></a>, <a href="../classes/Item.html#onmouseup"><tt>item.onMouseUp</tt></a>, <a href="../classes/Item.html#onclick"><tt>item.onClick</tt></a>, <a href="../classes/Item.html#ondoubleclick"><tt>item.onDoubleClick</tt></a>, <a href="../classes/Item.html#onmouseenter"><tt>item.onMouseEnter</tt></a> and <a href="../classes/Item.html#onmouseleave"><tt>item.onMouseLeave</tt></a>. The MouseEvent object is the only parameter passed to these functions and contains information about the mouse event.</p>
21
21
 
22
+
22
23
  </div>
23
24
 
24
25
 
@@ -214,14 +215,14 @@
214
215
  <div class="reference-members"><h2>Properties inherited from <a href="../classes/Event.html"><tt>Event</tt></a></h2>
215
216
 
216
217
 
217
- <div id="timestamp" class="member">
218
+ <div id="time" class="member">
218
219
  <div class="member-link">
219
- <a name="timestamp" href="#timestamp"><tt><b>timeStamp</b></tt></a>
220
+ <a name="time" href="#time"><tt><b>time</b></tt></a>
220
221
  </div>
221
222
  <div class="member-description hidden">
222
223
 
223
224
  <div class="member-text">
224
- <p>The time at which the event was created, in milliseconds since the epoch.</p>
225
+ <p>The time at which the event was created, in seconds, as the times of frame events are. Browsers count from the page&rsquo;s time origin, as <code>performance.now()</code> does, while <a href="../classes/View.html#dispatchmouseevent-type-point"><tt>view.dispatchMouseEvent(type, point[, options])</tt></a> and <a href="../classes/View.html#dispatchkeyevent-type-key"><tt>view.dispatchKeyEvent(type, key[, options])</tt></a> use <code>Date.now()</code> unless the host passes a time, so only compare the times of events from the same source.</p>
225
226
 
226
227
  <p>Read only.</p>
227
228
 
@@ -346,7 +347,7 @@
346
347
 
347
348
  <!-- =========================== copyright notice ========================== -->
348
349
  <p class="footer">
349
- Paper.js v0.13.0<br>
350
+ Paper.js v0.15.0<br>
350
351
  Copyright &#169; 2011—2026 <a href="http://www.lehni.org" target="_blank">J&uuml;rg Lehni</a> &amp; <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
351
352
  <div class="content-end"></div>
352
353
 
@@ -20,6 +20,7 @@
20
20
  <p>Paper classes can only be accessed through <code>PaperScope</code> objects. Thus in PaperScript they are global, while in JavaScript, they are available on the global <a href="../classes/global.html#paper"><tt>paper</tt></a> object. For JavaScript you can use <a href="../classes/PaperScope.html#install-scope"><tt>paperScope.install(scope)</tt></a> to install the Paper classes and objects on the global scope. Note that when working with more than one scope, this still works for classes, but not for objects like <a href="../classes/PaperScope.html#project"><tt>paperScope.project</tt></a>, since they are not updated in the injected scope if scopes are switched.</p>
21
21
  <p>The global <a href="../classes/global.html#paper"><tt>paper</tt></a> object is simply a reference to the currently active <code>PaperScope</code>.</p>
22
22
 
23
+
23
24
  </div>
24
25
 
25
26
  <!-- =============================== constructors ========================== -->
@@ -116,7 +117,9 @@
116
117
  <li><tt>settings.insertItems: <tt>Boolean</tt></tt> &mdash; controls whether newly created items are automatically inserted into the scene graph, by adding them to <a href="../classes/Project.html#activelayer"><tt>project.activeLayer</tt></a> &mdash;&nbsp;default: <tt>true</tt></li>
117
118
  <li><tt>settings.applyMatrix: <tt>Boolean</tt></tt> &mdash; controls what value newly created items have their <a href="../classes/Item.html#applymatrix"><tt>item.applyMatrix</tt></a> property set to (Note that not all items can set this to <code>false</code>) &mdash;&nbsp;default: <tt>true</tt></li>
118
119
  <li><tt>settings.handleSize: <tt>Number</tt></tt> &mdash; the size of the curve handles when drawing selections &mdash;&nbsp;default: <tt>4</tt></li>
119
- <li><tt>settings.hitTolerance: <tt>Number</tt></tt> &mdash; the default tolerance for hit- tests, when no value is specified &mdash;&nbsp;default: <tt>0</tt></li>
120
+ <li><tt>settings.segmentSize: <tt>Number</tt></tt> &mdash; the size of the segments when drawing selections, or <code>null</code> to use <code>settings.handleSize</code>, e.g. with <code>handleSize: 0</code> to only draw the segments and not their handles &mdash;&nbsp;default: <tt>null</tt></li>
121
+ <li><tt>settings.hitTolerance: <tt>Number</tt></tt> &mdash; the default tolerance for hit- tests, when no value is specified, and for the mouse events of items &mdash;&nbsp;default: <tt>0</tt></li>
122
+ <li><tt>settings.scaleStrokes: <tt>Boolean</tt></tt> &mdash; controls whether applying a matrix to the content of paths and compound paths also scales their <a href="../classes/Style.html#strokewidth"><tt>style.strokeWidth</tt></a>, by the geometric mean of the scale factors for non-uniform scaling. Items that keep their matrix, with <a href="../classes/Item.html#applymatrix"><tt>item.applyMatrix</tt></a> set to <code>false</code>, scale their strokes when drawing anyway, unless <a href="../classes/Style.html#strokescaling"><tt>style.strokeScaling</tt></a> is <code>false</code> &mdash;&nbsp;default: <tt>false</tt></li>
120
123
  </ul>
121
124
 
122
125
 
@@ -536,7 +539,7 @@
536
539
 
537
540
  <!-- =========================== copyright notice ========================== -->
538
541
  <p class="footer">
539
- Paper.js v0.13.0<br>
542
+ Paper.js v0.15.0<br>
540
543
  Copyright &#169; 2011—2026 <a href="http://www.lehni.org" target="_blank">J&uuml;rg Lehni</a> &amp; <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
541
544
  <div class="content-end"></div>
542
545
 
@@ -17,6 +17,7 @@
17
17
 
18
18
 
19
19
 
20
+
20
21
  </div>
21
22
 
22
23
 
@@ -95,6 +96,9 @@
95
96
  <h4>Options:</h4>
96
97
  <li><tt>options.url: <tt>String</tt></tt> &mdash; the url of the source, for source-map generation</li>
97
98
  <li><tt>options.source: <tt>String</tt></tt> &mdash; the source to be used for the source- mapping, in case the code that&rsquo;s passed in has already been mingled.</li>
99
+ <li><tt>options.handlers: Array of <tt>Strings</tt></tt> &mdash; the names of further global handlers to export next to <code>onFrame</code>, <code>onResize</code> and the tool&rsquo;s handlers, for hosts that call them themselves</li>
100
+ <li><tt>options.load: <tt>Function</tt></tt> &mdash; the loader for static <code>import</code> statements, called with the specifier as written and the <code>options.url</code> of the importing script, and returning the module&rsquo;s exports, e.g. the result of executing it. Modules with ES <code>export</code> statements have their default export as <code>default</code> and are marked with <code>__esModule</code>, so <code>import x</code> receives the default export, and for CommonJS-style exports the whole exports. <code>import * as x</code> receives all exports, and for CommonJS-style exports, these as <code>default</code> too. Dynamic <code>import(specifier)</code> resolves to that namespace as a Promise, and its loader may return a Promise as well. The loader runs each module once and handles cycles. Parsing <code>import</code> requires a current Acorn as <code>self.acorn</code>
101
+ Code with top-level <code>await</code> runs as an async function. <code>execute()</code> then returns a Promise of the exports, and installs the global handlers once it resolves. Parsing it requires a current Acorn as <code>self.acorn</code>.</li>
98
102
  </ul>
99
103
 
100
104
  <ul class="member-list">
@@ -128,7 +132,7 @@
128
132
  <h4>Returns:</h4>
129
133
 
130
134
  <li>
131
- <tt><tt>Object</tt></tt>&nbsp;&mdash;&nbsp;the exports defined in the executed code
135
+ <tt><tt>Object</tt>⟋<tt>Promise</tt></tt>&nbsp;&mdash;&nbsp;the exports defined in the executed code, or with top-level <code>await</code>, a Promise of them
132
136
  </li>
133
137
 
134
138
 
@@ -189,7 +193,7 @@
189
193
 
190
194
  <!-- =========================== copyright notice ========================== -->
191
195
  <p class="footer">
192
- Paper.js v0.13.0<br>
196
+ Paper.js v0.15.0<br>
193
197
  Copyright &#169; 2011—2026 <a href="http://www.lehni.org" target="_blank">J&uuml;rg Lehni</a> &amp; <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
194
198
  <div class="content-end"></div>
195
199