paper 0.12.20 → 0.14.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 (54) hide show
  1. package/CHANGELOG.md +318 -0
  2. package/README.md +45 -26
  3. package/dist/docs/assets/js/paper.js +1210 -481
  4. package/dist/docs/classes/ChangeFlag.html +384 -0
  5. package/dist/docs/classes/Color.html +63 -47
  6. package/dist/docs/classes/CompoundPath.html +219 -62
  7. package/dist/docs/classes/Curve.html +9 -7
  8. package/dist/docs/classes/CurveLocation.html +1 -1
  9. package/dist/docs/classes/Event.html +1 -1
  10. package/dist/docs/classes/Gradient.html +1 -1
  11. package/dist/docs/classes/GradientStop.html +1 -1
  12. package/dist/docs/classes/Group.html +151 -27
  13. package/dist/docs/classes/HitResult.html +3 -2
  14. package/dist/docs/classes/HostItem.html +6721 -0
  15. package/dist/docs/classes/Item.html +120 -27
  16. package/dist/docs/classes/Key.html +1 -1
  17. package/dist/docs/classes/KeyEvent.html +1 -1
  18. package/dist/docs/classes/Layer.html +151 -27
  19. package/dist/docs/classes/Matrix.html +1 -1
  20. package/dist/docs/classes/MouseEvent.html +1 -1
  21. package/dist/docs/classes/PaperScope.html +88 -1
  22. package/dist/docs/classes/PaperScript.html +2 -1
  23. package/dist/docs/classes/Path.html +232 -72
  24. package/dist/docs/classes/PathItem.html +337 -180
  25. package/dist/docs/classes/Point.html +143 -21
  26. package/dist/docs/classes/PointText.html +151 -27
  27. package/dist/docs/classes/Project.html +201 -8
  28. package/dist/docs/classes/Raster.html +150 -38
  29. package/dist/docs/classes/Rectangle.html +12 -11
  30. package/dist/docs/classes/Segment.html +1 -1
  31. package/dist/docs/classes/Shape.html +120 -27
  32. package/dist/docs/classes/Size.html +81 -21
  33. package/dist/docs/classes/Style.html +35 -3
  34. package/dist/docs/classes/SymbolDefinition.html +1 -1
  35. package/dist/docs/classes/SymbolItem.html +121 -28
  36. package/dist/docs/classes/TextItem.html +151 -27
  37. package/dist/docs/classes/Tool.html +127 -1
  38. package/dist/docs/classes/ToolEvent.html +27 -1
  39. package/dist/docs/classes/Tween.html +1 -1
  40. package/dist/docs/classes/View.html +345 -10
  41. package/dist/docs/classes/global.html +1 -1
  42. package/dist/docs/classes/index.html +2 -2
  43. package/dist/docs/index.html +1 -1
  44. package/dist/node/canvas.js +1 -1
  45. package/dist/node/self.js +4 -3
  46. package/dist/paper-core.js +1182 -465
  47. package/dist/paper-core.min.js +3 -3
  48. package/dist/paper-full.js +1210 -481
  49. package/dist/paper-full.min.js +3 -3
  50. package/dist/paper-sourced.js +18631 -0
  51. package/dist/paper.d.ts +606 -78
  52. package/examples/Rasters/Smoothing.html +1 -1
  53. package/package.json +6 -17
  54. package/dist/node/xml.js +0 -40
