paper 0.14.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 +252 -0
  2. package/README.md +3 -1
  3. package/dist/docs/assets/js/paper.js +6997 -1658
  4. package/dist/docs/classes/AreaText.html +8658 -0
  5. package/dist/docs/classes/ChangeFlag.html +2 -1
  6. package/dist/docs/classes/Color.html +2 -1
  7. package/dist/docs/classes/CompoundPath.html +152 -67
  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 +117 -15
  14. package/dist/docs/classes/HitResult.html +2 -1
  15. package/dist/docs/classes/HostItem.html +80 -15
  16. package/dist/docs/classes/Item.html +137 -15
  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 +114 -15
  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 +4 -2
  23. package/dist/docs/classes/PaperScript.html +5 -2
  24. package/dist/docs/classes/Path.html +126 -67
  25. package/dist/docs/classes/PathItem.html +270 -185
  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 +1346 -59
  29. package/dist/docs/classes/Project.html +40 -7
  30. package/dist/docs/classes/Raster.html +80 -15
  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 +80 -15
  34. package/dist/docs/classes/Size.html +4 -2
  35. package/dist/docs/classes/Style.html +767 -14
  36. package/dist/docs/classes/SymbolDefinition.html +2 -1
  37. package/dist/docs/classes/SymbolItem.html +80 -15
  38. package/dist/docs/classes/TextItem.html +1469 -179
  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 +2 -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 +9 -8
  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 +6832 -1637
  49. package/dist/paper-core.min.js +3 -3
  50. package/dist/paper-full.js +6997 -1658
  51. package/dist/paper-full.min.js +3 -3
  52. package/dist/{paper-sourced.js → paper-hosted.js} +7109 -1682
  53. package/dist/paper.d.ts +1727 -163
  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 +3 -2
@@ -20,6 +20,7 @@
20
20
  <p>The currently active project can be accessed through the <a href="../classes/PaperScope.html#project"><tt>paperScope.project</tt></a> variable.</p>
21
21
  <p>An array of all open projects is accessible through the <a href="../classes/PaperScope.html#projects"><tt>paperScope.projects</tt></a> variable.</p>
22
22
 
23
+
23
24
  </div>
24
25
 
25
26
  <!-- =============================== constructors ========================== -->
@@ -79,15 +80,17 @@
79
80
  <h2>Properties</h2>
80
81
 
81
82
 
82
- <div id="source" class="member">
83
+ <div id="host" class="member">
83
84
  <div class="member-link">
84
- <a name="source" href="#source"><tt><b>source</b></tt></a>
85
+ <a name="host" href="#host"><tt><b>host</b></tt></a>
85
86
  </div>
86
87
  <div class="member-description hidden">
87
88
 
88
89
  <div class="member-text">
