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.
- package/CHANGELOG.md +337 -0
- package/README.md +19 -14
- package/dist/docs/assets/js/paper.js +7351 -1706
- package/dist/docs/classes/AreaText.html +8658 -0
- package/dist/docs/classes/ChangeFlag.html +385 -0
- package/dist/docs/classes/Color.html +2 -1
- package/dist/docs/classes/CompoundPath.html +208 -69
- package/dist/docs/classes/Curve.html +2 -1
- package/dist/docs/classes/CurveLocation.html +2 -1
- package/dist/docs/classes/Event.html +5 -4
- package/dist/docs/classes/Gradient.html +2 -1
- package/dist/docs/classes/GradientStop.html +2 -1
- package/dist/docs/classes/Group.html +204 -17
- package/dist/docs/classes/HitResult.html +4 -2
- package/dist/docs/classes/HostItem.html +6786 -0
- package/dist/docs/classes/Item.html +193 -17
- package/dist/docs/classes/Key.html +2 -1
- package/dist/docs/classes/KeyEvent.html +5 -4
- package/dist/docs/classes/Layer.html +201 -17
- package/dist/docs/classes/Matrix.html +2 -1
- package/dist/docs/classes/MouseEvent.html +5 -4
- package/dist/docs/classes/PaperScope.html +5 -2
- package/dist/docs/classes/PaperScript.html +6 -2
- package/dist/docs/classes/Path.html +183 -70
- package/dist/docs/classes/PathItem.html +326 -187
- package/dist/docs/classes/PathText.html +8528 -0
- package/dist/docs/classes/Point.html +13 -2
- package/dist/docs/classes/PointText.html +1404 -63
- package/dist/docs/classes/Project.html +221 -1
- package/dist/docs/classes/Raster.html +136 -17
- package/dist/docs/classes/Rectangle.html +3 -2
- package/dist/docs/classes/Segment.html +2 -1
- package/dist/docs/classes/Shape.html +136 -17
- package/dist/docs/classes/Size.html +4 -2
- package/dist/docs/classes/Style.html +768 -15
- package/dist/docs/classes/SymbolDefinition.html +2 -1
- package/dist/docs/classes/SymbolItem.html +136 -17
- package/dist/docs/classes/TextItem.html +1566 -222
- package/dist/docs/classes/TextRange.html +186 -0
- package/dist/docs/classes/TextStory.html +355 -0
- package/dist/docs/classes/Tool.html +127 -1
- package/dist/docs/classes/ToolEvent.html +57 -4
- package/dist/docs/classes/Tween.html +17 -1
- package/dist/docs/classes/View.html +148 -5
- package/dist/docs/classes/global.html +2 -1
- package/dist/docs/classes/index.html +2 -2
- package/dist/docs/index.html +1 -1
- package/dist/paper-core.js +7160 -1663
- package/dist/paper-core.min.js +3 -3
- package/dist/paper-full.js +7351 -1706
- package/dist/paper-full.min.js +3 -3
- package/dist/paper-hosted.js +24058 -0
- package/dist/paper.d.ts +1996 -155
- package/examples/Scripts/AreaText.html +65 -0
- package/examples/Scripts/PathText.html +48 -0
- package/examples/Scripts/TextRanges.html +51 -0
- package/package.json +8 -11
|
@@ -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,6 +80,94 @@
|
|
|
79
80
|
<h2>Properties</h2>
|
|
80
81
|
|
|
81
82
|
|
|
83
|
+
<div id="host" class="member">
|
|
84
|
+
<div class="member-link">
|
|
85
|
+
<a name="host" href="#host"><tt><b>host</b></tt></a>
|
|
86
|
+
</div>
|
|
87
|
+
<div class="member-description hidden">
|
|
88
|
+
|
|
89
|
+
<div class="member-text">
|
|
90
|
+
<p>The host document that the project’s items come from. Setting it creates the project’s layers from the host’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’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’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’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’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’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’s coordinates. <code>key</code> is null for text that the host doesn’t know yet. Without it, Paper.js lays out text itself.</p>
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
<ul class="member-list">
|
|
98
|
+
<h4>Type:</h4>
|
|
99
|
+
<li>
|
|
100
|
+
<tt>Object</tt>
|
|
101
|
+
</li>
|
|
102
|
+
</ul>
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
<div id="trackchanges" class="member">
|
|
113
|
+
<div class="member-link">
|
|
114
|
+
<a name="trackchanges" href="#trackchanges"><tt><b>trackChanges</b></tt></a>
|
|
115
|
+
</div>
|
|
116
|
+
<div class="member-description hidden">
|
|
117
|
+
|
|
118
|
+
<div class="member-text">
|
|
119
|
+
<p>Specifies whether the project logs the changes of its items, to be retrieved through <a href="../classes/Project.html#takechanges"><tt>takeChanges</tt></a>(). This allows hosts that keep their own document to update only what has changed.</p>
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
<ul class="member-list">
|
|
124
|
+
<h4>Default:</h4>
|
|
125
|
+
<li><tt>false</tt></li>
|
|
126
|
+
</ul>
|
|
127
|
+
|
|
128
|
+
<ul class="member-list">
|
|
129
|
+
<h4>Type:</h4>
|
|
130
|
+
<li>
|
|
131
|
+
<tt>Boolean</tt>
|
|
132
|
+
</li>
|
|
133
|
+
</ul>
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
<div id="scope" class="member">
|
|
144
|
+
<div class="member-link">
|
|
145
|
+
<a name="scope" href="#scope"><tt><b>scope</b></tt></a>
|
|
146
|
+
</div>
|
|
147
|
+
<div class="member-description hidden">
|
|
148
|
+
|
|
149
|
+
<div class="member-text">
|
|
150
|
+
<p>The scope that this project belongs to.</p>
|
|
151
|
+
|
|
152
|
+
<p>Read only.</p>
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
<ul class="member-list">
|
|
157
|
+
<h4>Type:</h4>
|
|
158
|
+
<li>
|
|
159
|
+
<a href="../classes/PaperScope.html"><tt>PaperScope</tt></a>
|
|
160
|
+
</li>
|
|
161
|
+
</ul>
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
</div>
|
|
166
|
+
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
169
|
+
|
|
170
|
+
|
|
82
171
|
<div id="view" class="member">
|
|
83
172
|
<div class="member-link">
|
|
84
173
|
<a name="view" href="#view"><tt><b>view</b></tt></a>
|
|
@@ -327,6 +416,136 @@ var path2 = new Path.Circle(new Point(175, 50), 20);
|
|
|
327
416
|
<h2>Methods</h2>
|
|
328
417
|
|
|
329
418
|
|
|
419
|
+
<div id="getitembykey-key" class="member">
|
|
420
|
+
<div class="member-link">
|
|
421
|
+
<a name="getitembykey-key" href="#getitembykey-key"><tt><b>getItemByKey</b>(key)</tt></a>
|
|
422
|
+
</div>
|
|
423
|
+
<div class="member-description hidden">
|
|
424
|
+
<div class="member-text">
|
|
425
|
+
<p>Returns the item of the host’s node with the given key, loading only the children of its ancestors.</p>
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
<ul class="member-list">
|
|
429
|
+
<h4>Parameters:</h4>
|
|
430
|
+
|
|
431
|
+
<li>
|
|
432
|
+
<tt>key:</tt>
|
|
433
|
+
<tt>Number</tt>
|
|
434
|
+
— the key of the host’s node
|
|
435
|
+
|
|
436
|
+
</li>
|
|
437
|
+
|
|
438
|
+
</ul>
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
<ul class="member-list">
|
|
442
|
+
<h4>Returns:</h4>
|
|
443
|
+
|
|
444
|
+
<li>
|
|
445
|
+
<tt><a href="../classes/Item.html"><tt>Item</tt></a></tt> — the item, or <code>null</code> if the host has no such node
|
|
446
|
+
</li>
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
</ul>
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
</div>
|
|
456
|
+
</div>
|
|
457
|
+
</div>
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
<div id="invalidate-columns" class="member">
|
|
461
|
+
<div class="member-link">
|
|
462
|
+
<a name="invalidate-columns" href="#invalidate-columns"><tt><b>invalidate</b>(columns)</tt></a>
|
|
463
|
+
</div>
|
|
464
|
+
<div class="member-description hidden">
|
|
465
|
+
<div class="member-text">
|
|
466
|
+
<p>Updates the items of changed host nodes, given in the column format of the host’s <code>getChildren()</code>, with two more flags: 16 when the node’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>
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
<ul class="member-list">
|
|
470
|
+
<h4>Parameters:</h4>
|
|
471
|
+
|
|
472
|
+
<li>
|
|
473
|
+
<tt>columns:</tt>
|
|
474
|
+
<tt>Object</tt>
|
|
475
|
+
— the records of the changed nodes
|
|
476
|
+
|
|
477
|
+
</li>
|
|
478
|
+
|
|
479
|
+
</ul>
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
</div>
|
|
487
|
+
</div>
|
|
488
|
+
</div>
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
<div id="takechanges" class="member">
|
|
492
|
+
<div class="member-link">
|
|
493
|
+
<a name="takechanges" href="#takechanges"><tt><b>takeChanges</b>()</tt></a>
|
|
494
|
+
</div>
|
|
495
|
+
<div class="member-description hidden">
|
|
496
|
+
<div class="member-text">
|
|
497
|
+
<p>Returns the changes logged since tracking was activated or since the last call, and clears the log. Each item is listed once, with the <a href="../classes/ChangeFlag.html"><tt>ChangeFlag</tt></a> values of all its changes combined. Removed items are listed with the <code>ChangeFlag.INSERTION</code> flag.</p>
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
<ul class="member-list">
|
|
502
|
+
<h4>Returns:</h4>
|
|
503
|
+
|
|
504
|
+
<li>
|
|
505
|
+
<tt>Array of <tt>Object</tt> objects</tt> — the changes as <code>{ item, flags }</code> objects, or <code>null</code> if <a href="../classes/Project.html#trackchanges"><tt>trackChanges</tt></a> is off
|
|
506
|
+
</li>
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
</ul>
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
|
|
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> — <tt>true</tt> if changes were logged, <tt>false</tt> otherwise
|
|
535
|
+
</li>
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
</ul>
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
</div>
|
|
545
|
+
</div>
|
|
546
|
+
</div>
|
|
547
|
+
|
|
548
|
+
|
|
330
549
|
<div id="activate" class="member">
|
|
331
550
|
<div class="member-link">
|
|
332
551
|
<a name="activate" href="#activate"><tt><b>activate</b>()</tt></a>
|
|
@@ -1196,6 +1415,7 @@ for (var i = 0; i < items.length; i++) {
|
|
|
1196
1415
|
<div class="member-text">
|
|
1197
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>
|
|
1198
1417
|
<p><code><symbol></code> elements are imported as <a href="../classes/SymbolDefinition.html"><tt>SymbolDefinition</tt></a> items, and the <code><use></code> elements that place them as <a href="../classes/SymbolItem.html"><tt>SymbolItem</tt></a> items. The styles that <code><use></code> elements inherit don’t reach the symbols’ 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>
|
|
1199
1419
|
<ul class="member-list">
|
|
1200
1420
|
<h4>Options:</h4>
|
|
1201
1421
|
<li><tt>options.expandShapes: <tt>Boolean</tt></tt> — whether imported shape items should be expanded to path items — default: <tt>false</tt></li>
|
|
@@ -1303,7 +1523,7 @@ for (var i = 0; i < items.length; i++) {
|
|
|
1303
1523
|
|
|
1304
1524
|
<!-- =========================== copyright notice ========================== -->
|
|
1305
1525
|
<p class="footer">
|
|
1306
|
-
Paper.js v0.
|
|
1526
|
+
Paper.js v0.15.0<br>
|
|
1307
1527
|
Copyright © 2011—2026 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
|
1308
1528
|
<div class="content-end"></div>
|
|
1309
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 ========================== -->
|
|
@@ -1269,6 +1270,32 @@ raster.on('load', function() {
|
|
|
1269
1270
|
<div class="reference-members"><h2>Properties inherited from <a href="../classes/Item.html"><tt>Item</tt></a></h2>
|
|
1270
1271
|
|
|
1271
1272
|
|
|
1273
|
+
<div id="key" class="member">
|
|
1274
|
+
<div class="member-link">
|
|
1275
|
+
<a name="key" href="#key"><tt><b>key</b></tt></a>
|
|
1276
|
+
</div>
|
|
1277
|
+
<div class="member-description hidden">
|
|
1278
|
+
|
|
1279
|
+
<div class="member-text">
|
|
1280
|
+
<p>The key of the host’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>
|
|
1281
|
+
|
|
1282
|
+
|
|
1283
|
+
|
|
1284
|
+
<ul class="member-list">
|
|
1285
|
+
<h4>Type:</h4>
|
|
1286
|
+
<li>
|
|
1287
|
+
<tt>Number</tt>
|
|
1288
|
+
</li>
|
|
1289
|
+
</ul>
|
|
1290
|
+
|
|
1291
|
+
|
|
1292
|
+
|
|
1293
|
+
</div>
|
|
1294
|
+
|
|
1295
|
+
</div>
|
|
1296
|
+
</div>
|
|
1297
|
+
|
|
1298
|
+
|
|
1272
1299
|
<div id="id" class="member">
|
|
1273
1300
|
<div class="member-link">
|
|
1274
1301
|
<a name="id" href="#id"><tt><b>id</b></tt></a>
|
|
@@ -1615,7 +1642,7 @@ path.visible = false;
|
|
|
1615
1642
|
<div class="member-description hidden">
|
|
1616
1643
|
|
|
1617
1644
|
<div class="member-text">
|
|
1618
|
-
<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.
|
|
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’t support a CSS blend mode natively, it draws as <code>'normal'</code>. Paper.js’s own modes <code>'add'</code>, <code>'subtract'</code>, <code>'average'</code>, <code>'pin-light'</code> and <code>'negation'</code> are emulated, which can have an impact on performance.</p>
|
|
1619
1646
|
|
|
1620
1647
|
|
|
1621
1648
|
<ul class="member-list">
|
|
@@ -1768,6 +1795,42 @@ circle2.opacity = 0.5;
|
|
|
1768
1795
|
</div>
|
|
1769
1796
|
|
|
1770
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
|
+
|
|
1771
1834
|
<div id="selected" class="member">
|
|
1772
1835
|
<div class="member-link">
|
|
1773
1836
|
<a name="selected" href="#selected"><tt><b>selected</b></tt></a>
|
|
@@ -1825,6 +1888,32 @@ path.selected = true; // Select the path
|
|
|
1825
1888
|
</div>
|
|
1826
1889
|
|
|
1827
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
|
+
|
|
1828
1917
|
</div>
|
|
1829
1918
|
|
|
1830
1919
|
</div>
|
|
@@ -2064,6 +2153,7 @@ circle.position.x += 100;
|
|
|
2064
2153
|
|
|
2065
2154
|
<div class="member-text">
|
|
2066
2155
|
<p>The bounding rectangle of the item including stroke width.</p>
|
|
2156
|
+
<p>Setting it fits the item’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’s proportions, as with miters. A rectangle smaller than the stroke itself shrinks the bounds to its center.</p>
|
|
2067
2157
|
|
|
2068
2158
|
|
|
2069
2159
|
|
|
@@ -2352,6 +2442,34 @@ circle.position.x += 100;
|
|
|
2352
2442
|
|
|
2353
2443
|
|
|
2354
2444
|
|
|
2445
|
+
</div>
|
|
2446
|
+
|
|
2447
|
+
</div>
|
|
2448
|
+
</div>
|
|
2449
|
+
|
|
2450
|
+
|
|
2451
|
+
<div id="scope" class="member">
|
|
2452
|
+
<div class="member-link">
|
|
2453
|
+
<a name="scope" href="#scope"><tt><b>scope</b></tt></a>
|
|
2454
|
+
</div>
|
|
2455
|
+
<div class="member-description hidden">
|
|
2456
|
+
|
|
2457
|
+
<div class="member-text">
|
|
2458
|
+
<p>The scope that this item belongs to, through its project.</p>
|
|
2459
|
+
|
|
2460
|
+
<p>Read only.</p>
|
|
2461
|
+
|
|
2462
|
+
|
|
2463
|
+
|
|
2464
|
+
<ul class="member-list">
|
|
2465
|
+
<h4>Type:</h4>
|
|
2466
|
+
<li>
|
|
2467
|
+
<a href="../classes/PaperScope.html"><tt>PaperScope</tt></a>
|
|
2468
|
+
</li>
|
|
2469
|
+
</ul>
|
|
2470
|
+
|
|
2471
|
+
|
|
2472
|
+
|
|
2355
2473
|
</div>
|
|
2356
2474
|
|
|
2357
2475
|
</div>
|
|
@@ -2967,7 +3085,7 @@ path3.strokeJoin = 'bevel';
|
|
|
2967
3085
|
<div class="member-description hidden">
|
|
2968
3086
|
|
|
2969
3087
|
<div class="member-text">
|
|
2970
|
-
<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>
|
|
3088
|
+
<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>
|
|
2971
3089
|
|
|
2972
3090
|
|
|
2973
3091
|
|
|
@@ -4175,9 +4293,9 @@ for (var i = 0; i < 20; i++) {
|
|
|
4175
4293
|
<p>Rasterizes the item into a newly created Raster object. The item itself is not removed after rasterization.</p>
|
|
4176
4294
|
<ul class="member-list">
|
|
4177
4295
|
<h4>Options:</h4>
|
|
4178
|
-
<li><tt>resolution: <tt>Number</tt></tt> — the desired
|
|
4179
|
-
<li><tt>raster: <a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — specifies a raster to be reused
|
|
4180
|
-
<li><tt>insert: <tt>Boolean</tt></tt> — specifies whether the raster
|
|
4296
|
+
<li><tt>options.resolution: <tt>Number</tt></tt> — 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. — default: <tt>view.resolution</tt></li>
|
|
4297
|
+
<li><tt>options.raster: <a href="../classes/Raster.html"><tt>Raster</tt></a></tt> — 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. — default: <tt>null</tt></li>
|
|
4298
|
+
<li><tt>options.insert: <tt>Boolean</tt></tt> — specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the rasterized item. — default: <tt>true</tt></li>
|
|
4181
4299
|
</ul>
|
|
4182
4300
|
|
|
4183
4301
|
<ul class="member-list">
|
|
@@ -4362,7 +4480,7 @@ function onMouseDown(event) {
|
|
|
4362
4480
|
</div>
|
|
4363
4481
|
<div class="member-description hidden">
|
|
4364
4482
|
<div class="member-text">
|
|
4365
|
-
|
|
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>
|
|
4366
4484
|
|
|
4367
4485
|
|
|
4368
4486
|
<ul class="member-list">
|
|
@@ -4382,7 +4500,7 @@ function onMouseDown(event) {
|
|
|
4382
4500
|
<h4>Returns:</h4>
|
|
4383
4501
|
|
|
4384
4502
|
<li>
|
|
4385
|
-
<tt><tt>Boolean</tt></tt>
|
|
4503
|
+
<tt><tt>Boolean</tt></tt> — <tt>true</tt> if the items overlap, <tt>false</tt> otherwise
|
|
4386
4504
|
</li>
|
|
4387
4505
|
|
|
4388
4506
|
|
|
@@ -4878,6 +4996,7 @@ function onMouseDown(event) {
|
|
|
4878
4996
|
<div class="member-text">
|
|
4879
4997
|
<p>Converts the provided SVG content into Paper.js items and adds them to the this item’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>
|
|
4880
4998
|
<p><code><symbol></code> elements are imported as <a href="../classes/SymbolDefinition.html"><tt>SymbolDefinition</tt></a> items, and the <code><use></code> elements that place them as <a href="../classes/SymbolItem.html"><tt>SymbolItem</tt></a> items. The styles that <code><use></code> elements inherit don’t reach the symbols’ 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>
|
|
4881
5000
|
<ul class="member-list">
|
|
4882
5001
|
<h4>Options:</h4>
|
|
4883
5002
|
<li><tt>options.expandShapes: <tt>Boolean</tt></tt> — whether imported shape items should be expanded to path items — default: <tt>false</tt></li>
|
|
@@ -5431,11 +5550,11 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
|
|
|
5431
5550
|
|
|
5432
5551
|
<div id="replacewith-item" class="member">
|
|
5433
5552
|
<div class="member-link">
|
|
5434
|
-
<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>
|
|
5435
5554
|
</div>
|
|
5436
5555
|
<div class="member-description hidden">
|
|
5437
5556
|
<div class="member-text">
|
|
5438
|
-
<p>Replaces this item with the provided new
|
|
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>
|
|
5439
5558
|
|
|
5440
5559
|
|
|
5441
5560
|
<ul class="member-list">
|
|
@@ -5444,7 +5563,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
|
|
|
5444
5563
|
<li>
|
|
5445
5564
|
<tt>item:</tt>
|
|
5446
5565
|
<a href="../classes/Item.html"><tt>Item</tt></a>
|
|
5447
|
-
— the
|
|
5566
|
+
— the items that will replace this item
|
|
5448
5567
|
|
|
5449
5568
|
</li>
|
|
5450
5569
|
|
|
@@ -5617,7 +5736,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
|
|
|
5617
5736
|
</div>
|
|
5618
5737
|
<div class="member-description hidden">
|
|
5619
5738
|
<div class="member-text">
|
|
5620
|
-
<p>Checks whether the item has a fill
|
|
5739
|
+
<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>
|
|
5621
5740
|
|
|
5622
5741
|
|
|
5623
5742
|
|
|
@@ -5625,7 +5744,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
|
|
|
5625
5744
|
<h4>Returns:</h4>
|
|
5626
5745
|
|
|
5627
5746
|
<li>
|
|
5628
|
-
<tt><tt>Boolean</tt></tt> — <tt>true</tt> if the item has a fill, <tt>false</tt> otherwise
|
|
5747
|
+
<tt><tt>Boolean</tt></tt> — <tt>true</tt> if the item has a visible fill, <tt>false</tt> otherwise
|
|
5629
5748
|
</li>
|
|
5630
5749
|
|
|
5631
5750
|
|
|
@@ -7259,10 +7378,10 @@ function onMouseDown(event) {
|
|
|
7259
7378
|
<p>Removes the item when the events specified in the passed options object occur.</p>
|
|
7260
7379
|
<ul class="member-list">
|
|
7261
7380
|
<h4>Options:</h4>
|
|
7262
|
-
<li><tt>options.move:
|
|
7263
|
-
<li><tt>options.drag:
|
|
7264
|
-
<li><tt>options.down:
|
|
7265
|
-
<li><tt>options.up:
|
|
7381
|
+
<li><tt>options.move: <tt>Boolean</tt></tt> — 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> — 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> — 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> — remove the item when the next <a href="../classes/Tool.html#onmouseup"><tt>tool.onMouseUp</tt></a> event is fired.</li>
|
|
7266
7385
|
</ul>
|
|
7267
7386
|
|
|
7268
7387
|
<ul class="member-list">
|
|
@@ -7891,7 +8010,7 @@ path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
|
|
|
7891
8010
|
|
|
7892
8011
|
<!-- =========================== copyright notice ========================== -->
|
|
7893
8012
|
<p class="footer">
|
|
7894
|
-
Paper.js v0.
|
|
8013
|
+
Paper.js v0.15.0<br>
|
|
7895
8014
|
Copyright © 2011—2026 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
|
7896
8015
|
<div class="content-end"></div>
|
|
7897
8016
|
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
<p>A Rectangle specifies an area that is enclosed by it’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’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
|
|
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’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.
|
|
1650
|
+
Paper.js v0.15.0<br>
|
|
1650
1651
|
Copyright © 2011—2026 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
|
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.
|
|
934
|
+
Paper.js v0.15.0<br>
|
|
934
935
|
Copyright © 2011—2026 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
|
935
936
|
<div class="content-end"></div>
|
|
936
937
|
|