@@ -167,7 +167,7 @@ var path = new Path({
167
167
  </div>
168
168
  <div class="member-description hidden">
169
169
  <div class="member-text">
170
- <p>Creates a new path item from SVG path-data and places it at the top of the active layer.</p>
170
+ <p>Creates a new path item from SVG path-data and places it at the top of the active layer. A path holds a single sub-path: further <code>M</code> commands are ignored, and the commands that follow them continue the same path. Use <a href="../classes/CompoundPath.html"><tt>CompoundPath</tt></a> or <a href="../classes/PathItem.html#create-pathdata"><tt>PathItem.create(pathData)</tt></a> to create items with multiple sub-paths.</p>
171
171
 
172
172
 
173
173
  <ul class="member-list">
@@ -1069,7 +1069,7 @@ var path = new Path.Arc({
1069
1069
  </div>
1070
1070
  <div class="member-description hidden">
1071
1071
  <div class="member-text">
1072
- <p>Creates a regular polygon shaped path item.</p>
1072
+ <p>Creates a regular polygon shaped path item. As in Illustrator, it stands on a flat bottom edge, and its segments run counterclockwise from its top vertex, or with an even number of sides, from the right end of its top edge.</p>
1073
1073
 
1074
1074
 
1075
1075
  <ul class="member-list">
@@ -2186,7 +2186,7 @@ path.selected = true;
2186
2186
  </div>
2187
2187
  <div class="member-description hidden">
2188
2188
  <div class="member-text">
2189
- <p>Removes the segments from the specified <code>from</code> index to the <code>to</code> index from the path&rsquo;s <a href="../classes/Path.html#segments"><tt>segments</tt></a> array.</p>
2189
+ <p>Removes the segments from the specified <code>from</code> index to the <code>to</code> index from the path&rsquo;s <a href="../classes/Path.html#segments"><tt>segments</tt></a> array. On closed paths, <code>from</code> can be bigger than <code>to</code>, to remove the segments from <code>from</code> to the end and then from the beginning up to <code>to</code>, wrapping around the closing curve.</p>
2190
2190
 
2191
2191
 
2192
2192
  <ul class="member-list">
@@ -2213,7 +2213,7 @@ path.selected = true;
2213
2213
  <h4>Returns:</h4>
2214
2214
 
2215
2215
  <li>
2216
- <tt>Array of <a href="../classes/Segment.html"><tt>Segment</tt></a> objects</tt>&nbsp;&mdash;&nbsp;an array containing the removed segments
2216
+ <tt>Array of <a href="../classes/Segment.html"><tt>Segment</tt></a> objects</tt>&nbsp;&mdash;&nbsp;an array containing the removed segments, in the order in which they appeared along the path
2217
2217
  </li>
2218
2218
 
2219
2219
 
@@ -2385,7 +2385,7 @@ path.selected = true;
2385
2385
  <h4>Returns:</h4>
2386
2386
 
2387
2387
  <li>
2388
- <tt><a href="../classes/Path.html"><tt>Path</tt></a></tt>&nbsp;&mdash;&nbsp;the newly created path after splitting, if any
2388
+ <tt><a href="../classes/Path.html"><tt>Path</tt></a>⟋<tt>null</tt></tt>&nbsp;&mdash;&nbsp;the newly created path after splitting, if any
2389
2389
  </li>
2390
2390
 
2391
2391
 
@@ -2610,23 +2610,26 @@ path.selected = true;
2610
2610
  </div>
2611
2611
 
2612
2612
 
2613
- <div id="reduce-options" class="member">
2613
+ <div id="reduce" class="member">
2614
2614
  <div class="member-link">
2615
- <a name="reduce-options" href="#reduce-options"><tt><b>reduce</b>(options)</tt></a>
2615
+ <a name="reduce" href="#reduce"><tt><b>reduce</b>([options])</tt></a>
2616
2616
  </div>
2617
2617
  <div class="member-description hidden">
2618
2618
  <div class="member-text">
2619
- <p>Reduces the path by removing curves that have a length of 0, and unnecessary segments between two collinear flat curves.</p>
2620
-
2619
+ <p>Reduces the path by removing straight curves that have a length of 0. With <code>options.simplify</code>, it also removes straight curves that are almost 0 in length, and unnecessary segments between two collinear straight curves.</p>
2620
+ <ul class="member-list">
2621
+ <h4>Options:</h4>
2622
+ <li><tt>options.simplify: <tt>Boolean</tt></tt> &mdash; also remove almost zero-length curves and segments between collinear straight curves &mdash;&nbsp;default: <tt>false</tt></li>
2623
+ </ul>
2621
2624
 
2622
2625
  <ul class="member-list">
2623
2626
  <h4>Parameters:</h4>
2624
2627
 
2625
2628
  <li>
2626
2629
  <tt>options:</tt>
2627
-
2628
-
2629
-
2630
+ <tt>Object</tt>
2631
+ &mdash;&nbsp;the reduce options
2632
+ &mdash;&nbsp;optional
2630
2633
  </li>
2631
2634
 
2632
2635
  </ul>
@@ -2727,7 +2730,7 @@ path.selected = true;
2727
2730
  <h4>Returns:</h4>
2728
2731
 
2729
2732
  <li>
2730
- <tt><a href="../classes/CurveLocation.html"><tt>CurveLocation</tt></a></tt>&nbsp;&mdash;&nbsp;the curve location of the specified point
2733
+ <tt><a href="../classes/CurveLocation.html"><tt>CurveLocation</tt></a>⟋<tt>null</tt></tt>&nbsp;&mdash;&nbsp;the curve location of the specified point
2731
2734
  </li>
2732
2735
 
2733
2736
 
@@ -2768,7 +2771,7 @@ path.selected = true;
2768
2771
  <h4>Returns:</h4>
2769
2772
 
2770
2773
  <li>
2771
- <tt><tt>Number</tt></tt>&nbsp;&mdash;&nbsp;the length of the path up to the specified point
2774
+ <tt><tt>Number</tt>⟋<tt>null</tt></tt>&nbsp;&mdash;&nbsp;the length of the path up to the specified point
2772
2775
  </li>
2773
2776
 
2774
2777
 
@@ -2789,7 +2792,7 @@ path.selected = true;
2789
2792
  </div>
2790
2793
  <div class="member-description hidden">
2791
2794
  <div class="member-text">
2792
- <p>Returns the curve location of the specified offset on the path.</p>
2795
+ <p>Returns the curve location of the specified offset on the path, or <code>null</code> if the offset exceeds the length of the path.</p>
2793
2796
 
2794
2797
 
2795
2798
  <ul class="member-list">
@@ -3342,6 +3345,32 @@ for (var i = 0; i < amount + 1; i++) {
3342
3345
  <div class="reference-members"><h2>Properties inherited from <a href="../classes/Item.html"><tt>Item</tt></a></h2>
3343
3346
 
3344
3347
 
3348
+ <div id="key" class="member">
3349
+ <div class="member-link">
3350
+ <a name="key" href="#key"><tt><b>key</b></tt></a>
3351
+ </div>
3352
+ <div class="member-description hidden">
3353
+
3354
+ <div class="member-text">
3355
+ <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>
3356
+
3357
+
3358
+
3359
+ <ul class="member-list">
3360
+ <h4>Type:</h4>
3361
+ <li>
3362
+ <tt>Number</tt>
3363
+ </li>
3364
+ </ul>
3365
+
3366
+
3367
+
3368
+ </div>
3369
+
3370
+ </div>
3371
+ </div>
3372
+
3373
+
3345
3374
  <div id="id" class="member">
3346
3375
  <div class="member-link">
3347
3376
  <a name="id" href="#id"><tt><b>id</b></tt></a>
@@ -3461,6 +3490,7 @@ group.children['example'].fillColor = 'red';
3461
3490
 
3462
3491
  <div class="member-text">
3463
3492
  <p>The path style of the item.</p>
3493
+ <p>Styles set on a <a href="../classes/Group.html"><tt>Group</tt></a> or <a href="../classes/Layer.html"><tt>Layer</tt></a> are applied to the children that it contains at that moment. Items added to it later do not receive them.</p>
3464
3494
 
3465
3495
 
3466
3496
 
@@ -3803,6 +3833,37 @@ circle2.opacity = 0.5;
3803
3833
  </div>
3804
3834
 
3805
3835
 
3836
+ </div>
3837
+
3838
+ </div>
3839
+ </div>
3840
+
3841
+
3842
+ <div id="guide" class="member">
3843
+ <div class="member-link">
3844
+ <a name="guide" href="#guide"><tt><b>guide</b></tt></a>
3845
+ </div>
3846
+ <div class="member-description hidden">
3847
+
3848
+ <div class="member-text">
3849
+ <p>Specifies whether the item functions as a guide. When set to <code>true</code>, the item is drawn as usual, but left out of hit-tests and mouse interactions. Hit-tests only find guides when <code>options.guides</code> is set, and then only them, see <a href="../classes/Item.html#hittest-point"><tt>hitTest(point[, options])</tt></a>.</p>
3850
+
3851
+
3852
+
3853
+ <ul class="member-list">
3854
+ <h4>Default:</h4>
3855
+ <li><tt>false</tt></li>
3856
+ </ul>
3857
+
3858
+ <ul class="member-list">
3859
+ <h4>Type:</h4>
3860
+ <li>
3861
+ <tt>Boolean</tt>
3862
+ </li>
3863
+ </ul>
3864
+
3865
+
3866
+
3806
3867
  </div>
3807
3868
 
3808
3869
  </div>
@@ -4393,6 +4454,34 @@ circle.position.x += 100;
4393
4454
 
4394
4455
 
4395
4456
 
4457
+ </div>
4458
+
4459
+ </div>
4460
+ </div>
4461
+
4462
+
4463
+ <div id="scope" class="member">
4464
+ <div class="member-link">
4465
+ <a name="scope" href="#scope"><tt><b>scope</b></tt></a>
4466
+ </div>
4467
+ <div class="member-description hidden">
4468
+
4469
+ <div class="member-text">
4470
+ <p>The scope that this item belongs to, through its project.</p>
4471
+
4472
+ <p>Read only.</p>
4473
+
4474
+
4475
+
4476
+ <ul class="member-list">
4477
+ <h4>Type:</h4>
4478
+ <li>
4479
+ <a href="../classes/PaperScope.html"><tt>PaperScope</tt></a>
4480
+ </li>
4481
+ </ul>
4482
+
4483
+
4484
+
4396
4485
  </div>
4397
4486
 
4398
4487
  </div>
@@ -4506,6 +4595,7 @@ console.log(group.children[0] == path); // true</code></pre>
4506
4595
 
4507
4596
  <div class="member-text">
4508
4597
  <p>The children items contained within this item. Items that define a <a href="../classes/Item.html#name"><tt>name</tt></a> can also be accessed by name.</p>
4598
+ <p>Only <a href="../classes/Group.html"><tt>Group</tt></a>, <a href="../classes/Layer.html"><tt>Layer</tt></a> and <a href="../classes/CompoundPath.html"><tt>CompoundPath</tt></a> items can have children. On all other items, such as <a href="../classes/Path.html"><tt>Path</tt></a>, <a href="../classes/Shape.html"><tt>Shape</tt></a>, <a href="../classes/Raster.html"><tt>Raster</tt></a>, <a href="../classes/SymbolItem.html"><tt>SymbolItem</tt></a> and <a href="../classes/PointText.html"><tt>PointText</tt></a>, <code>children</code> is <code>undefined</code>.</p>
4509
4599
  <p><b>Please note:</b> The children array should not be modified directly using array functions. To remove single items from the children list, use <a href="../classes/Item.html#remove"><tt>item.remove</tt></a>(), to remove all items from the children list, use <a href="../classes/Item.html#removechildren"><tt>item.removeChildren</tt></a>(). To add items to the children list, use <a href="../classes/Item.html#addchild-item"><tt>item.addChild(item)</tt></a> or <a href="../classes/Item.html#insertchild-index-item"><tt>item.insertChild(index, item)</tt></a>.</p>
4510
4600
 
4511
4601
 
@@ -5007,7 +5097,7 @@ path3.strokeJoin = 'bevel';
5007
5097
  <div class="member-description hidden">
5008
5098
 
5009
5099
  <div class="member-text">
5010
- <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>
5100
+ <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>
5011
5101
 
5012
5102
 
5013
5103
 
@@ -6446,22 +6536,22 @@ function onMouseDown(event) {
6446
6536
  <div class="member-description hidden">
6447
6537
  <div class="member-text">
6448
6538
  <p>Performs a hit-test on the item and its children (if it is a <a href="../classes/Group.html"><tt>Group</tt></a> or <a href="../classes/Layer.html"><tt>Layer</tt></a>) at the location of the specified point, returning the first found hit.</p>
6449
- <p>The options object allows you to control the specifics of the hit- test and may contain a combination of the following values:</p>
6539
+ <p>The options object allows you to control the specifics of the hit-test. Without options, <code>fill</code>, <code>stroke</code> and <code>segments</code> are hit-tested. As soon as an options object is passed, only the hit-tests that it sets to <code>true</code> are performed. It may contain a combination of the following values:</p>
6450
6540
  <ul class="member-list">
6451
6541
  <h4>Options:</h4>
6452
- <li><tt>options.tolerance: <tt>Number</tt></tt> &mdash; the tolerance of the hit-test &mdash;&nbsp;default: <tt><a href="../classes/PaperScope.html#settings"><tt>paperScope.settings</tt></a>.hitTolerance</tt></li>
6542
+ <li><tt>options.tolerance: <tt>Number</tt></tt> &mdash; the tolerance of the hit-test, in project coordinates &mdash;&nbsp;default: <tt><a href="../classes/PaperScope.html#settings"><tt>paperScope.settings</tt></a>.hitTolerance</tt></li>
6453
6543
  <li><tt>options.class: <tt>Function</tt></tt> &mdash; only hit-test against a specific item class, or any of its sub-classes, by providing the constructor function against which an <code>instanceof</code> check is performed: <tt>Group</tt>, <tt>Layer</tt>, <tt>Path</tt>, <tt>CompoundPath</tt>, <tt>Shape</tt>, <tt>Raster</tt>, <tt>SymbolItem</tt>, <tt>PointText</tt>, &hellip;</li>
6454
6544
  <li><tt>options.match: <tt>Function</tt></tt> &mdash; a match function to be called for each found hit result: Return <code>true</code> to return the result, <code>false</code> to keep searching</li>
6455
- <li><tt>options.fill: <tt>Boolean</tt></tt> &mdash; hit-test the fill of items &mdash;&nbsp;default: <tt>true</tt></li>
6456
- <li><tt>options.stroke: <tt>Boolean</tt></tt> &mdash; hit-test the stroke of path items, taking into account the setting of stroke color and width &mdash;&nbsp;default: <tt>true</tt></li>
6457
- <li><tt>options.segments: <tt>Boolean</tt></tt> &mdash; hit-test for <a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of <a href="../classes/Path.html"><tt>Path</tt></a> items &mdash;&nbsp;default: <tt>true</tt></li>
6545
+ <li><tt>options.fill: <tt>Boolean</tt></tt> &mdash; hit-test the fill of items</li>
6546
+ <li><tt>options.stroke: <tt>Boolean</tt></tt> &mdash; hit-test the stroke of path items, taking into account the setting of stroke color and width</li>
6547
+ <li><tt>options.segments: <tt>Boolean</tt></tt> &mdash; hit-test for <a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of <a href="../classes/Path.html"><tt>Path</tt></a> items</li>
6458
6548
  <li><tt>options.curves: <tt>Boolean</tt></tt> &mdash; hit-test the curves of path items, without taking the stroke color or width into account</li>
6459
6549
  <li><tt>options.handles: <tt>Boolean</tt></tt> &mdash; hit-test for the handles (<a href="../classes/Segment.html#handlein"><tt>segment.handleIn</tt></a> / <a href="../classes/Segment.html#handleout"><tt>segment.handleOut</tt></a>) of path segments.</li>
6460
6550
  <li><tt>options.ends: <tt>Boolean</tt></tt> &mdash; only hit-test for the first or last segment points of open path items</li>
6461
6551
  <li><tt>options.position: <tt>Boolean</tt></tt> &mdash; hit-test the <a href="../classes/Item.html#position"><tt>item.position</tt></a> of of items, which depends on the setting of <a href="../classes/Item.html#pivot"><tt>item.pivot</tt></a></li>
6462
6552
  <li><tt>options.center: <tt>Boolean</tt></tt> &mdash; hit-test the <a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a> of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>)</li>
6463
6553
  <li><tt>options.bounds: <tt>Boolean</tt></tt> &mdash; hit-test the corners and side-centers of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>)</li>
6464
- <li><tt>options.guides: <tt>Boolean</tt></tt> &mdash; hit-test items that have <tt>Item#guide</tt> set to <code>true</code></li>
6554
+ <li><tt>options.guides: <tt>Boolean</tt></tt> &mdash; only hit-test items that have <a href="../classes/Item.html#guide"><tt>item.guide</tt></a> set to <code>true</code></li>
6465
6555
  <li><tt>options.selected: <tt>Boolean</tt></tt> &mdash; only hit selected items</li>
6466
6556
  </ul>
6467
6557
 
@@ -6700,7 +6790,7 @@ function onMouseDown(event) {
6700
6790
  <h4>Returns:</h4>
6701
6791
 
6702
6792
  <li>
6703
- <tt>Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects</tt>&nbsp;&mdash;&nbsp;the list of matching descendant items
6793
+ <tt>Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects</tt>&nbsp;&mdash;&nbsp;the list of matching descendant items, in their stacking order from bottom to top, with each item listed before its own descendants
6704
6794
  </li>
6705
6795
 
6706
6796
 
@@ -6873,6 +6963,8 @@ function onMouseDown(event) {
6873
6963
  <li><tt>options.precision: <tt>Number</tt></tt> &mdash; the amount of fractional digits in numbers used in SVG data &mdash;&nbsp;default: <tt>5</tt></li>
6874
6964
  <li><tt>options.matchShapes: <tt>Boolean</tt></tt> &mdash; whether path items should tried to be converted to SVG shape items (rect, circle, ellipse, line, polyline, polygon), if their geometries match &mdash;&nbsp;default: <tt>false</tt></li>
6875
6965
  <li><tt>options.embedImages: <tt>Boolean</tt></tt> &mdash; whether raster images should be embedded as base64 data inlined in the xlink:href attribute, or kept as a link to their external URL. &mdash;&nbsp;default: <tt>true</tt></li>
6966
+ <li><tt>options.reuseImages: <tt>Boolean</tt></tt> &mdash; whether raster images with the same content should only be exported once into the <code>&lt;defs&gt;</code> element, and placed through <code>&lt;use&gt;</code> elements referencing it &mdash;&nbsp;default: <tt>false</tt></li>
6967
+ <li><tt>options.idPrefix: <tt>String</tt></tt> &mdash; a prefix for the ids generated for definitions such as gradients, clip paths and symbols, to keep them unique when several exported SVGs are placed in one document &mdash;&nbsp;default: <tt>&rsquo;&rsquo;</tt></li>
6876
6968
  <li><tt>options.reduceAttributes: <tt>Boolean</tt></tt> &mdash; wether to only include style attributes in the SVG output that differ from their parents, or to always include them (much faster but leading to redundancies). &mdash;&nbsp;default: <tt>true</tt></li>
6877
6969
  </ul>
6878
6970
 
@@ -6915,9 +7007,13 @@ function onMouseDown(event) {
6915
7007
  <div class="member-description hidden">
6916
7008
  <div class="member-text">
6917
7009
  <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>
7010
+ <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>
6918
7011
  <ul class="member-list">
6919
7012
  <h4>Options:</h4>
6920
7013
  <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>
7014
+ <li>[options.crossOrigin] {String} the {@link Raster#crossOrigin}
7015
+ value of the rasters created for `<image>` elements, to load their
7016
+ images with CORS</li>
6921
7017
  <li><tt>options.onLoad: <tt>Function</tt></tt> &mdash; the callback function to call once the SVG content is loaded from the given URL receiving two arguments: the converted <code>item</code> and the original <code>svg</code> data as a string. Only required when loading from external resources.</li>
6922
7018
  <li><tt>options.onError: <tt>Function</tt></tt> &mdash; the callback function to call if an error occurs during loading. Only required when loading from external resources.</li>
6923
7019
  <li><tt>options.insert: <tt>Boolean</tt></tt> &mdash; whether the imported items should be added to the item that <code>importSVG()</code> is called on &mdash;&nbsp;default: <tt>true</tt></li>
@@ -7610,7 +7706,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
7610
7706
  </div>
7611
7707
  <div class="member-description hidden">
7612
7708
  <div class="member-text">
7613
- <p>Checks whether the item has a fill.</p>
7709
+ <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>
7614
7710
 
7615
7711
 
7616
7712
 
@@ -7618,7 +7714,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
7618
7714
  <h4>Returns:</h4>
7619
7715
 
7620
7716
  <li>
7621
- <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the item has a fill, <tt>false</tt> otherwise
7717
+ <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the item has a visible fill, <tt>false</tt> otherwise
7622
7718
  </li>
7623
7719
 
7624
7720
 
@@ -7757,7 +7853,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
7757
7853
  </div>
7758
7854
  <div class="member-description hidden">
7759
7855
  <div class="member-text">
7760
- <p>Checks if this item is above the specified item in the stacking order of the project.</p>
7856
+ <p>Checks if this item is above the specified item in the stacking order of the project. If one item is a descendant of the other, neither is above the other and <code>false</code> is returned.</p>
7761
7857
 
7762
7858
 
7763
7859
  <ul class="member-list">
@@ -7798,7 +7894,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
7798
7894
  </div>
7799
7895
  <div class="member-description hidden">
7800
7896
  <div class="member-text">
7801
- <p>Checks if the item is below the specified item in the stacking order of the project.</p>
7897
+ <p>Checks if the item is below the specified item in the stacking order of the project. If one item is a descendant of the other, neither is below the other and <code>false</code> is returned.</p>
7802
7898
 
7803
7899
 
7804
7900
  <ul class="member-list">
@@ -8756,11 +8852,11 @@ circle.scale(3, 1);
8756
8852
 
8757
8853
  <div id="fitbounds-rectangle" class="member">
8758
8854
  <div class="member-link">
8759
- <a name="fitbounds-rectangle" href="#fitbounds-rectangle"><tt><b>fitBounds</b>(rectangle[, fill])</tt></a>
8855
+ <a name="fitbounds-rectangle" href="#fitbounds-rectangle"><tt><b>fitBounds</b>(rectangle[, fit])</tt></a>
8760
8856
  </div>
8761
8857
  <div class="member-description hidden">
8762
8858
  <div class="member-text">
8763
- <p>Transform the item so that its <a href="../classes/Item.html#bounds"><tt>bounds</tt></a> fit within the specified rectangle, without changing its aspect ratio.</p>
8859
+ <p>Transform the item so that its <a href="../classes/Item.html#bounds"><tt>bounds</tt></a> are centered in the specified rectangle and fitted to it as described by <code>fit</code>.</p>
8764
8860
 
8765
8861
 
8766
8862
  <ul class="member-list">
@@ -8774,10 +8870,10 @@ circle.scale(3, 1);
8774
8870
  </li>
8775
8871
 
8776
8872
  <li>
8777
- <tt>fill:</tt>
8778
- <tt>Boolean</tt>
8779
-
8780
- &mdash;&nbsp;optional, default: <tt>false</tt>
8873
+ <tt>fit:</tt>
8874
+ <tt>String</tt>⟋<tt>Boolean</tt>
8875
+ &mdash;&nbsp;how to fit the item, as in CSS&rsquo;s <code>object-fit</code>: <code>&#39;contain&#39;</code> fits all of it within the rectangle, <code>&#39;cover&#39;</code> makes it cover the whole rectangle, and <code>&#39;fill&#39;</code> stretches it to the rectangle, changing its aspect ratio. The deprecated <code>true</code> and <code>false</code> stand for <code>&#39;cover&#39;</code> and <code>&#39;contain&#39;</code>.
8876
+ &mdash;&nbsp;optional, default: <tt>&lsquo;contain&rsquo;</tt>
8781
8877
  </li>
8782
8878
 
8783
8879
  </ul>
@@ -8819,7 +8915,7 @@ circlePath.fitBounds(path.bounds);
8819
8915
  </div>
8820
8916
 
8821
8917
 
8822
- <h4>Example:<span class="description">Fitting an item to the bounding rectangle of another item's bounding rectangle with the fill parameter set to true:</span></h4>
8918
+ <h4>Example:<span class="description">Fitting an item to the bounding rectangle of another item's bounding rectangle, covering all of it:</span></h4>
8823
8919
 
8824
8920
  <div class="paperscript split">
8825
8921
 
@@ -8846,7 +8942,7 @@ var circlePath = new Path.Circle({
8846
8942
 
8847
8943
  // Fit the circlePath to the bounding rectangle of
8848
8944
  // the rectangular path:
8849
- circlePath.fitBounds(path.bounds, true);
8945
+ circlePath.fitBounds(path.bounds, 'cover');
8850
8946
  </script>
8851
8947
  <div class="canvas"><canvas width="516" height="100" id="canvas-93"></canvas></div>
8852
8948
  </div>
@@ -9496,7 +9592,7 @@ function onMouseDown(event) {
9496
9592
  <ul class="member-list">
9497
9593
  <h4>Options:</h4>
9498
9594
  <li><tt>options.duration: <tt>Number</tt></tt> &mdash; the duration of the tweening</li>
9499
- <li><tt>options.easing: <tt>Function</tt>⟋<tt>String</tt></tt> &mdash; an easing function or the type of the easing: <tt>&lsquo;linear&rsquo; &lsquo;easeInQuad&rsquo; &lsquo;easeOutQuad&rsquo; &lsquo;easeInOutQuad&rsquo; &lsquo;easeInCubic&rsquo; &lsquo;easeOutCubic&rsquo; &lsquo;easeInOutCubic&rsquo; &lsquo;easeInQuart&rsquo; &lsquo;easeOutQuart&rsquo; &lsquo;easeInOutQuart&rsquo; &lsquo;easeInQuint&rsquo; &lsquo;easeOutQuint&rsquo; &lsquo;easeInOutQuint&rsquo;</tt> &mdash;&nbsp;default: <tt>&lsquo;linear&rsquo;</tt></li>
9595
+ <li><tt>options.easing: <tt>Function</tt>⟋<tt>String</tt></tt> &mdash; an easing function or the type of the easing: <tt>&lsquo;linear&rsquo; &lsquo;easeInQuad&rsquo; &lsquo;easeOutQuad&rsquo; &lsquo;easeInOutQuad&rsquo; &lsquo;easeInCubic&rsquo; &lsquo;easeOutCubic&rsquo; &lsquo;easeInOutCubic&rsquo; &lsquo;easeInQuart&rsquo; &lsquo;easeOutQuart&rsquo; &lsquo;easeInOutQuart&rsquo; &lsquo;easeInQuint&rsquo; &lsquo;easeOutQuint&rsquo; &lsquo;easeInOutQuint&rsquo; &lsquo;easeInSine&rsquo; &lsquo;easeOutSine&rsquo; &lsquo;easeInOutSine&rsquo; &lsquo;easeInExpo&rsquo; &lsquo;easeOutExpo&rsquo; &lsquo;easeInOutExpo&rsquo; &lsquo;easeInCirc&rsquo; &lsquo;easeOutCirc&rsquo; &lsquo;easeInOutCirc&rsquo;</tt> &mdash;&nbsp;default: <tt>&lsquo;linear&rsquo;</tt></li>
9500
9596
  <li><tt>options.start: <tt>Boolean</tt></tt> &mdash; whether to start tweening automatically &mdash;&nbsp;default: <tt>true</tt></li>
9501
9597
  </ul>
9502
9598
 
@@ -10028,7 +10124,23 @@ path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
10028
10124
 
10029
10125
 
10030
10126
 
10031
-
10127
+ <h4>Example:</h4>
10128
+
10129
+ <div class="paperscript split">
10130
+
10131
+ <div class="buttons">
10132
+ <div class="button run">Run</div>
10133
+ </div>
10134
+
10135
+ <script type="text/paperscript" canvas="canvas-108">
10136
+ var result = new Path.RegularPolygon([50, 50], 3, 40)
10137
+ .unite(new Path.Circle([50, 50], 25));
10138
+ result.fillColor = 'red';
10139
+ </script>
10140
+ <div class="canvas"><canvas width="516" height="100" id="canvas-108"></canvas></div>
10141
+ </div>
10142
+
10143
+
10032
10144
  </div>
10033
10145
  </div>
10034
10146
  </div>
@@ -10080,7 +10192,23 @@ path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
10080
10192
 
10081
10193
 
10082
10194
 
10083
-
10195
+ <h4>Example:</h4>
10196
+
10197
+ <div class="paperscript split">
10198
+
10199
+ <div class="buttons">
10200
+ <div class="button run">Run</div>
10201
+ </div>
10202
+
10203
+ <script type="text/paperscript" canvas="canvas-109">
10204
+ var result = new Path.RegularPolygon([50, 50], 3, 40)
10205
+ .intersect(new Path.Circle([50, 50], 25));
10206
+ result.fillColor = 'red';
10207
+ </script>
10208
+ <div class="canvas"><canvas width="516" height="100" id="canvas-109"></canvas></div>
10209
+ </div>
10210
+
10211
+
10084
10212
  </div>
10085
10213
  </div>
10086
10214
  </div>
@@ -10132,7 +10260,23 @@ path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
10132
10260
 
10133
10261
 
10134
10262
 
10135
-
10263
+ <h4>Example:</h4>
10264
+
10265
+ <div class="paperscript split">
10266
+
10267
+ <div class="buttons">
10268
+ <div class="button run">Run</div>
10269
+ </div>
10270
+
10271
+ <script type="text/paperscript" canvas="canvas-110">
10272
+ var result = new Path.RegularPolygon([50, 50], 3, 40)
10273
+ .subtract(new Path.Circle([50, 50], 25));
10274
+ result.fillColor = 'red';
10275
+ </script>
10276
+ <div class="canvas"><canvas width="516" height="100" id="canvas-110"></canvas></div>
10277
+ </div>
10278
+
10279
+
10136
10280
  </div>
10137
10281
  </div>
10138
10282
  </div>
@@ -10183,7 +10327,23 @@ path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
10183
10327
 
10184
10328
 
10185
10329
 
10186
-
10330
+ <h4>Example:</h4>
10331
+
10332
+ <div class="paperscript split">
10333
+
10334
+ <div class="buttons">
10335
+ <div class="button run">Run</div>
10336
+ </div>
10337
+
10338
+ <script type="text/paperscript" canvas="canvas-111">
10339
+ var result = new Path.RegularPolygon([50, 50], 3, 40)
10340
+ .exclude(new Path.Circle([50, 50], 25));
10341
+ result.fillColor = 'red';
10342
+ </script>
10343
+ <div class="canvas"><canvas width="516" height="100" id="canvas-111"></canvas></div>
10344
+ </div>
10345
+
10346
+
10187
10347
  </div>
10188
10348
  </div>
10189
10349
  </div>
@@ -10291,9 +10451,9 @@ path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
10291
10451
 
10292
10452
  <h3>Path Intersections and Locations</h3>
10293
10453
 
10294
- <div id="getintersections-path" class="member">
10454
+ <div id="getintersections" class="member">
10295
10455
  <div class="member-link">
10296
- <a name="getintersections-path" href="#getintersections-path"><tt><b>getIntersections</b>(path[, include])</tt></a>
10456
+ <a name="getintersections" href="#getintersections"><tt><b>getIntersections</b>([path[, include]])</tt></a>
10297
10457
  </div>
10298
10458
  <div class="member-description hidden">
10299
10459
  <div class="member-text">
@@ -10307,7 +10467,7 @@ path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
10307
10467
  <tt>path:</tt>
10308
10468
  <a href="../classes/PathItem.html"><tt>PathItem</tt></a>
10309
10469
  &mdash;&nbsp;the other item to find the intersections with
10310
-
10470
+ &mdash;&nbsp;optional
10311
10471
  </li>
10312
10472
 
10313
10473
  <li>
@@ -10348,7 +10508,7 @@ path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
10348
10508
  <div class="button run">Run</div>
10349
10509
  </div>
10350
10510
 
10351
- <script type="text/paperscript" canvas="canvas-108">
10511
+ <script type="text/paperscript" canvas="canvas-112">
10352
10512
  var path = new Path.Rectangle(new Point(30, 25), new Size(50, 50));
10353
10513
  path.strokeColor = 'black';
10354
10514
 
@@ -10371,7 +10531,7 @@ function onFrame(event) {
10371
10531
  }
10372
10532
  }
10373
10533
  </script>
10374
- <div class="canvas"><canvas width="516" height="100" id="canvas-108"></canvas></div>
10534
+ <div class="canvas"><canvas width="516" height="100" id="canvas-112"></canvas></div>
10375
10535
  </div>
10376
10536
 
10377
10537
 
@@ -10512,7 +10672,7 @@ function onFrame(event) {
10512
10672
  <div class="button run">Run</div>
10513
10673
  </div>
10514
10674
 
10515
- <script type="text/paperscript" canvas="canvas-109">
10675
+ <script type="text/paperscript" canvas="canvas-113">
10516
10676
  var star = new Path.Star({
10517
10677
  center: view.center,
10518
10678
  points: 10,
@@ -10536,7 +10696,7 @@ function onMouseMove(event) {
10536
10696
  circle.position = nearestPoint;
10537
10697
  }
10538
10698
  </script>
10539
- <div class="canvas"><canvas width="516" height="200" id="canvas-109"></canvas></div>
10699
+ <div class="canvas"><canvas width="516" height="200" id="canvas-113"></canvas></div>
10540
10700
  </div>
10541
10701
 
10542
10702
 
@@ -10599,7 +10759,7 @@ function onMouseMove(event) {
10599
10759
  <div class="button run">Run</div>
10600
10760
  </div>
10601
10761
 
10602
- <script type="text/paperscript" canvas="canvas-110">
10762
+ <script type="text/paperscript" canvas="canvas-114">
10603
10763
  // Create a circle shaped path at { x: 80, y: 50 }
10604
10764
  // with a radius of 35:
10605
10765
  var path = new Path.Circle({
@@ -10617,7 +10777,7 @@ copy.position.x += 150;
10617
10777
  // Flatten the copied path, with a maximum error of 4 points:
10618
10778
  copy.flatten(4);
10619
10779
  </script>
10620
- <div class="canvas"><canvas width="516" height="100" id="canvas-110"></canvas></div>
10780
+ <div class="canvas"><canvas width="516" height="100" id="canvas-114"></canvas></div>
10621
10781
  </div>
10622
10782
 
10623
10783
 
@@ -10695,7 +10855,7 @@ copy.flatten(4);
10695
10855
  <div class="button run">Run</div>
10696
10856
  </div>
10697
10857
 
10698
- <script type="text/paperscript" canvas="canvas-111">
10858
+ <script type="text/paperscript" canvas="canvas-115">
10699
10859
  // Create a rectangular path with its top-left point at
10700
10860
  // {x: 30, y: 25} and a size of {width: 50, height: 50}:
10701
10861
  var path = new Path.Rectangle({
@@ -10714,7 +10874,7 @@ copy.position.x += 100;
10714
10874
  // Smooth the segments of the copy:
10715
10875
  copy.smooth({ type: 'continuous' });
10716
10876
  </script>
10717
- <div class="canvas"><canvas width="516" height="100" id="canvas-111"></canvas></div>
10877
+ <div class="canvas"><canvas width="516" height="100" id="canvas-115"></canvas></div>
10718
10878
  </div>
10719
10879
 
10720
10880
 
@@ -10726,7 +10886,7 @@ copy.smooth({ type: 'continuous' });
10726
10886
  <div class="button run">Run</div>
10727
10887
  </div>
10728
10888
 
10729
- <script type="text/paperscript" canvas="canvas-112">
10889
+ <script type="text/paperscript" canvas="canvas-116">
10730
10890
  var path = new Path();
10731
10891
  path.strokeColor = 'black';
10732
10892
 
@@ -10751,7 +10911,7 @@ copy.fullySelected = true;
10751
10911
  // Smooth the path using centripetal Catmull-Rom splines:
10752
10912
  copy.smooth({ type: 'catmull-rom', factor: 0.5 });
10753
10913
  </script>
10754
- <div class="canvas"><canvas width="516" height="220" id="canvas-112"></canvas></div>
10914
+ <div class="canvas"><canvas width="516" height="220" id="canvas-116"></canvas></div>
10755
10915
  </div>
10756
10916
 
10757
10917
 
@@ -10763,7 +10923,7 @@ copy.smooth({ type: 'catmull-rom', factor: 0.5 });
10763
10923
  <div class="button run">Run</div>
10764
10924
  </div>
10765
10925
 
10766
- <script type="text/paperscript" canvas="canvas-113">
10926
+ <script type="text/paperscript" canvas="canvas-117">
10767
10927
  // Create 5 rectangles, next to each other:
10768
10928
  var paths = [];
10769
10929
  for (var i = 0; i < 5; i++) {
@@ -10793,7 +10953,7 @@ paths[3].smooth({ type: 'continuous', from: 0, to: 2 });
10793
10953
  // Smooth a range, using negative indices:
10794
10954
  paths[4].smooth({ type: 'continuous', from: -1, to: 1 });
10795
10955
  </script>
10796
- <div class="canvas"><canvas width="516" height="110" id="canvas-113"></canvas></div>
10956
+ <div class="canvas"><canvas width="516" height="110" id="canvas-117"></canvas></div>
10797
10957
  </div>
10798
10958
 
10799
10959
 
@@ -10846,7 +11006,7 @@ paths[4].smooth({ type: 'continuous', from: -1, to: 1 });
10846
11006
  <div class="button run">Run</div>
10847
11007
  </div>
10848
11008
 
10849
- <script type="text/paperscript" canvas="canvas-114">
11009
+ <script type="text/paperscript" canvas="canvas-118">
10850
11010
  var path;
10851
11011
  function onMouseDown(event) {
10852
11012
  // If we already made a path before, deselect it:
@@ -10876,7 +11036,7 @@ function onMouseUp(event) {
10876
11036
  path.selected = true;
10877
11037
  }
10878
11038
  </script>
10879
- <div class="canvas"><canvas width="516" height="300" id="canvas-114"></canvas></div>
11039
+ <div class="canvas"><canvas width="516" height="300" id="canvas-118"></canvas></div>
10880
11040
  </div>
10881
11041
 
10882
11042
 
@@ -11075,7 +11235,7 @@ function onMouseUp(event) {
11075
11235
  <div class="button run">Run</div>
11076
11236
  </div>
11077
11237
 
11078
- <script type="text/paperscript" canvas="canvas-115">
11238
+ <script type="text/paperscript" canvas="canvas-119">
11079
11239
  var path = new Path();
11080
11240
  path.strokeColor = 'black';
11081
11241
 
@@ -11095,7 +11255,7 @@ path.arcTo(throughPoint, toPoint);
11095
11255
  var circle = new Path.Circle(throughPoint, 3);
11096
11256
  circle.fillColor = 'red';
11097
11257
  </script>
11098
- <div class="canvas"><canvas width="516" height="100" id="canvas-115"></canvas></div>
11258
+ <div class="canvas"><canvas width="516" height="100" id="canvas-119"></canvas></div>
11099
11259
  </div>
11100
11260
 
11101
11261
 
@@ -11107,7 +11267,7 @@ circle.fillColor = 'red';
11107
11267
  <div class="button run">Run</div>
11108
11268
  </div>
11109
11269
 
11110
- <script type="text/paperscript" canvas="canvas-116">
11270
+ <script type="text/paperscript" canvas="canvas-120">
11111
11271
  var myPath;
11112
11272
  function onMouseDrag(event) {
11113
11273
  // If we created a path before, remove it:
@@ -11135,7 +11295,7 @@ function onMouseUp(event) {
11135
11295
  myPath.fillColor = 'black';
11136
11296
  }
11137
11297
  </script>
11138
- <div class="canvas"><canvas width="516" height="300" id="canvas-116"></canvas></div>
11298
+ <div class="canvas"><canvas width="516" height="300" id="canvas-120"></canvas></div>
11139
11299
  </div>
11140
11300
 
11141
11301
 
@@ -11184,7 +11344,7 @@ function onMouseUp(event) {
11184
11344
  <div class="button run">Run</div>
11185
11345
  </div>
11186
11346
 
11187
- <script type="text/paperscript" canvas="canvas-117">
11347
+ <script type="text/paperscript" canvas="canvas-121">
11188
11348
  var path = new Path();
11189
11349
  path.strokeColor = 'black';
11190
11350
 
@@ -11199,7 +11359,7 @@ path2.add(new Point(180, 25));
11199
11359
  // we pass `false` as the second argument to arcTo:
11200
11360
  path2.arcTo(new Point(280, 25), false);
11201
11361
  </script>
11202
- <div class="canvas"><canvas width="516" height="100" id="canvas-117"></canvas></div>
11362
+ <div class="canvas"><canvas width="516" height="100" id="canvas-121"></canvas></div>
11203
11363
  </div>
11204
11364
 
11205
11365
 
@@ -11211,7 +11371,7 @@ path2.arcTo(new Point(280, 25), false);
11211
11371
  <div class="button run">Run</div>
11212
11372
  </div>
11213
11373
 
11214
- <script type="text/paperscript" canvas="canvas-118">
11374
+ <script type="text/paperscript" canvas="canvas-122">
11215
11375
  var myPath;
11216
11376
 
11217
11377
  // The mouse has to move at least 20 points before
@@ -11232,7 +11392,7 @@ function onMouseDrag(event) {
11232
11392
  myPath.arcTo(event.point);
11233
11393
  }
11234
11394
  </script>
11235
- <div class="canvas"><canvas width="516" height="300" id="canvas-118"></canvas></div>
11395
+ <div class="canvas"><canvas width="516" height="300" id="canvas-122"></canvas></div>
11236
11396
  </div>
11237
11397
 
11238
11398
 
@@ -11288,7 +11448,7 @@ function onMouseDrag(event) {
11288
11448
  <div class="button run">Run</div>
11289
11449
  </div>
11290
11450
 
11291
- <script type="text/paperscript" canvas="canvas-119">
11451
+ <script type="text/paperscript" canvas="canvas-123">
11292
11452
  var myPath;
11293
11453
  function onMouseMove(event) {
11294
11454
  // If we created a path before, remove it:
@@ -11309,7 +11469,7 @@ function onMouseMove(event) {
11309
11469
  myPath.selected = true;
11310
11470
  }
11311
11471
  </script>
11312
- <div class="canvas"><canvas width="516" height="300" id="canvas-119"></canvas></div>
11472
+ <div class="canvas"><canvas width="516" height="300" id="canvas-123"></canvas></div>
11313
11473
  </div>
11314
11474
 
11315
11475
 
@@ -11494,7 +11654,7 @@ function onMouseMove(event) {
11494
11654
  <div class="button run">Run</div>
11495
11655
  </div>
11496
11656
 
11497
- <script type="text/paperscript" canvas="canvas-120">
11657
+ <script type="text/paperscript" canvas="canvas-124">
11498
11658
  var path = new Path();
11499
11659
  path.strokeColor = 'black';
11500
11660
 
@@ -11508,7 +11668,7 @@ path.lineBy(50, 0);
11508
11668
  // 0 in x direction and 50 in y direction, becomes {x: 75, y: 75}
11509
11669
  path.lineBy(0, 50);
11510
11670
  </script>
11511
- <div class="canvas"><canvas width="516" height="100" id="canvas-120"></canvas></div>
11671
+ <div class="canvas"><canvas width="516" height="100" id="canvas-124"></canvas></div>
11512
11672
  </div>
11513
11673
 
11514
11674
 
@@ -11520,7 +11680,7 @@ path.lineBy(0, 50);
11520
11680
  <div class="button run">Run</div>
11521
11681
  </div>
11522
11682
 
11523
- <script type="text/paperscript" canvas="canvas-121">
11683
+ <script type="text/paperscript" canvas="canvas-125">
11524
11684
  var path = new Path();
11525
11685
  path.strokeColor = 'black';
11526
11686
 
@@ -11546,7 +11706,7 @@ path.smooth();
11546
11706
  // the construction of the path:
11547
11707
  // path.selected = true;
11548
11708
  </script>
11549
- <div class="canvas"><canvas width="516" height="300" id="canvas-121"></canvas></div>
11709
+ <div class="canvas"><canvas width="516" height="300" id="canvas-125"></canvas></div>
11550
11710
  </div>
11551
11711
 
11552
11712
 
@@ -11765,7 +11925,7 @@ path.smooth();
11765
11925
 
11766
11926
  <!-- =========================== copyright notice ========================== -->
11767
11927
  <p class="footer">
11768
- Paper.js v0.12.20<br>
11928
+ Paper.js v0.14.0<br>
11769
11929
  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>
11770
11930
  <div class="content-end"></div>
11771
11931