89
- <p>The host document that the project&rsquo;s items come from. Setting it creates the project&rsquo;s layers from the source&rsquo;s records. All items are created as shells that load their content and children from the source on first access.</p>
90
- <p>The source provides: - <code>getChildren(key)</code>, which returns the records of the children of the node with the given key, or of the top level for <code>null</code>, as columns: <code>keys</code>, <code>types</code> (indices into <code>typeNames</code>), <code>typeNames</code>, <code>flags</code> (selected: 1, visible: 2, locked: 4, strokeScaling: 8, clipMask: 64, guide: 128, empty: 256), <code>boxes</code> (bounds, strokeBounds and roughBounds in the item&rsquo;s coordinates, 12 numbers per item), and the sparse objects <code>names</code> and <code>matrices</code>. - <code>getItem(key)</code>, which returns the node&rsquo;s own content in the form of <a href="../classes/Item.html#importjson-json"><tt>item.importJSON(json)</tt></a>, without children. - <code>getAncestorKeys(key)</code>, which returns the keys from the top level down to the node&rsquo;s parent.</p>
90
+ <p>The host document that the project&rsquo;s items come from. Setting it creates the project&rsquo;s layers from the host&rsquo;s records. All items are created as shells that load their content and children from the host on first access.</p>
91
+ <p>The host provides: - <code>getChildren(key)</code>, which returns the records of the children of the node with the given key, or of the top level for <code>null</code>, as columns: <code>keys</code>, <code>types</code> (indices into <code>typeNames</code>), <code>typeNames</code>, <code>flags</code> (selected: 1, visible: 2, locked: 4, strokeScaling: 8, clipMask: 64, guide: 128, empty: 256), <code>boxes</code> (bounds, strokeBounds and roughBounds in the item&rsquo;s coordinates, 12 numbers per item), and the sparse objects <code>names</code> and <code>matrices</code>. - <code>getItem(key)</code>, which returns the node&rsquo;s own content in the form of <a href="../classes/Item.html#importjson-json"><tt>item.importJSON(json)</tt></a>, without children. Linked text gives <code>linked</code>, the keys of its story&rsquo;s text items in order, and leaves out its story. - <code>getStory(key)</code>, for linked text, which returns its story with the key of any of its text items: <code>content</code> or <code>runs</code>, <code>paragraphs</code>, and the character and paragraph styles, as <a href="../classes/Item.html#exportjson-options"><tt>item.exportJSON(options)</tt></a> writes them in the JSON of a text item. - <code>getAncestorKeys(key)</code>, which returns the keys from the top level down to the node&rsquo;s parent. - Optionally <code>layOut(json, start, key)</code>, which lays out a text item from <code>start</code> in its story, given as the JSON string that <a href="../classes/Item.html#exportjson-options"><tt>item.exportJSON(options)</tt></a> writes of it as the script holds it, or as <code>null</code> where the script didn&rsquo;t change it since it loaded or the host took its changes with <a href="../classes/Project.html#takechanges"><tt>project.takeChanges</tt></a>(), for the host to lay out its own node, and returns <code>{ end, lines }</code>: where its visible text ends, and its lines, each <code>{ start, end, x, y, width, lineHeight, ascent,
92
+ descent, pieces }</code>, with pieces <code>{ start, end, x, y, dx, width,
93
+ rotation, size, ascent, descent, lineHeight }</code> and an optional <code>content</code>, as for a hyphen, all in the item&rsquo;s coordinates. <code>key</code> is null for text that the host doesn&rsquo;t know yet. Without it, Paper.js lays out text itself.</p>
91
94
 
92
95
 
93
96
 
@@ -439,7 +442,7 @@ var path2 = new Path.Circle(new Point(175, 50), 20);
439
442
  <h4>Returns:</h4>
440
443
 
441
444
  <li>
442
- <tt><a href="../classes/Item.html"><tt>Item</tt></a></tt>&nbsp;&mdash;&nbsp;the item, or <code>null</code> if the source has no such node
445
+ <tt><a href="../classes/Item.html"><tt>Item</tt></a></tt>&nbsp;&mdash;&nbsp;the item, or <code>null</code> if the host has no such node
443
446
  </li>
444
447
 
445
448
 
@@ -460,7 +463,7 @@ var path2 = new Path.Circle(new Point(175, 50), 20);
460
463
  </div>
461
464
  <div class="member-description hidden">
462
465
  <div class="member-text">
463
- <p>Updates the items of changed host nodes, given in the column format of the source&rsquo;s <code>getChildren()</code>, with two more flags: 16 when the node&rsquo;s own content changed, so the item loads it again on next access, and 32 when its list of children changed, so it loads them again right away if it had loaded them, keeping the items of nodes that remain. Nodes without items are skipped.</p>
466
+ <p>Updates the items of changed host nodes, given in the column format of the host&rsquo;s <code>getChildren()</code>, with two more flags: 16 when the node&rsquo;s own content changed, so the item loads it again on next access, and 32 when its list of children changed, so it loads them again right away if it had loaded them, keeping the items of nodes that remain. Nodes without items are skipped.</p>
464
467
 
465
468
 
466
469
  <ul class="member-list">
@@ -509,6 +512,35 @@ var path2 = new Path.Circle(new Point(175, 50), 20);
509
512
 
510
513
 
511
514
 
515
+ </div>
516
+ </div>
517
+ </div>
518
+
519
+
520
+ <div id="haschanges" class="member">
521
+ <div class="member-link">
522
+ <a name="haschanges" href="#haschanges"><tt><b>hasChanges</b>()</tt></a>
523
+ </div>
524
+ <div class="member-description hidden">
525
+ <div class="member-text">
526
+ <p>Checks whether changes were logged since tracking was activated or since the last call of <a href="../classes/Project.html#takechanges"><tt>takeChanges</tt></a>(), without taking them.</p>
527
+
528
+
529
+
530
+ <ul class="member-list">
531
+ <h4>Returns:</h4>
532
+
533
+ <li>
534
+ <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if changes were logged, <tt>false</tt> otherwise
535
+ </li>
536
+
537
+
538
+ </ul>
539
+
540
+
541
+
542
+
543
+
512
544
  </div>
513
545
  </div>
514
546
  </div>
@@ -1383,6 +1415,7 @@ for (var i = 0; i < items.length; i++) {
1383
1415
  <div class="member-text">
1384
1416
  <p>Converts the provided SVG content into Paper.js items and adds them to the active layer of this project. Note that the project is not cleared first. You can call <a href="../classes/Project.html#clear"><tt>project.clear</tt></a>() to do so.</p>
1385
1417
  <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>
1418
+ <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>
1386
1419
  <ul class="member-list">
1387
1420
  <h4>Options:</h4>
1388
1421
  <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>
@@ -1490,7 +1523,7 @@ for (var i = 0; i < items.length; i++) {
1490
1523
 
1491
1524
  <!-- =========================== copyright notice ========================== -->
1492
1525
  <p class="footer">
1493
- Paper.js v0.14.0<br>
1526
+ Paper.js v0.15.0<br>
1494
1527
  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>
1495
1528
  <div class="content-end"></div>
1496
1529
 
@@ -19,6 +19,7 @@
19
19
 
20
20
  <p>The Raster item represents an image in a Paper.js project.</p>
21
21
 
22
+
22
23
  </div>
23
24
 
24
25
  <!-- =============================== constructors ========================== -->
@@ -1276,7 +1277,7 @@ raster.on('load', function() {
1276
1277
  <div class="member-description hidden">
1277
1278
 
1278
1279
  <div class="member-text">
1279
- <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#source"><tt>project.source</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>
1280
+ <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>
1280
1281
 
1281
1282
 
1282
1283
 
@@ -1641,7 +1642,7 @@ path.visible = false;
1641
1642
  <div class="member-description hidden">
1642
1643
 
1643
1644
  <div class="member-text">
1644
- <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>
1645
+ <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>
1645
1646
 
1646
1647
 
1647
1648
  <ul class="member-list">
@@ -1794,6 +1795,42 @@ circle2.opacity = 0.5;
1794
1795
  </div>
1795
1796
 
1796
1797
 
1798
+ <div id="textwrap" class="member">
1799
+ <div class="member-link">
1800
+ <a name="textwrap" href="#textwrap"><tt><b>textWrap</b></tt></a>
1801
+ </div>
1802
+ <div class="member-description hidden">
1803
+
1804
+ <div class="member-text">
1805
+ <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>
1806
+
1807
+
1808
+
1809
+ <ul class="member-list">
1810
+ <h4>Default:</h4>
1811
+ <li><tt>null</tt></li>
1812
+ </ul>
1813
+
1814
+ <ul class="member-list">
1815
+ <h4>Type:</h4>
1816
+ <li>
1817
+ <tt>Object</tt>
1818
+ </li>
1819
+ </ul>
1820
+
1821
+
1822
+ <h4>Example:</h4>
1823
+
1824
+
1825
+ <pre><code>var circle = new Path.Circle({ center: [100, 100], radius: 40 });
1826
+ circle.textWrap = { offset: 10 };</code></pre>
1827
+
1828
+ </div>
1829
+
1830
+ </div>
1831
+ </div>
1832
+
1833
+
1797
1834
  <div id="selected" class="member">
1798
1835
  <div class="member-link">
1799
1836
  <a name="selected" href="#selected"><tt><b>selected</b></tt></a>
@@ -1851,6 +1888,32 @@ path.selected = true; // Select the path
1851
1888
  </div>
1852
1889
 
1853
1890
 
1891
+ </div>
1892
+
1893
+ </div>
1894
+ </div>
1895
+
1896
+
1897
+ <div id="fullyselected" class="member">
1898
+ <div class="member-link">
1899
+ <a name="fullyselected" href="#fullyselected"><tt><b>fullySelected</b></tt></a>
1900
+ </div>
1901
+ <div class="member-description hidden">
1902
+
1903
+ <div class="member-text">
1904
+ <p>Specifies whether the item and all its descendants are selected. Setting it selects or deselects them all.</p>
1905
+
1906
+
1907
+
1908
+ <ul class="member-list">
1909
+ <h4>Type:</h4>
1910
+ <li>
1911
+ <tt>Boolean</tt>
1912
+ </li>
1913
+ </ul>
1914
+
1915
+
1916
+
1854
1917
  </div>
1855
1918
 
1856
1919
  </div>
@@ -2090,6 +2153,7 @@ circle.position.x += 100;
2090
2153
 
2091
2154
  <div class="member-text">
2092
2155
  <p>The bounding rectangle of the item including stroke width.</p>
2156
+ <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>
2093
2157
 
2094
2158
 
2095
2159
 
@@ -4229,9 +4293,9 @@ for (var i = 0; i < 20; i++) {
4229
4293
  <p>Rasterizes the item into a newly created Raster object. The item itself is not removed after rasterization.</p>
4230
4294
  <ul class="member-list">
4231
4295
  <h4>Options:</h4>
4232
- <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>
4233
- <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>
4234
- <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>
4296
+ <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>
4297
+ <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>
4298
+ <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>
4235
4299
  </ul>
4236
4300
 
4237
4301
  <ul class="member-list">
@@ -4416,7 +4480,7 @@ function onMouseDown(event) {
4416
4480
  </div>
4417
4481
  <div class="member-description hidden">
4418
4482
  <div class="member-text">
4419
-
4483
+ <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>
4420
4484
 
4421
4485
 
4422
4486
  <ul class="member-list">
@@ -4436,7 +4500,7 @@ function onMouseDown(event) {
4436
4500
  <h4>Returns:</h4>
4437
4501
 
4438
4502
  <li>
4439
- <tt><tt>Boolean</tt></tt>
4503
+ <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the items overlap, <tt>false</tt> otherwise
4440
4504
  </li>
4441
4505
 
4442
4506
 
@@ -4932,6 +4996,7 @@ function onMouseDown(event) {
4932
4996
  <div class="member-text">
4933
4997
  <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>
4934
4998
  <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>
4999
+ <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>
4935
5000
  <ul class="member-list">
4936
5001
  <h4>Options:</h4>
4937
5002
  <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>
@@ -5485,11 +5550,11 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
5485
5550
 
5486
5551
  <div id="replacewith-item" class="member">
5487
5552
  <div class="member-link">
5488
- <a name="replacewith-item" href="#replacewith-item"><tt><b>replaceWith</b>(item)</tt></a>
5553
+ <a name="replacewith-item" href="#replacewith-item"><tt><b>replaceWith</b>(...item)</tt></a>
5489
5554
  </div>
5490
5555
  <div class="member-description hidden">
5491
5556
  <div class="member-text">
5492
- <p>Replaces this item with the provided new item which will takes its place in the project hierarchy instead.</p>
5557
+ <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>
5493
5558
 
5494
5559
 
5495
5560
  <ul class="member-list">
@@ -5498,7 +5563,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
5498
5563
  <li>
5499
5564
  <tt>item:</tt>
5500
5565
  <a href="../classes/Item.html"><tt>Item</tt></a>
5501
- &mdash;&nbsp;the item that will replace this item
5566
+ &mdash;&nbsp;the items that will replace this item
5502
5567
 
5503
5568
  </li>
5504
5569
 
@@ -7313,10 +7378,10 @@ function onMouseDown(event) {
7313
7378
  <p>Removes the item when the events specified in the passed options object occur.</p>
7314
7379
  <ul class="member-list">
7315
7380
  <h4>Options:</h4>
7316
- <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>
7317
- <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>
7318
- <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>
7319
- <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>
7381
+ <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>
7382
+ <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>
7383
+ <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>
7384
+ <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>
7320
7385
  </ul>
7321
7386
 
7322
7387
  <ul class="member-list">
@@ -7945,7 +8010,7 @@ path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
7945
8010
 
7946
8011
  <!-- =========================== copyright notice ========================== -->
7947
8012
  <p class="footer">
7948
- Paper.js v0.14.0<br>
8013
+ Paper.js v0.15.0<br>
7949
8014
  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>
7950
8015
  <div class="content-end"></div>
7951
8016
 
@@ -17,6 +17,7 @@
17
17
 
18
18
  <p>A Rectangle specifies an area that is enclosed by it&rsquo;s top-left point (x, y), its width, and its height. It should not be confused with a rectangular path, it is not an item.</p>
19
19
 
20
+
20
21
  </div>
21
22
 
22
23
  <!-- =============================== constructors ========================== -->
@@ -826,7 +827,7 @@
826
827
  <div class="member-text">
827
828
  <p>Specifies whether an item&rsquo;s bounds are to appear as selected.</p>
828
829
  <p>Paper.js draws the bounds of items with selected bounds on top of your project. This is very useful when debugging.</p>
829
- <p>This property is only available on the rectangle returned by <a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>, and the selection always shows these bounds. Rectangles returned by other getters such as <a href="../classes/Item.html#strokebounds"><tt>item.strokeBounds</tt></a> don&rsquo;t have it.</p>
830
+ <p>This property is only available on the rectangles returned by <a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a> and <a href="../classes/Item.html#strokebounds"><tt>item.strokeBounds</tt></a>, which are selected independently of each other, each showing its own bounds. Rectangles returned by other getters such as <a href="../classes/Item.html#handlebounds"><tt>item.handleBounds</tt></a> don&rsquo;t have it.</p>
830
831
 
831
832
 
832
833
 
@@ -1646,7 +1647,7 @@ intersectionPath.fillColor = 'red';
1646
1647
 
1647
1648
  <!-- =========================== copyright notice ========================== -->
1648
1649
  <p class="footer">
1649
- Paper.js v0.14.0<br>
1650
+ Paper.js v0.15.0<br>
1650
1651
  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>
1651
1652
  <div class="content-end"></div>
1652
1653
 
@@ -18,6 +18,7 @@
18
18
  <p>The Segment object represents the points of a path through which its <a href="../classes/Curve.html"><tt>Curve</tt></a> objects pass. The segments of a path can be accessed through its <a href="../classes/Path.html#segments"><tt>path.segments</tt></a> array.</p>
19
19
  <p>Each segment consists of an anchor point (<a href="../classes/Segment.html#point"><tt>segment.point</tt></a>) and optionally an incoming and an outgoing handle (<a href="../classes/Segment.html#handlein"><tt>segment.handleIn</tt></a> and <a href="../classes/Segment.html#handleout"><tt>segment.handleOut</tt></a>), describing the tangents of the two <a href="../classes/Curve.html"><tt>Curve</tt></a> objects that are connected by this segment.</p>
20
20
 
21
+
21
22
  </div>
22
23
 
23
24
  <!-- =============================== constructors ========================== -->
@@ -930,7 +931,7 @@ path.segments[2].selected = true;
930
931
 
931
932
  <!-- =========================== copyright notice ========================== -->
932
933
  <p class="footer">
933
- Paper.js v0.14.0<br>
934
+ Paper.js v0.15.0<br>
934
935
  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>
935
936
  <div class="content-end"></div>
936
937
 
@@ -19,6 +19,7 @@
19
19
 
20
20
 
21
21
 
22
+
22
23
  </div>
23
24
 
24
25
  <!-- =============================== constructors ========================== -->
@@ -777,7 +778,7 @@ var shape = new Shape.Ellipse({
777
778
  <div class="member-description hidden">
778
779
 
779
780
  <div class="member-text">
780
- <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#source"><tt>project.source</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>
781
+ <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>
781
782
 
782
783
 
783
784
 
@@ -1142,7 +1143,7 @@ path.visible = false;
1142
1143
  <div class="member-description hidden">
1143
1144
 
1144
1145
  <div class="member-text">
1145
- <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>
1146
+ <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>
1146
1147
 
1147
1148
 
1148
1149
  <ul class="member-list">
@@ -1295,6 +1296,42 @@ circle2.opacity = 0.5;
1295
1296
  </div>
1296
1297
 
1297
1298
 
1299
+ <div id="textwrap" class="member">
1300
+ <div class="member-link">
1301
+ <a name="textwrap" href="#textwrap"><tt><b>textWrap</b></tt></a>
1302
+ </div>
1303
+ <div class="member-description hidden">
1304
+
1305
+ <div class="member-text">
1306
+ <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>
1307
+
1308
+
1309
+
1310
+ <ul class="member-list">
1311
+ <h4>Default:</h4>
1312
+ <li><tt>null</tt></li>
1313
+ </ul>
1314
+
1315
+ <ul class="member-list">
1316
+ <h4>Type:</h4>
1317
+ <li>
1318
+ <tt>Object</tt>
1319
+ </li>
1320
+ </ul>
1321
+
1322
+
1323
+ <h4>Example:</h4>
1324
+
1325
+
1326
+ <pre><code>var circle = new Path.Circle({ center: [100, 100], radius: 40 });
1327
+ circle.textWrap = { offset: 10 };</code></pre>
1328
+
1329
+ </div>
1330
+
1331
+ </div>
1332
+ </div>
1333
+
1334
+
1298
1335
  <div id="selected" class="member">
1299
1336
  <div class="member-link">
1300
1337
  <a name="selected" href="#selected"><tt><b>selected</b></tt></a>
@@ -1352,6 +1389,32 @@ path.selected = true; // Select the path
1352
1389
  </div>
1353
1390
 
1354
1391
 
1392
+ </div>
1393
+
1394
+ </div>
1395
+ </div>
1396
+
1397
+
1398
+ <div id="fullyselected" class="member">
1399
+ <div class="member-link">
1400
+ <a name="fullyselected" href="#fullyselected"><tt><b>fullySelected</b></tt></a>
1401
+ </div>
1402
+ <div class="member-description hidden">
1403
+
1404
+ <div class="member-text">
1405
+ <p>Specifies whether the item and all its descendants are selected. Setting it selects or deselects them all.</p>
1406
+
1407
+
1408
+
1409
+ <ul class="member-list">
1410
+ <h4>Type:</h4>
1411
+ <li>
1412
+ <tt>Boolean</tt>
1413
+ </li>
1414
+ </ul>
1415
+
1416
+
1417
+
1355
1418
  </div>
1356
1419
 
1357
1420
  </div>
@@ -1591,6 +1654,7 @@ circle.position.x += 100;
1591
1654
 
1592
1655
  <div class="member-text">
1593
1656
  <p>The bounding rectangle of the item including stroke width.</p>
1657
+ <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>
1594
1658
 
1595
1659
 
1596
1660
 
@@ -3730,9 +3794,9 @@ for (var i = 0; i < 20; i++) {
3730
3794
  <p>Rasterizes the item into a newly created Raster object. The item itself is not removed after rasterization.</p>
3731
3795
  <ul class="member-list">
3732
3796
  <h4>Options:</h4>
3733
- <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>
3734
- <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>
3735
- <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>
3797
+ <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>
3798
+ <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>
3799
+ <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>
3736
3800
  </ul>
3737
3801
 
3738
3802
  <ul class="member-list">
@@ -3917,7 +3981,7 @@ function onMouseDown(event) {
3917
3981
  </div>
3918
3982
  <div class="member-description hidden">
3919
3983
  <div class="member-text">
3920
-
3984
+ <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>
3921
3985
 
3922
3986
 
3923
3987
  <ul class="member-list">
@@ -3937,7 +4001,7 @@ function onMouseDown(event) {
3937
4001
  <h4>Returns:</h4>
3938
4002
 
3939
4003
  <li>
3940
- <tt><tt>Boolean</tt></tt>
4004
+ <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the items overlap, <tt>false</tt> otherwise
3941
4005
  </li>
3942
4006
 
3943
4007
 
@@ -4433,6 +4497,7 @@ function onMouseDown(event) {
4433
4497
  <div class="member-text">
4434
4498
  <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>
4435
4499
  <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>
4500
+ <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>
4436
4501
  <ul class="member-list">
4437
4502
  <h4>Options:</h4>
4438
4503
  <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>
@@ -4986,11 +5051,11 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
4986
5051
 
4987
5052
  <div id="replacewith-item" class="member">
4988
5053
  <div class="member-link">
4989
- <a name="replacewith-item" href="#replacewith-item"><tt><b>replaceWith</b>(item)</tt></a>
5054
+ <a name="replacewith-item" href="#replacewith-item"><tt><b>replaceWith</b>(...item)</tt></a>
4990
5055
  </div>
4991
5056
  <div class="member-description hidden">
4992
5057
  <div class="member-text">
4993
- <p>Replaces this item with the provided new item which will takes its place in the project hierarchy instead.</p>
5058
+ <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>
4994
5059
 
4995
5060
 
4996
5061
  <ul class="member-list">
@@ -4999,7 +5064,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
4999
5064
  <li>
5000
5065
  <tt>item:</tt>
5001
5066
  <a href="../classes/Item.html"><tt>Item</tt></a>
5002
- &mdash;&nbsp;the item that will replace this item
5067
+ &mdash;&nbsp;the items that will replace this item
5003
5068
 
5004
5069
  </li>
5005
5070
 
@@ -6814,10 +6879,10 @@ function onMouseDown(event) {
6814
6879
  <p>Removes the item when the events specified in the passed options object occur.</p>
6815
6880
  <ul class="member-list">
6816
6881
  <h4>Options:</h4>
6817
- <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>
6818
- <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>
6819
- <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>
6820
- <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>
6882
+ <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>
6883
+ <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>
6884
+ <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>
6885
+ <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>
6821
6886
  </ul>
6822
6887
 
6823
6888
  <ul class="member-list">
@@ -7446,7 +7511,7 @@ path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
7446
7511
 
7447
7512
  <!-- =========================== copyright notice ========================== -->
7448
7513
  <p class="footer">
7449
- Paper.js v0.14.0<br>
7514
+ Paper.js v0.15.0<br>
7450
7515
  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>
7451
7516
  <div class="content-end"></div>
7452
7517
 
@@ -16,6 +16,7 @@
16
16
  <h1>Size</h1>
17
17
 
18
18
  <p>The Size object is used to describe the size or dimensions of something, through its <a href="../classes/Size.html#width"><tt>width</tt></a> and <a href="../classes/Size.html#height"><tt>height</tt></a> properties.</p>
19
+ <p>Wherever a size is the only argument of a function, it can also be passed as two numbers, e.g. <code>size.multiply(2, 3)</code>.</p>
19
20
  <h4>Example:<span class="description">Create a size that is 10pt wide and 5pt high, and use it to define a rectangle:</span></h4>
20
21
 
21
22
 
@@ -25,6 +26,7 @@ console.log(size.height); // 5
25
26
  var rect = new Rectangle(new Point(20, 15), size);
26
27
  console.log(rect); // { x: 20, y: 15, width: 10, height: 5 }</code></pre>
27
28
 
29
+
28
30
  </div>
29
31
 
30
32
  <!-- =============================== constructors ========================== -->
@@ -870,7 +872,7 @@ console.log(result); // {width: 2, height: 0}</code></pre>
870
872
 
871
873
  <li>
872
874
  <tt>size:</tt>
873
- <a href="../classes/Size.html"><tt>Size</tt></a>
875
+ <a href="../classes/Size.html"><tt>Size</tt></a>⟋Array of <tt>Numbers</tt>
874
876
  &mdash;&nbsp;the size to compare to
875
877
 
876
878
  </li>
@@ -1876,7 +1878,7 @@ var size = maxSize * randomSize;</code></pre>
1876
1878
 
1877
1879
  <!-- =========================== copyright notice ========================== -->
1878
1880
  <p class="footer">
1879
- Paper.js v0.14.0<br>
1881
+ Paper.js v0.15.0<br>
1880
1882
  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>
1881
1883
  <div class="content-end"></div>
1882
1884