paper 0.15.0 → 0.17.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 (64) hide show
  1. package/CHANGELOG.md +158 -0
  2. package/README.md +24 -16
  3. package/dist/docs/assets/js/paper.js +4811 -808
  4. package/dist/docs/classes/AreaText.html +771 -243
  5. package/dist/docs/classes/ChangeFlag.html +1 -1
  6. package/dist/docs/classes/Color.html +218 -21
  7. package/dist/docs/classes/CompoundPath.html +1174 -274
  8. package/dist/docs/classes/Curve.html +2 -2
  9. package/dist/docs/classes/CurveLocation.html +1 -1
  10. package/dist/docs/classes/DrawEvent.html +69 -0
  11. package/dist/docs/classes/Effect.html +434 -0
  12. package/dist/docs/classes/EffectInstance.html +304 -0
  13. package/dist/docs/classes/Event.html +1 -1
  14. package/dist/docs/classes/Gradient.html +1 -1
  15. package/dist/docs/classes/GradientStop.html +1 -1
  16. package/dist/docs/classes/Group.html +842 -243
  17. package/dist/docs/classes/HitResult.html +1 -1
  18. package/dist/docs/classes/HostItem.html +770 -242
  19. package/dist/docs/classes/Item.html +827 -242
  20. package/dist/docs/classes/Key.html +1 -1
  21. package/dist/docs/classes/KeyEvent.html +1 -1
  22. package/dist/docs/classes/Layer.html +784 -185
  23. package/dist/docs/classes/Matrix.html +1 -1
  24. package/dist/docs/classes/MouseEvent.html +1 -1
  25. package/dist/docs/classes/PaperScope.html +1 -1
  26. package/dist/docs/classes/PaperScript.html +4 -2
  27. package/dist/docs/classes/Path.html +1366 -352
  28. package/dist/docs/classes/PathItem.html +1198 -298
  29. package/dist/docs/classes/PathText.html +772 -244
  30. package/dist/docs/classes/PatternDefinition.html +367 -0
  31. package/dist/docs/classes/Point.html +33 -5
  32. package/dist/docs/classes/PointText.html +771 -243
  33. package/dist/docs/classes/Project.html +251 -9
  34. package/dist/docs/classes/Raster.html +770 -242
  35. package/dist/docs/classes/Rectangle.html +50 -8
  36. package/dist/docs/classes/Segment.html +79 -2
  37. package/dist/docs/classes/Shape.html +770 -242
  38. package/dist/docs/classes/Size.html +31 -3
  39. package/dist/docs/classes/StrokeProfileStop.html +346 -0
  40. package/dist/docs/classes/Style.html +67 -6
  41. package/dist/docs/classes/SymbolDefinition.html +28 -2
  42. package/dist/docs/classes/SymbolItem.html +807 -242
  43. package/dist/docs/classes/TextItem.html +771 -243
  44. package/dist/docs/classes/TextRange.html +1 -1
  45. package/dist/docs/classes/TextStory.html +1 -1
  46. package/dist/docs/classes/Tool.html +2 -2
  47. package/dist/docs/classes/ToolEvent.html +1 -1
  48. package/dist/docs/classes/Tween.html +1 -1
  49. package/dist/docs/classes/View.html +2 -2
  50. package/dist/docs/classes/global.html +1 -1
  51. package/dist/docs/classes/index.html +2 -2
  52. package/dist/docs/index.html +1 -1
  53. package/dist/node/browser.js +15 -0
  54. package/dist/paper-core.js +4701 -728
  55. package/dist/paper-core.min.js +3 -3
  56. package/dist/paper-full.js +4811 -808
  57. package/dist/paper-full.min.js +3 -3
  58. package/dist/paper-hosted.js +5389 -892
  59. package/dist/paper.d.ts +1058 -69
  60. package/examples/Paperjs.org/LiveEffects.html +366 -0
  61. package/examples/Paperjs.org/Offsetting.html +379 -0
  62. package/examples/Paperjs.org/StrokeProfiles.html +706 -0
  63. package/examples/Scripts/Patterns.html +57 -0
  64. package/package.json +21 -11
@@ -29,6 +29,91 @@
29
29
  <h2>Properties</h2>
30
30
 
31
31
 
32
+ <div id="effects" class="member">
33
+ <div class="member-link">
34
+ <a name="effects" href="#effects"><tt><b>effects</b></tt></a>
35
+ </div>
36
+ <div class="member-description hidden">
37
+
38
+ <div class="member-text">
39
+ <p>The live effects of the item, in the order in which they apply, as the instances of the <tt>Effecteffects</tt> that they use. They derive what is drawn from the item without changing it: drawing draws their output, and <a href="../classes/Item.html#previewbounds"><tt>previewBounds</tt></a> measures it, while hit testing, <a href="../classes/Item.html#bounds"><tt>bounds</tt></a> and <a href="../classes/Item.html#strokebounds"><tt>strokeBounds</tt></a> stay with the item itself. It is set to plain objects describing them, <code>{ type,
40
+ parameters, visible }</code>, with the <code>type</code> of the effect. Changing the returned array directly isn&rsquo;t tracked, as with <a href="../classes/Path.html#segments"><tt>path.segments</tt></a>.</p>
41
+ <p>Paper.js has these effects, and <a href="../classes/Effect.html"><tt>Effect</tt></a> creates more:</p>
42
+ <ul>
43
+ <li><code>offset</code>: offsets the paths, see <a href="../classes/PathItem.html#offset"><tt>pathItem.offset</tt></a>(), with the parameters <code>distance</code> (<code>0</code>), <code>join</code> (<code>&#39;miter&#39;</code>) and <code>miterLimit</code> (<code>10</code>).</li>
44
+ <li><code>outline</code>: outlines the strokes of the paths as filled areas next to their fills, see <a href="../classes/PathItem.html#outline"><tt>pathItem.outline</tt></a>(), following their <a href="../classes/Path.html#strokeprofile"><tt>path.strokeProfile</tt></a>.</li>
45
+ </ul>
46
+
47
+
48
+
49
+ <ul class="member-list">
50
+ <h4>Type:</h4>
51
+ <li>
52
+ Array of <a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a> objects
53
+ </li>
54
+ </ul>
55
+
56
+
57
+ <h4>Example:</h4>
58
+
59
+ <div class="paperscript split">
60
+
61
+ <div class="buttons">
62
+ <div class="button run">Run</div>
63
+ </div>
64
+
65
+ <script type="text/paperscript" canvas="canvas-0">
66
+ var path = new Path.Star({
67
+ center: view.center,
68
+ points: 5,
69
+ radius1: 20,
70
+ radius2: 40,
71
+ strokeColor: 'black',
72
+ strokeWidth: 8
73
+ });
74
+ path.effects = [
75
+ { type: 'offset', parameters: { distance: 10, join: 'round' } },
76
+ { type: 'outline' }
77
+ ];
78
+ </script>
79
+ <div class="canvas"><canvas width="516" height="100" id="canvas-0"></canvas></div>
80
+ </div>
81
+
82
+
83
+ </div>
84
+
85
+ </div>
86
+ </div>
87
+
88
+
89
+ <div id="previewbounds-matrix" class="member">
90
+ <div class="member-link">
91
+ <a name="previewbounds-matrix" href="#previewbounds-matrix"><tt><b>previewBounds</b></tt></a>
92
+ </div>
93
+ <div class="member-description hidden">
94
+
95
+ <div class="member-text">
96
+ <p>The bounds of what the item looks like with its effects, in the coordinate space of its parent: of their output with its strokes, or of its children&rsquo;s with their effects, and its <a href="../classes/Item.html#strokebounds"><tt>strokeBounds</tt></a> without them, as Illustrator&rsquo;s &ldquo;Use Preview Bounds&rdquo;.</p>
97
+
98
+ <p>Read only.</p>
99
+
100
+
101
+
102
+ <ul class="member-list">
103
+ <h4>Type:</h4>
104
+ <li>
105
+ <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
106
+ </li>
107
+ </ul>
108
+
109
+
110
+
111
+ </div>
112
+
113
+ </div>
114
+ </div>
115
+
116
+
32
117
  <div id="key" class="member">
33
118
  <div class="member-link">
34
119
  <a name="key" href="#key"><tt><b>key</b></tt></a>
@@ -141,7 +226,7 @@
141
226
  <div class="button run">Run</div>
142
227
  </div>
143
228
 
144
- <script type="text/paperscript" canvas="canvas-0">
229
+ <script type="text/paperscript" canvas="canvas-1">
145
230
  var path = new Path.Circle({
146
231
  center: [80, 50],
147
232
  radius: 35
@@ -156,7 +241,7 @@ group.addChild(path);
156
241
  // The path can be accessed by name:
157
242
  group.children['example'].fillColor = 'red';
158
243
  </script>
159
- <div class="canvas"><canvas width="516" height="100" id="canvas-0"></canvas></div>
244
+ <div class="canvas"><canvas width="516" height="100" id="canvas-1"></canvas></div>
160
245
  </div>
161
246
 
162
247
 
@@ -194,7 +279,7 @@ group.children['example'].fillColor = 'red';
194
279
  <div class="button run">Run</div>
195
280
  </div>
196
281
 
197
- <script type="text/paperscript" canvas="canvas-1">
282
+ <script type="text/paperscript" canvas="canvas-2">
198
283
  var circle = new Path.Circle({
199
284
  center: [80, 50],
200
285
  radius: 30
@@ -205,7 +290,7 @@ circle.style = {
205
290
  strokeWidth: 5
206
291
  };
207
292
  </script>
208
- <div class="canvas"><canvas width="516" height="100" id="canvas-1"></canvas></div>
293
+ <div class="canvas"><canvas width="516" height="100" id="canvas-2"></canvas></div>
209
294
  </div>
210
295
 
211
296
 
@@ -217,7 +302,7 @@ circle.style = {
217
302
  <div class="button run">Run</div>
218
303
  </div>
219
304
 
220
- <script type="text/paperscript" canvas="canvas-2">
305
+ <script type="text/paperscript" canvas="canvas-3">
221
306
  var path = new Path.Circle({
222
307
  center: [50, 50],
223
308
  radius: 30,
@@ -232,7 +317,7 @@ var path2 = new Path.Circle({
232
317
  // Copy the path style of path:
233
318
  path2.style = path.style;
234
319
  </script>
235
- <div class="canvas"><canvas width="516" height="100" id="canvas-2"></canvas></div>
320
+ <div class="canvas"><canvas width="516" height="100" id="canvas-3"></canvas></div>
236
321
  </div>
237
322
 
238
323
 
@@ -244,7 +329,7 @@ path2.style = path.style;
244
329
  <div class="button run">Run</div>
245
330
  </div>
246
331
 
247
- <script type="text/paperscript" canvas="canvas-3">
332
+ <script type="text/paperscript" canvas="canvas-4">
248
333
  var myStyle = {
249
334
  fillColor: 'red',
250
335
  strokeColor: 'blue',
@@ -263,7 +348,7 @@ var path2 = new Path.Circle({
263
348
  });
264
349
  path2.style = myStyle;
265
350
  </script>
266
- <div class="canvas"><canvas width="516" height="100" id="canvas-3"></canvas></div>
351
+ <div class="canvas"><canvas width="516" height="100" id="canvas-4"></canvas></div>
267
352
  </div>
268
353
 
269
354
 
@@ -305,7 +390,7 @@ path2.style = myStyle;
305
390
  <div class="button run">Run</div>
306
391
  </div>
307
392
 
308
- <script type="text/paperscript" canvas="canvas-4">
393
+ <script type="text/paperscript" canvas="canvas-5">
309
394
  var unlockedItem = new Path.Circle({
310
395
  center: view.center - [35, 0],
311
396
  radius: 30,
@@ -332,7 +417,7 @@ new PointText({
332
417
  justification: 'center'
333
418
  });
334
419
  </script>
335
- <div class="canvas"><canvas width="516" height="100" id="canvas-4"></canvas></div>
420
+ <div class="canvas"><canvas width="516" height="100" id="canvas-5"></canvas></div>
336
421
  </div>
337
422
 
338
423
 
@@ -374,7 +459,7 @@ new PointText({
374
459
  <div class="button run">Run</div>
375
460
  </div>
376
461
 
377
- <script type="text/paperscript" canvas="canvas-5">
462
+ <script type="text/paperscript" canvas="canvas-6">
378
463
  var path = new Path.Circle({
379
464
  center: [50, 50],
380
465
  radius: 20,
@@ -384,7 +469,7 @@ var path = new Path.Circle({
384
469
  // Hide the path:
385
470
  path.visible = false;
386
471
  </script>
387
- <div class="canvas"><canvas width="516" height="100" id="canvas-5"></canvas></div>
472
+ <div class="canvas"><canvas width="516" height="100" id="canvas-6"></canvas></div>
388
473
  </div>
389
474
 
390
475
 
@@ -432,7 +517,7 @@ path.visible = false;
432
517
  <div class="button run">Run</div>
433
518
  </div>
434
519
 
435
- <script type="text/paperscript" canvas="canvas-6">
520
+ <script type="text/paperscript" canvas="canvas-7">
436
521
  // Create a white rectangle in the background
437
522
  // with the same dimensions as the view:
438
523
  var background = new Path.Rectangle(view.bounds);
@@ -453,7 +538,7 @@ var circle2 = new Path.Circle({
453
538
  // Set the blend mode of circle2:
454
539
  circle2.blendMode = 'multiply';
455
540
  </script>
456
- <div class="canvas"><canvas width="516" height="100" id="canvas-6"></canvas></div>
541
+ <div class="canvas"><canvas width="516" height="100" id="canvas-7"></canvas></div>
457
542
  </div>
458
543
 
459
544
 
@@ -495,7 +580,7 @@ circle2.blendMode = 'multiply';
495
580
  <div class="button run">Run</div>
496
581
  </div>
497
582
 
498
- <script type="text/paperscript" canvas="canvas-7">
583
+ <script type="text/paperscript" canvas="canvas-8">
499
584
  var circle = new Path.Circle({
500
585
  center: [80, 50],
501
586
  radius: 35,
@@ -513,7 +598,7 @@ var circle2 = new Path.Circle({
513
598
  // Make circle2 50% transparent:
514
599
  circle2.opacity = 0.5;
515
600
  </script>
516
- <div class="canvas"><canvas width="516" height="100" id="canvas-7"></canvas></div>
601
+ <div class="canvas"><canvas width="516" height="100" id="canvas-8"></canvas></div>
517
602
  </div>
518
603
 
519
604
 
@@ -636,14 +721,14 @@ circle.textWrap = { offset: 10 };</code></pre>
636
721
  <div class="button run">Run</div>
637
722
  </div>
638
723
 
639
- <script type="text/paperscript" canvas="canvas-8">
724
+ <script type="text/paperscript" canvas="canvas-9">
640
725
  var path = new Path.Circle({
641
726
  center: [80, 50],
642
727
  radius: 35
643
728
  });
644
729
  path.selected = true; // Select the path
645
730
  </script>
646
- <div class="canvas"><canvas width="516" height="100" id="canvas-8"></canvas></div>
731
+ <div class="canvas"><canvas width="516" height="100" id="canvas-9"></canvas></div>
647
732
  </div>
648
733
 
649
734
 
@@ -800,7 +885,7 @@ console.log(path.data.pets.length); // 1</code></pre>
800
885
  <div class="button run">Run</div>
801
886
  </div>
802
887
 
803
- <script type="text/paperscript" canvas="canvas-9">
888
+ <script type="text/paperscript" canvas="canvas-10">
804
889
  // Create a circle at position { x: 10, y: 10 }
805
890
  var circle = new Path.Circle({
806
891
  center: new Point(10, 10),
@@ -814,7 +899,7 @@ circle.position = new Point(20, 20);
814
899
  // Move the circle 100 points to the right and 50 points down
815
900
  circle.position += new Point(100, 50);
816
901
  </script>
817
- <div class="canvas"><canvas width="516" height="100" id="canvas-9"></canvas></div>
902
+ <div class="canvas"><canvas width="516" height="100" id="canvas-10"></canvas></div>
818
903
  </div>
819
904
 
820
905
 
@@ -826,7 +911,7 @@ circle.position += new Point(100, 50);
826
911
  <div class="button run">Run</div>
827
912
  </div>
828
913
 
829
- <script type="text/paperscript" canvas="canvas-10">
914
+ <script type="text/paperscript" canvas="canvas-11">
830
915
  // Create a circle at position { x: 20, y: 20 }
831
916
  var circle = new Path.Circle({
832
917
  center: new Point(20, 20),
@@ -837,7 +922,7 @@ var circle = new Path.Circle({
837
922
  // Move the circle 100 points to the right
838
923
  circle.position.x += 100;
839
924
  </script>
840
- <div class="canvas"><canvas width="516" height="100" id="canvas-10"></canvas></div>
925
+ <div class="canvas"><canvas width="516" height="100" id="canvas-11"></canvas></div>
841
926
  </div>
842
927
 
843
928
 
@@ -1363,7 +1448,7 @@ console.log(group.children[0] == path); // true</code></pre>
1363
1448
  <div class="button run">Run</div>
1364
1449
  </div>
1365
1450
 
1366
- <script type="text/paperscript" canvas="canvas-11">
1451
+ <script type="text/paperscript" canvas="canvas-12">
1367
1452
  var path = new Path.Circle({
1368
1453
  center: [80, 50],
1369
1454
  radius: 35
@@ -1376,7 +1461,7 @@ group.addChild(path);
1376
1461
  // Access the path through the group's children array:
1377
1462
  group.children[0].fillColor = 'red';
1378
1463
  </script>
1379
- <div class="canvas"><canvas width="516" height="100" id="canvas-11"></canvas></div>
1464
+ <div class="canvas"><canvas width="516" height="100" id="canvas-12"></canvas></div>
1380
1465
  </div>
1381
1466
 
1382
1467
 
@@ -1388,7 +1473,7 @@ group.children[0].fillColor = 'red';
1388
1473
  <div class="button run">Run</div>
1389
1474
  </div>
1390
1475
 
1391
- <script type="text/paperscript" canvas="canvas-12">
1476
+ <script type="text/paperscript" canvas="canvas-13">
1392
1477
  var path = new Path.Circle({
1393
1478
  center: [80, 50],
1394
1479
  radius: 35
@@ -1403,7 +1488,7 @@ group.addChild(path);
1403
1488
  // The path can be accessed by name:
1404
1489
  group.children['example'].fillColor = 'orange';
1405
1490
  </script>
1406
- <div class="canvas"><canvas width="516" height="100" id="canvas-12"></canvas></div>
1491
+ <div class="canvas"><canvas width="516" height="100" id="canvas-13"></canvas></div>
1407
1492
  </div>
1408
1493
 
1409
1494
 
@@ -1415,7 +1500,7 @@ group.children['example'].fillColor = 'orange';
1415
1500
  <div class="button run">Run</div>
1416
1501
  </div>
1417
1502
 
1418
- <script type="text/paperscript" canvas="canvas-13">
1503
+ <script type="text/paperscript" canvas="canvas-14">
1419
1504
  var path = new Path.Circle({
1420
1505
  center: [80, 50],
1421
1506
  radius: 35
@@ -1427,7 +1512,7 @@ group.children = [path];
1427
1512
  // The path is the first child of the group:
1428
1513
  group.firstChild.fillColor = 'green';
1429
1514
  </script>
1430
- <div class="canvas"><canvas width="516" height="100" id="canvas-13"></canvas></div>
1515
+ <div class="canvas"><canvas width="516" height="100" id="canvas-14"></canvas></div>
1431
1516
  </div>
1432
1517
 
1433
1518
 
@@ -1604,7 +1689,7 @@ group.firstChild.fillColor = 'green';
1604
1689
  <div class="button run">Run</div>
1605
1690
  </div>
1606
1691
 
1607
- <script type="text/paperscript" canvas="canvas-14">
1692
+ <script type="text/paperscript" canvas="canvas-15">
1608
1693
  // Create a circle shaped path at { x: 80, y: 50 }
1609
1694
  // with a radius of 35:
1610
1695
  var circle = new Path.Circle({
@@ -1615,7 +1700,7 @@ var circle = new Path.Circle({
1615
1700
  // Set its stroke color to RGB red:
1616
1701
  circle.strokeColor = new Color(1, 0, 0);
1617
1702
  </script>
1618
- <div class="canvas"><canvas width="516" height="100" id="canvas-14"></canvas></div>
1703
+ <div class="canvas"><canvas width="516" height="100" id="canvas-15"></canvas></div>
1619
1704
  </div>
1620
1705
 
1621
1706
 
@@ -1652,7 +1737,7 @@ circle.strokeColor = new Color(1, 0, 0);
1652
1737
  <div class="button run">Run</div>
1653
1738
  </div>
1654
1739
 
1655
- <script type="text/paperscript" canvas="canvas-15">
1740
+ <script type="text/paperscript" canvas="canvas-16">
1656
1741
  // Create a circle shaped path at { x: 80, y: 50 }
1657
1742
  // with a radius of 35:
1658
1743
  var circle = new Path.Circle({
@@ -1664,7 +1749,7 @@ var circle = new Path.Circle({
1664
1749
  // Set its stroke width to 10:
1665
1750
  circle.strokeWidth = 10;
1666
1751
  </script>
1667
- <div class="canvas"><canvas width="516" height="100" id="canvas-15"></canvas></div>
1752
+ <div class="canvas"><canvas width="516" height="100" id="canvas-16"></canvas></div>
1668
1753
  </div>
1669
1754
 
1670
1755
 
@@ -1711,7 +1796,7 @@ circle.strokeWidth = 10;
1711
1796
  <div class="button run">Run</div>
1712
1797
  </div>
1713
1798
 
1714
- <script type="text/paperscript" canvas="canvas-16">
1799
+ <script type="text/paperscript" canvas="canvas-17">
1715
1800
  var line = new Path({
1716
1801
  segments: [[80, 50], [420, 50]],
1717
1802
  strokeColor: 'black',
@@ -1732,7 +1817,7 @@ var line2 = line.clone();
1732
1817
  line2.position.y += 100;
1733
1818
  line2.strokeCap = 'butt';
1734
1819
  </script>
1735
- <div class="canvas"><canvas width="516" height="200" id="canvas-16"></canvas></div>
1820
+ <div class="canvas"><canvas width="516" height="200" id="canvas-17"></canvas></div>
1736
1821
  </div>
1737
1822
 
1738
1823
 
@@ -1779,7 +1864,7 @@ line2.strokeCap = 'butt';
1779
1864
  <div class="button run">Run</div>
1780
1865
  </div>
1781
1866
 
1782
- <script type="text/paperscript" canvas="canvas-17">
1867
+ <script type="text/paperscript" canvas="canvas-18">
1783
1868
  var path = new Path({
1784
1869
  segments: [[80, 100], [120, 40], [160, 100]],
1785
1870
  strokeColor: 'black',
@@ -1796,7 +1881,7 @@ var path3 = path2.clone();
1796
1881
  path3.position.x += path3.bounds.width * 1.5;
1797
1882
  path3.strokeJoin = 'bevel';
1798
1883
  </script>
1799
- <div class="canvas"><canvas width="516" height="120" id="canvas-17"></canvas></div>
1884
+ <div class="canvas"><canvas width="516" height="120" id="canvas-18"></canvas></div>
1800
1885
  </div>
1801
1886
 
1802
1887
 
@@ -1900,7 +1985,7 @@ path3.strokeJoin = 'bevel';
1900
1985
  <div class="button run">Run</div>
1901
1986
  </div>
1902
1987
 
1903
- <script type="text/paperscript" canvas="canvas-18">
1988
+ <script type="text/paperscript" canvas="canvas-19">
1904
1989
  var path = new Path.Circle({
1905
1990
  center: [80, 50],
1906
1991
  radius: 40,
@@ -1911,7 +1996,7 @@ var path = new Path.Circle({
1911
1996
  // Set the dashed stroke to [10pt dash, 4pt gap]:
1912
1997
  path.dashArray = [10, 4];
1913
1998
  </script>
1914
- <div class="canvas"><canvas width="516" height="100" id="canvas-18"></canvas></div>
1999
+ <div class="canvas"><canvas width="516" height="100" id="canvas-19"></canvas></div>
1915
2000
  </div>
1916
2001
 
1917
2002
 
@@ -1946,6 +2031,42 @@ path.dashArray = [10, 4];
1946
2031
 
1947
2032
 
1948
2033
 
2034
+ </div>
2035
+
2036
+ </div>
2037
+ </div>
2038
+
2039
+
2040
+ <div id="paintorder" class="member">
2041
+ <div class="member-link">
2042
+ <a name="paintorder" href="#paintorder"><tt><b>paintOrder</b></tt></a>
2043
+ </div>
2044
+ <div class="member-description hidden">
2045
+
2046
+ <div class="member-text">
2047
+ <p>The order in which the fill and the stroke are painted, as in SVG&rsquo;s <code>paint-order</code>, named after what is painted first: <code>&#39;fill&#39;</code> paints the fill first, <code>&#39;stroke&#39;</code> paints the stroke first, so the fill covers its inner half.</p>
2048
+
2049
+
2050
+ <ul class="member-list">
2051
+ <h4>Values:</h4>
2052
+ <li><tt>'fill'</tt>, <tt>'stroke'</tt></li>
2053
+ </ul>
2054
+
2055
+
2056
+ <ul class="member-list">
2057
+ <h4>Default:</h4>
2058
+ <li><tt>'fill'</tt></li>
2059
+ </ul>
2060
+
2061
+ <ul class="member-list">
2062
+ <h4>Type:</h4>
2063
+ <li>
2064
+ <tt>String</tt>
2065
+ </li>
2066
+ </ul>
2067
+
2068
+
2069
+
1949
2070
  </div>
1950
2071
 
1951
2072
  </div>
@@ -1981,7 +2102,7 @@ path.dashArray = [10, 4];
1981
2102
  <div class="button run">Run</div>
1982
2103
  </div>
1983
2104
 
1984
- <script type="text/paperscript" canvas="canvas-19">
2105
+ <script type="text/paperscript" canvas="canvas-20">
1985
2106
  // Create a circle shaped path at { x: 80, y: 50 }
1986
2107
  // with a radius of 35:
1987
2108
  var circle = new Path.Circle({
@@ -1992,7 +2113,7 @@ var circle = new Path.Circle({
1992
2113
  // Set the fill color of the circle to RGB red:
1993
2114
  circle.fillColor = new Color(1, 0, 0);
1994
2115
  </script>
1995
- <div class="canvas"><canvas width="516" height="100" id="canvas-19"></canvas></div>
2116
+ <div class="canvas"><canvas width="516" height="100" id="canvas-20"></canvas></div>
1996
2117
  </div>
1997
2118
 
1998
2119
 
@@ -2067,7 +2188,7 @@ circle.fillColor = new Color(1, 0, 0);
2067
2188
  <div class="button run">Run</div>
2068
2189
  </div>
2069
2190
 
2070
- <script type="text/paperscript" canvas="canvas-20">
2191
+ <script type="text/paperscript" canvas="canvas-21">
2071
2192
  var circle = new Path.Circle({
2072
2193
  center: [80, 50],
2073
2194
  radius: 35,
@@ -2080,7 +2201,7 @@ var circle = new Path.Circle({
2080
2201
  shadowOffset: new Point(5, 5)
2081
2202
  });
2082
2203
  </script>
2083
- <div class="canvas"><canvas width="516" height="100" id="canvas-20"></canvas></div>
2204
+ <div class="canvas"><canvas width="516" height="100" id="canvas-21"></canvas></div>
2084
2205
  </div>
2085
2206
 
2086
2207
 
@@ -2221,7 +2342,7 @@ var circle = new Path.Circle({
2221
2342
  <div class="button run">Run</div>
2222
2343
  </div>
2223
2344
 
2224
- <script type="text/paperscript" canvas="canvas-21">
2345
+ <script type="text/paperscript" canvas="canvas-22">
2225
2346
  // Create a rectangle shaped path with its top left point at:
2226
2347
  // {x: 50, y: 25} and a size of {width: 50, height: 50}
2227
2348
  var path = new Path.Rectangle(new Point(50, 25), new Size(50, 50));
@@ -2232,7 +2353,7 @@ path.onFrame = function(event) {
2232
2353
  this.rotate(3);
2233
2354
  }
2234
2355
  </script>
2235
- <div class="canvas"><canvas width="516" height="100" id="canvas-21"></canvas></div>
2356
+ <div class="canvas"><canvas width="516" height="100" id="canvas-22"></canvas></div>
2236
2357
  </div>
2237
2358
 
2238
2359
 
@@ -2276,7 +2397,7 @@ path.onFrame = function(event) {
2276
2397
  <div class="button run">Run</div>
2277
2398
  </div>
2278
2399
 
2279
- <script type="text/paperscript" canvas="canvas-22">
2400
+ <script type="text/paperscript" canvas="canvas-23">
2280
2401
  // Create a circle shaped path at the center of the view:
2281
2402
  var path = new Path.Circle({
2282
2403
  center: view.center,
@@ -2290,7 +2411,7 @@ path.onMouseDown = function(event) {
2290
2411
  this.fillColor = 'red';
2291
2412
  }
2292
2413
  </script>
2293
- <div class="canvas"><canvas width="516" height="100" id="canvas-22"></canvas></div>
2414
+ <div class="canvas"><canvas width="516" height="100" id="canvas-23"></canvas></div>
2294
2415
  </div>
2295
2416
 
2296
2417
 
@@ -2302,7 +2423,7 @@ path.onMouseDown = function(event) {
2302
2423
  <div class="button run">Run</div>
2303
2424
  </div>
2304
2425
 
2305
- <script type="text/paperscript" canvas="canvas-23">
2426
+ <script type="text/paperscript" canvas="canvas-24">
2306
2427
  // Loop 30 times:
2307
2428
  for (var i = 0; i < 30; i++) {
2308
2429
  // Create a circle shaped path at a random position
@@ -2320,7 +2441,7 @@ for (var i = 0; i < 30; i++) {
2320
2441
  }
2321
2442
  }
2322
2443
  </script>
2323
- <div class="canvas"><canvas width="516" height="100" id="canvas-23"></canvas></div>
2444
+ <div class="canvas"><canvas width="516" height="100" id="canvas-24"></canvas></div>
2324
2445
  </div>
2325
2446
 
2326
2447
 
@@ -2364,7 +2485,7 @@ for (var i = 0; i < 30; i++) {
2364
2485
  <div class="button run">Run</div>
2365
2486
  </div>
2366
2487
 
2367
- <script type="text/paperscript" canvas="canvas-24">
2488
+ <script type="text/paperscript" canvas="canvas-25">
2368
2489
  // Create a circle shaped path at the center of the view:
2369
2490
  var path = new Path.Circle({
2370
2491
  center: view.center,
@@ -2377,7 +2498,7 @@ path.onMouseDrag = function(event) {
2377
2498
  path.position += event.delta;
2378
2499
  }
2379
2500
  </script>
2380
- <div class="canvas"><canvas width="516" height="240" id="canvas-24"></canvas></div>
2501
+ <div class="canvas"><canvas width="516" height="240" id="canvas-25"></canvas></div>
2381
2502
  </div>
2382
2503
 
2383
2504
 
@@ -2421,7 +2542,7 @@ path.onMouseDrag = function(event) {
2421
2542
  <div class="button run">Run</div>
2422
2543
  </div>
2423
2544
 
2424
- <script type="text/paperscript" canvas="canvas-25">
2545
+ <script type="text/paperscript" canvas="canvas-26">
2425
2546
  // Create a circle shaped path at the center of the view:
2426
2547
  var path = new Path.Circle({
2427
2548
  center: view.center,
@@ -2435,7 +2556,7 @@ path.onMouseUp = function(event) {
2435
2556
  this.fillColor = 'red';
2436
2557
  }
2437
2558
  </script>
2438
- <div class="canvas"><canvas width="516" height="100" id="canvas-25"></canvas></div>
2559
+ <div class="canvas"><canvas width="516" height="100" id="canvas-26"></canvas></div>
2439
2560
  </div>
2440
2561
 
2441
2562
 
@@ -2479,7 +2600,7 @@ path.onMouseUp = function(event) {
2479
2600
  <div class="button run">Run</div>
2480
2601
  </div>
2481
2602
 
2482
- <script type="text/paperscript" canvas="canvas-26">
2603
+ <script type="text/paperscript" canvas="canvas-27">
2483
2604
  // Create a circle shaped path at the center of the view:
2484
2605
  var path = new Path.Circle({
2485
2606
  center: view.center,
@@ -2493,7 +2614,7 @@ path.onClick = function(event) {
2493
2614
  this.fillColor = 'red';
2494
2615
  }
2495
2616
  </script>
2496
- <div class="canvas"><canvas width="516" height="100" id="canvas-26"></canvas></div>
2617
+ <div class="canvas"><canvas width="516" height="100" id="canvas-27"></canvas></div>
2497
2618
  </div>
2498
2619
 
2499
2620
 
@@ -2505,7 +2626,7 @@ path.onClick = function(event) {
2505
2626
  <div class="button run">Run</div>
2506
2627
  </div>
2507
2628
 
2508
- <script type="text/paperscript" canvas="canvas-27">
2629
+ <script type="text/paperscript" canvas="canvas-28">
2509
2630
  // Loop 30 times:
2510
2631
  for (var i = 0; i < 30; i++) {
2511
2632
  // Create a circle shaped path at a random position
@@ -2523,7 +2644,7 @@ for (var i = 0; i < 30; i++) {
2523
2644
  }
2524
2645
  }
2525
2646
  </script>
2526
- <div class="canvas"><canvas width="516" height="100" id="canvas-27"></canvas></div>
2647
+ <div class="canvas"><canvas width="516" height="100" id="canvas-28"></canvas></div>
2527
2648
  </div>
2528
2649
 
2529
2650
 
@@ -2567,7 +2688,7 @@ for (var i = 0; i < 30; i++) {
2567
2688
  <div class="button run">Run</div>
2568
2689
  </div>
2569
2690
 
2570
- <script type="text/paperscript" canvas="canvas-28">
2691
+ <script type="text/paperscript" canvas="canvas-29">
2571
2692
  // Create a circle shaped path at the center of the view:
2572
2693
  var path = new Path.Circle({
2573
2694
  center: view.center,
@@ -2581,7 +2702,7 @@ path.onDoubleClick = function(event) {
2581
2702
  this.fillColor = 'red';
2582
2703
  }
2583
2704
  </script>
2584
- <div class="canvas"><canvas width="516" height="100" id="canvas-28"></canvas></div>
2705
+ <div class="canvas"><canvas width="516" height="100" id="canvas-29"></canvas></div>
2585
2706
  </div>
2586
2707
 
2587
2708
 
@@ -2593,7 +2714,7 @@ path.onDoubleClick = function(event) {
2593
2714
  <div class="button run">Run</div>
2594
2715
  </div>
2595
2716
 
2596
- <script type="text/paperscript" canvas="canvas-29">
2717
+ <script type="text/paperscript" canvas="canvas-30">
2597
2718
  // Loop 30 times:
2598
2719
  for (var i = 0; i < 30; i++) {
2599
2720
  // Create a circle shaped path at a random position
@@ -2611,7 +2732,7 @@ for (var i = 0; i < 30; i++) {
2611
2732
  }
2612
2733
  }
2613
2734
  </script>
2614
- <div class="canvas"><canvas width="516" height="100" id="canvas-29"></canvas></div>
2735
+ <div class="canvas"><canvas width="516" height="100" id="canvas-30"></canvas></div>
2615
2736
  </div>
2616
2737
 
2617
2738
 
@@ -2655,7 +2776,7 @@ for (var i = 0; i < 30; i++) {
2655
2776
  <div class="button run">Run</div>
2656
2777
  </div>
2657
2778
 
2658
- <script type="text/paperscript" canvas="canvas-30">
2779
+ <script type="text/paperscript" canvas="canvas-31">
2659
2780
  // Create a circle shaped path at the center of the view:
2660
2781
  var path = new Path.Circle({
2661
2782
  center: view.center,
@@ -2669,178 +2790,622 @@ path.onMouseMove = function(event) {
2669
2790
  this.opacity = Math.random();
2670
2791
  }
2671
2792
  </script>
2672
- <div class="canvas"><canvas width="516" height="100" id="canvas-30"></canvas></div>
2793
+ <div class="canvas"><canvas width="516" height="100" id="canvas-31"></canvas></div>
2794
+ </div>
2795
+
2796
+
2797
+ </div>
2798
+
2799
+ </div>
2800
+ </div>
2801
+
2802
+
2803
+ <div id="onmouseenter" class="member">
2804
+ <div class="member-link">
2805
+ <a name="onmouseenter" href="#onmouseenter"><tt><b>onMouseEnter</b></tt></a>
2673
2806
  </div>
2807
+ <div class="member-description hidden">
2808
+
2809
+ <div class="member-text">
2810
+ <p>The function to be called when the mouse moves over the item. This function will only be called again, once the mouse moved outside of the item first. The function receives a <a href="../classes/MouseEvent.html"><tt>MouseEvent</tt></a> object which contains information about the mouse event. Note that such mouse events bubble up the scene graph hierarchy and will reach the view, unless they are stopped with <a href="../classes/Event.html#stoppropagation"><tt>event.stopPropagation</tt></a>() or by returning <code>false</code> from the handler.</p>
2811
+
2812
+
2813
+
2814
+ <ul class="member-list">
2815
+ <h4>Type:</h4>
2816
+ <li>
2817
+ <tt>Function</tt>⟋<tt>null</tt>
2818
+ </li>
2819
+ </ul>
2820
+
2821
+
2822
+ <ul class="member-list">
2823
+ <h4>See also:</h4>
2824
+
2825
+ <li><tt><a href="../classes/View.html#onmouseenter"><tt>view.onMouseEnter</tt></a></tt></li>
2826
+
2827
+ </ul>
2828
+
2829
+ <h4>Example:<span class="description">When you move the mouse over the item, its fill color is set to red. When you move the mouse outside again, its fill color is set back to black.</span></h4>
2830
+
2831
+ <div class="paperscript split">
2832
+
2833
+ <div class="buttons">
2834
+ <div class="button run">Run</div>
2835
+ </div>
2836
+
2837
+ <script type="text/paperscript" canvas="canvas-32">
2838
+ // Create a circle shaped path at the center of the view:
2839
+ var path = new Path.Circle({
2840
+ center: view.center,
2841
+ radius: 25,
2842
+ fillColor: 'black'
2843
+ });
2844
+
2845
+ // When the mouse enters the item, set its fill color to red:
2846
+ path.onMouseEnter = function(event) {
2847
+ this.fillColor = 'red';
2848
+ }
2849
+
2850
+ // When the mouse leaves the item, set its fill color to black:
2851
+ path.onMouseLeave = function(event) {
2852
+ this.fillColor = 'black';
2853
+ }
2854
+ </script>
2855
+ <div class="canvas"><canvas width="516" height="100" id="canvas-32"></canvas></div>
2856
+ </div>
2857
+
2858
+
2859
+ <h4>Example:<span class="description">When you click the mouse, you create new circle shaped items. When you move the mouse over the item, its fill color is set to red. When you move the mouse outside again, its fill color is set back to black.</span></h4>
2860
+
2861
+ <div class="paperscript split">
2862
+
2863
+ <div class="buttons">
2864
+ <div class="button run">Run</div>
2865
+ </div>
2866
+
2867
+ <script type="text/paperscript" canvas="canvas-33">
2868
+ function enter(event) {
2869
+ this.fillColor = 'red';
2870
+ }
2871
+
2872
+ function leave(event) {
2873
+ this.fillColor = 'black';
2874
+ }
2875
+
2876
+ // When the mouse is pressed:
2877
+ function onMouseDown(event) {
2878
+ // Create a circle shaped path at the position of the mouse:
2879
+ var path = new Path.Circle(event.point, 25);
2880
+ path.fillColor = 'black';
2881
+
2882
+ // When the mouse enters the item, set its fill color to red:
2883
+ path.onMouseEnter = enter;
2884
+
2885
+ // When the mouse leaves the item, set its fill color to black:
2886
+ path.onMouseLeave = leave;
2887
+ }
2888
+ </script>
2889
+ <div class="canvas"><canvas width="516" height="100" id="canvas-33"></canvas></div>
2890
+ </div>
2891
+
2892
+
2893
+ </div>
2894
+
2895
+ </div>
2896
+ </div>
2897
+
2898
+
2899
+ <div id="onmouseleave" class="member">
2900
+ <div class="member-link">
2901
+ <a name="onmouseleave" href="#onmouseleave"><tt><b>onMouseLeave</b></tt></a>
2902
+ </div>
2903
+ <div class="member-description hidden">
2904
+
2905
+ <div class="member-text">
2906
+ <p>The function to be called when the mouse moves out of the item. The function receives a <a href="../classes/MouseEvent.html"><tt>MouseEvent</tt></a> object which contains information about the mouse event. Note that such mouse events bubble up the scene graph hierarchy and will reach the view, unless they are stopped with <a href="../classes/Event.html#stoppropagation"><tt>event.stopPropagation</tt></a>() or by returning <code>false</code> from the handler.</p>
2907
+
2908
+
2909
+
2910
+ <ul class="member-list">
2911
+ <h4>Type:</h4>
2912
+ <li>
2913
+ <tt>Function</tt>⟋<tt>null</tt>
2914
+ </li>
2915
+ </ul>
2916
+
2917
+
2918
+ <ul class="member-list">
2919
+ <h4>See also:</h4>
2920
+
2921
+ <li><tt><a href="../classes/View.html#onmouseleave"><tt>view.onMouseLeave</tt></a></tt></li>
2922
+
2923
+ </ul>
2924
+
2925
+ <h4>Example:<span class="description">Move the mouse over the circle shaped path and then move it out of it again to set its fill color to red:</span></h4>
2926
+
2927
+ <div class="paperscript split">
2928
+
2929
+ <div class="buttons">
2930
+ <div class="button run">Run</div>
2931
+ </div>
2932
+
2933
+ <script type="text/paperscript" canvas="canvas-34">
2934
+ // Create a circle shaped path at the center of the view:
2935
+ var path = new Path.Circle({
2936
+ center: view.center,
2937
+ radius: 25,
2938
+ fillColor: 'black'
2939
+ });
2940
+
2941
+ // When the mouse leaves the item, set its fill color to red:
2942
+ path.onMouseLeave = function(event) {
2943
+ this.fillColor = 'red';
2944
+ }
2945
+ </script>
2946
+ <div class="canvas"><canvas width="516" height="100" id="canvas-34"></canvas></div>
2947
+ </div>
2948
+
2949
+
2950
+ </div>
2951
+
2952
+ </div>
2953
+ </div>
2954
+
2955
+
2956
+ <div id="ondraw" class="member">
2957
+ <div class="member-link">
2958
+ <a name="ondraw" href="#ondraw"><tt><b>onDraw</b></tt></a>
2959
+ </div>
2960
+ <div class="member-description hidden">
2961
+
2962
+ <div class="member-text">
2963
+ <p>The function to be called whenever the item is drawn: in views, in <a href="../classes/Item.html#rasterize"><tt>rasterize</tt></a>(), and once for each placement of a symbol whose definition contains it. It is called right before the item&rsquo;s default drawing, and draws with the canvas API beneath it, or replaces it by returning <code>false</code> or calling <code>event.preventDefault()</code>. The function receives a <a href="../classes/DrawEvent.html"><tt>DrawEvent</tt></a> object with these fields:</p>
2964
+
2965
+
2966
+
2967
+ <ul class="member-list">
2968
+ <h4>Type:</h4>
2969
+ <li>
2970
+ <tt>Function</tt>⟋<tt>null</tt>
2971
+ </li>
2972
+ </ul>
2973
+ <ul class="member-list">
2974
+ <h4>Options:</h4>
2975
+ <li><tt>event.item: <a href="../classes/Item.html"><tt>Item</tt></a></tt> &mdash; the item that is drawn</li>
2976
+ <li><tt>event.context: <tt>CanvasRenderingContext2D</tt></tt> &mdash; the canvas context, transformed into the item&rsquo;s coordinates</li>
2977
+ <li><tt>event.matrix: <a href="../classes/Matrix.html"><tt>Matrix</tt></a></tt> &mdash; the matrix from the item&rsquo;s coordinates to the pixels of the view, without its pixel ratio, for drawing things at a size in pixels</li>
2978
+ <li><tt>event.pixelRatio: <tt>Number</tt></tt> &mdash; the device pixels per pixel: the view&rsquo;s pixel ratio, or the resolution divided by 72 in <a href="../classes/Item.html#rasterize"><tt>rasterize</tt></a>()</li>
2979
+ <li><tt>event.view: <a href="../classes/View.html"><tt>View</tt></a></tt> &mdash; the view drawn into, or <code>null</code> in <a href="../classes/Item.html#rasterize"><tt>rasterize</tt></a>()
2980
+ What the handler draws isn&rsquo;t part of the item&rsquo;s hit testing, its bounds or its SVG export. In buffered groups, it is only called when the group draws its buffer again, see <a href="../classes/Group.html#buffered"><tt>group.buffered</tt></a>.</li>
2981
+ </ul>
2982
+
2983
+ <h4>Example:<span class="description">Draw a hairline cross through the center of a circle, beneath it:</span></h4>
2984
+
2985
+ <div class="paperscript split">
2986
+
2987
+ <div class="buttons">
2988
+ <div class="button run">Run</div>
2989
+ </div>
2990
+
2991
+ <script type="text/paperscript" canvas="canvas-35">
2992
+ var path = new Path.Circle({
2993
+ center: view.center,
2994
+ radius: 25,
2995
+ fillColor: 'rgba(255, 0, 0, 0.5)'
2996
+ });
2997
+
2998
+ path.onDraw = function(event) {
2999
+ var ctx = event.context,
3000
+ center = this.position,
3001
+ scale = event.matrix.scaling.x;
3002
+ ctx.beginPath();
3003
+ ctx.moveTo(center.x - 40, center.y);
3004
+ ctx.lineTo(center.x + 40, center.y);
3005
+ ctx.moveTo(center.x, center.y - 40);
3006
+ ctx.lineTo(center.x, center.y + 40);
3007
+ ctx.lineWidth = 1 / scale;
3008
+ ctx.stroke();
3009
+ }
3010
+ </script>
3011
+ <div class="canvas"><canvas width="516" height="100" id="canvas-35"></canvas></div>
3012
+ </div>
3013
+
3014
+
3015
+ </div>
3016
+
3017
+ </div>
3018
+ </div>
3019
+
3020
+
3021
+ <div id="ondrawselection" class="member">
3022
+ <div class="member-link">
3023
+ <a name="ondrawselection" href="#ondrawselection"><tt><b>onDrawSelection</b></tt></a>
3024
+ </div>
3025
+ <div class="member-description hidden">
3026
+
3027
+ <div class="member-text">
3028
+ <p>The function to be called when the selection of the selected item is drawn, over all the content. It is called right before the item&rsquo;s default selection drawing, and draws with the canvas API beneath it, or replaces it by returning <code>false</code> or calling <code>event.preventDefault()</code>. The function receives a <a href="../classes/DrawEvent.html"><tt>DrawEvent</tt></a> object with these fields:</p>
3029
+
3030
+
3031
+
3032
+ <ul class="member-list">
3033
+ <h4>Type:</h4>
3034
+ <li>
3035
+ <tt>Function</tt>⟋<tt>null</tt>
3036
+ </li>
3037
+ </ul>
3038
+ <ul class="member-list">
3039
+ <h4>Options:</h4>
3040
+ <li><tt>event.item: <a href="../classes/Item.html"><tt>Item</tt></a></tt> &mdash; the selected item</li>
3041
+ <li><tt>event.context: <tt>CanvasRenderingContext2D</tt></tt> &mdash; the canvas context, in the pixels of the view, with the selection color as its <code>strokeStyle</code> and <code>fillStyle</code>, and a <code>lineWidth</code> of 1</li>
3042
+ <li><tt>event.matrix: <a href="../classes/Matrix.html"><tt>Matrix</tt></a></tt> &mdash; the matrix from the item&rsquo;s coordinates to the pixels of the view</li>
3043
+ <li><tt>event.size: <tt>Number</tt></tt> &mdash; the size of the handles, see <a href="../classes/PaperScope.html#settings"><tt>paperScope.settings</tt></a></li>
3044
+ <li><tt>event.color: <a href="../classes/Color.html"><tt>Color</tt></a></tt> &mdash; the selection color, see <a href="../classes/Item.html#selectedcolor"><tt>selectedColor</tt></a></li>
3045
+ <li><tt>event.view: <a href="../classes/View.html"><tt>View</tt></a></tt> &mdash; the view drawn into
3046
+ What the handler draws isn&rsquo;t part of the item&rsquo;s hit testing, its bounds or its SVG export.</li>
3047
+ </ul>
3048
+
3049
+ <h4>Example:<span class="description">Draw the selection of a path as a dot at each segment:</span></h4>
3050
+
3051
+ <div class="paperscript split">
3052
+
3053
+ <div class="buttons">
3054
+ <div class="button run">Run</div>
3055
+ </div>
3056
+
3057
+ <script type="text/paperscript" canvas="canvas-36">
3058
+ var path = new Path.Star({
3059
+ center: view.center,
3060
+ points: 5,
3061
+ radius1: 20,
3062
+ radius2: 40,
3063
+ strokeColor: 'black',
3064
+ selected: true
3065
+ });
3066
+
3067
+ path.onDrawSelection = function(event) {
3068
+ var ctx = event.context;
3069
+ this.segments.forEach(function(segment) {
3070
+ var point = event.matrix.transform(segment.point);
3071
+ ctx.beginPath();
3072
+ ctx.arc(point.x, point.y, event.size, 0, Math.PI * 2);
3073
+ ctx.fill();
3074
+ });
3075
+ return false;
3076
+ }
3077
+ </script>
3078
+ <div class="canvas"><canvas width="516" height="100" id="canvas-36"></canvas></div>
3079
+ </div>
3080
+
3081
+
3082
+ </div>
3083
+
3084
+ </div>
3085
+ </div>
3086
+
3087
+ </div>
3088
+
3089
+
3090
+
3091
+ <div class="reference-members">
3092
+ <h2>Static Properties</h2>
3093
+
3094
+
3095
+ <div id="ondraw" class="member">
3096
+ <div class="member-link">
3097
+ <a name="ondraw" href="#ondraw"><tt><b>Item.onDraw</b></tt></a>
3098
+ </div>
3099
+ <div class="member-description hidden">
3100
+
3101
+ <div class="member-text">
3102
+ <p>The function to be called whenever any item of the class or of its subclasses is drawn, as <a href="../classes/Item.html#ondraw"><tt>onDraw</tt></a> is for a single item, e.g. <code>Path.onDraw</code> for all paths, including the ones created later. The item&rsquo;s own handlers are called first, then the ones of its class and of the classes it inherits from, up to <code>Item</code>, with <code>this</code> set to the item. <code>Path.on(&#39;draw&#39;, handler)</code> and <code>Path.off(&#39;draw&#39;, handler)</code> attach and detach them too. Only the drawing events can be handled for classes of items. Classes are shared by all <a href="../classes/PaperScope.html"><tt>PaperScope</tt></a> objects, and so are their handlers.</p>
3103
+
3104
+
3105
+
3106
+ <ul class="member-list">
3107
+ <h4>Type:</h4>
3108
+ <li>
3109
+ <tt>Function</tt>⟋<tt>null</tt>
3110
+ </li>
3111
+ </ul>
3112
+
3113
+
3114
+
3115
+ </div>
3116
+
3117
+ </div>
3118
+ </div>
3119
+
3120
+
3121
+ <div id="ondrawselection" class="member">
3122
+ <div class="member-link">
3123
+ <a name="ondrawselection" href="#ondrawselection"><tt><b>Item.onDrawSelection</b></tt></a>
3124
+ </div>
3125
+ <div class="member-description hidden">
3126
+
3127
+ <div class="member-text">
3128
+ <p>The function to be called when the selection of any selected item of the class or of its subclasses is drawn, as <a href="../classes/Item.html#ondrawselection"><tt>onDrawSelection</tt></a> is for a single item, e.g. <code>Path.onDrawSelection</code> for all paths, see <a href="../classes/Item.html#ondraw"><tt>Item.onDraw</tt></a>.</p>
3129
+
3130
+
3131
+
3132
+ <ul class="member-list">
3133
+ <h4>Type:</h4>
3134
+ <li>
3135
+ <tt>Function</tt>⟋<tt>null</tt>
3136
+ </li>
3137
+ </ul>
3138
+
3139
+
3140
+
3141
+ </div>
3142
+
3143
+ </div>
3144
+ </div>
3145
+
3146
+ </div>
3147
+
3148
+
3149
+
3150
+ <!-- ============================== methods ================================ -->
3151
+ <div class="reference-members">
3152
+ <h2>Methods</h2>
3153
+
3154
+
3155
+ <div id="addeffect-effect" class="member">
3156
+ <div class="member-link">
3157
+ <a name="addeffect-effect" href="#addeffect-effect"><tt><b>addEffect</b>(effect)</tt></a>
3158
+ </div>
3159
+ <div class="member-description hidden">
3160
+ <div class="member-text">
3161
+ <p>Adds an effect at the end of the item&rsquo;s effects.</p>
3162
+
3163
+
3164
+ <ul class="member-list">
3165
+ <h4>Parameters:</h4>
3166
+
3167
+ <li>
3168
+ <tt>effect:</tt>
3169
+ <tt>Object</tt>
3170
+ &mdash;&nbsp;the plain object describing the effect
3171
+
3172
+ </li>
3173
+
3174
+ </ul>
3175
+
3176
+
3177
+ <ul class="member-list">
3178
+ <h4>Returns:</h4>
3179
+
3180
+ <li>
3181
+ <tt><a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a></tt>&nbsp;&mdash;&nbsp;the added instance
3182
+ </li>
3183
+
3184
+
3185
+ </ul>
3186
+
3187
+
3188
+
3189
+
3190
+
3191
+ </div>
3192
+ </div>
3193
+ </div>
3194
+
3195
+
3196
+ <div id="inserteffect-index-effect" class="member">
3197
+ <div class="member-link">
3198
+ <a name="inserteffect-index-effect" href="#inserteffect-index-effect"><tt><b>insertEffect</b>(index, effect)</tt></a>
3199
+ </div>
3200
+ <div class="member-description hidden">
3201
+ <div class="member-text">
3202
+ <p>Inserts an effect into the item&rsquo;s effects at the given index.</p>
3203
+
3204
+
3205
+ <ul class="member-list">
3206
+ <h4>Parameters:</h4>
3207
+
3208
+ <li>
3209
+ <tt>index:</tt>
3210
+ <tt>Number</tt>
3211
+ &mdash;&nbsp;the index at which to insert the effect
3212
+
3213
+ </li>
3214
+
3215
+ <li>
3216
+ <tt>effect:</tt>
3217
+ <tt>Object</tt>
3218
+ &mdash;&nbsp;the plain object describing the effect
3219
+
3220
+ </li>
3221
+
3222
+ </ul>
3223
+
3224
+
3225
+ <ul class="member-list">
3226
+ <h4>Returns:</h4>
3227
+
3228
+ <li>
3229
+ <tt><a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a></tt>&nbsp;&mdash;&nbsp;the inserted instance
3230
+ </li>
3231
+
3232
+
3233
+ </ul>
3234
+
3235
+
3236
+
3237
+
3238
+
3239
+ </div>
3240
+ </div>
3241
+ </div>
3242
+
3243
+
3244
+ <div id="inserteffects-index-effects" class="member">
3245
+ <div class="member-link">
3246
+ <a name="inserteffects-index-effects" href="#inserteffects-index-effects"><tt><b>insertEffects</b>(index, effects)</tt></a>
3247
+ </div>
3248
+ <div class="member-description hidden">
3249
+ <div class="member-text">
3250
+ <p>Inserts effects into the item&rsquo;s effects at the given index.</p>
3251
+
3252
+
3253
+ <ul class="member-list">
3254
+ <h4>Parameters:</h4>
3255
+
3256
+ <li>
3257
+ <tt>index:</tt>
3258
+ <tt>Number</tt>
3259
+ &mdash;&nbsp;the index at which to insert the effects
3260
+
3261
+ </li>
3262
+
3263
+ <li>
3264
+ <tt>effects:</tt>
3265
+ Array of <tt>Object</tt> objects
3266
+ &mdash;&nbsp;the plain objects describing the effects
3267
+
3268
+ </li>
3269
+
3270
+ </ul>
3271
+
3272
+
3273
+ <ul class="member-list">
3274
+ <h4>Returns:</h4>
3275
+
3276
+ <li>
3277
+ <tt>Array of <a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a> objects</tt>&nbsp;&mdash;&nbsp;the inserted instances
3278
+ </li>
3279
+
3280
+
3281
+ </ul>
2674
3282
 
2675
3283
 
2676
- </div>
2677
3284
 
3285
+
3286
+
2678
3287
  </div>
2679
3288
  </div>
2680
-
2681
-
2682
- <div id="onmouseenter" class="member">
3289
+ </div>
3290
+
3291
+
3292
+ <div id="removeeffect-index" class="member">
2683
3293
  <div class="member-link">
2684
- <a name="onmouseenter" href="#onmouseenter"><tt><b>onMouseEnter</b></tt></a>
3294
+ <a name="removeeffect-index" href="#removeeffect-index"><tt><b>removeEffect</b>(index)</tt></a>
2685
3295
  </div>
2686
3296
  <div class="member-description hidden">
2687
-
2688
3297
  <div class="member-text">
2689
- <p>The function to be called when the mouse moves over the item. This function will only be called again, once the mouse moved outside of the item first. The function receives a <a href="../classes/MouseEvent.html"><tt>MouseEvent</tt></a> object which contains information about the mouse event. Note that such mouse events bubble up the scene graph hierarchy and will reach the view, unless they are stopped with <a href="../classes/Event.html#stoppropagation"><tt>event.stopPropagation</tt></a>() or by returning <code>false</code> from the handler.</p>
3298
+ <p>Removes the effect at the given index from the item&rsquo;s effects.</p>
3299
+
2690
3300
 
3301
+ <ul class="member-list">
3302
+ <h4>Parameters:</h4>
2691
3303
 
3304
+ <li>
3305
+ <tt>index:</tt>
3306
+ <tt>Number</tt>
3307
+ &mdash;&nbsp;the index of the effect to remove
3308
+
3309
+ </li>
2692
3310
 
2693
- <ul class="member-list">
2694
- <h4>Type:</h4>
2695
- <li>
2696
- <tt>Function</tt>⟋<tt>null</tt>
2697
- </li>
2698
- </ul>
2699
-
3311
+ </ul>
3312
+
2700
3313
 
2701
3314
  <ul class="member-list">
2702
- <h4>See also:</h4>
3315
+ <h4>Returns:</h4>
2703
3316
 
2704
- <li><tt><a href="../classes/View.html#onmouseenter"><tt>view.onMouseEnter</tt></a></tt></li>
3317
+ <li>
3318
+ <tt><a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a></tt>&nbsp;&mdash;&nbsp;the removed instance, or <code>null</code>
3319
+ </li>
3320
+
2705
3321
 
2706
3322
  </ul>
2707
3323
 
2708
- <h4>Example:<span class="description">When you move the mouse over the item, its fill color is set to red. When you move the mouse outside again, its fill color is set back to black.</span></h4>
2709
-
2710
- <div class="paperscript split">
2711
-
2712
- <div class="buttons">
2713
- <div class="button run">Run</div>
2714
- </div>
2715
-
2716
- <script type="text/paperscript" canvas="canvas-31">
2717
- // Create a circle shaped path at the center of the view:
2718
- var path = new Path.Circle({
2719
- center: view.center,
2720
- radius: 25,
2721
- fillColor: 'black'
2722
- });
2723
-
2724
- // When the mouse enters the item, set its fill color to red:
2725
- path.onMouseEnter = function(event) {
2726
- this.fillColor = 'red';
2727
- }
2728
-
2729
- // When the mouse leaves the item, set its fill color to black:
2730
- path.onMouseLeave = function(event) {
2731
- this.fillColor = 'black';
2732
- }
2733
- </script>
2734
- <div class="canvas"><canvas width="516" height="100" id="canvas-31"></canvas></div>
2735
- </div>
2736
-
2737
3324
 
2738
- <h4>Example:<span class="description">When you click the mouse, you create new circle shaped items. When you move the mouse over the item, its fill color is set to red. When you move the mouse outside again, its fill color is set back to black.</span></h4>
2739
-
2740
- <div class="paperscript split">
2741
3325
 
2742
- <div class="buttons">
2743
- <div class="button run">Run</div>
3326
+
3327
+
2744
3328
  </div>
2745
-
2746
- <script type="text/paperscript" canvas="canvas-32">
2747
- function enter(event) {
2748
- this.fillColor = 'red';
2749
- }
2750
-
2751
- function leave(event) {
2752
- this.fillColor = 'black';
2753
- }
2754
-
2755
- // When the mouse is pressed:
2756
- function onMouseDown(event) {
2757
- // Create a circle shaped path at the position of the mouse:
2758
- var path = new Path.Circle(event.point, 25);
2759
- path.fillColor = 'black';
2760
-
2761
- // When the mouse enters the item, set its fill color to red:
2762
- path.onMouseEnter = enter;
2763
-
2764
- // When the mouse leaves the item, set its fill color to black:
2765
- path.onMouseLeave = leave;
2766
- }
2767
- </script>
2768
- <div class="canvas"><canvas width="516" height="100" id="canvas-32"></canvas></div>
2769
3329
  </div>
2770
-
2771
-
2772
3330
  </div>
2773
3331
 
2774
- </div>
2775
- </div>
2776
-
2777
-
2778
- <div id="onmouseleave" class="member">
3332
+
3333
+ <div id="removeeffects" class="member">
2779
3334
  <div class="member-link">
2780
- <a name="onmouseleave" href="#onmouseleave"><tt><b>onMouseLeave</b></tt></a>
3335
+ <a name="removeeffects" href="#removeeffects"><tt><b>removeEffects</b>([start[, end]])</tt></a>
2781
3336
  </div>
2782
3337
  <div class="member-description hidden">
2783
-
2784
3338
  <div class="member-text">
2785
- <p>The function to be called when the mouse moves out of the item. The function receives a <a href="../classes/MouseEvent.html"><tt>MouseEvent</tt></a> object which contains information about the mouse event. Note that such mouse events bubble up the scene graph hierarchy and will reach the view, unless they are stopped with <a href="../classes/Event.html#stoppropagation"><tt>event.stopPropagation</tt></a>() or by returning <code>false</code> from the handler.</p>
3339
+ <p>Removes the effects from the start index to the end index from the item&rsquo;s effects, or all of them.</p>
3340
+
3341
+
3342
+ <ul class="member-list">
3343
+ <h4>Parameters:</h4>
2786
3344
 
3345
+ <li>
3346
+ <tt>start:</tt>
3347
+ <tt>Number</tt>
3348
+ &mdash;&nbsp;the index of the first effect to remove
3349
+ &mdash;&nbsp;optional, default: <tt>0</tt>
3350
+ </li>
2787
3351
 
3352
+ <li>
3353
+ <tt>end:</tt>
3354
+ <tt>Number</tt>
3355
+ &mdash;&nbsp;the index after the last one
3356
+ &mdash;&nbsp;optional, default: <tt>effects.length</tt>
3357
+ </li>
2788
3358
 
2789
- <ul class="member-list">
2790
- <h4>Type:</h4>
2791
- <li>
2792
- <tt>Function</tt>⟋<tt>null</tt>
2793
- </li>
2794
- </ul>
2795
-
3359
+ </ul>
3360
+
2796
3361
 
2797
3362
  <ul class="member-list">
2798
- <h4>See also:</h4>
3363
+ <h4>Returns:</h4>
2799
3364
 
2800
- <li><tt><a href="../classes/View.html#onmouseleave"><tt>view.onMouseLeave</tt></a></tt></li>
3365
+ <li>
3366
+ <tt>Array of <a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a> objects</tt>&nbsp;&mdash;&nbsp;the removed instances
3367
+ </li>
3368
+
2801
3369
 
2802
3370
  </ul>
2803
3371
 
2804
- <h4>Example:<span class="description">Move the mouse over the circle shaped path and then move it out of it again to set its fill color to red:</span></h4>
2805
3372
 
2806
- <div class="paperscript split">
2807
3373
 
2808
- <div class="buttons">
2809
- <div class="button run">Run</div>
3374
+
3375
+
2810
3376
  </div>
2811
-
2812
- <script type="text/paperscript" canvas="canvas-33">
2813
- // Create a circle shaped path at the center of the view:
2814
- var path = new Path.Circle({
2815
- center: view.center,
2816
- radius: 25,
2817
- fillColor: 'black'
2818
- });
2819
-
2820
- // When the mouse leaves the item, set its fill color to red:
2821
- path.onMouseLeave = function(event) {
2822
- this.fillColor = 'red';
2823
- }
2824
- </script>
2825
- <div class="canvas"><canvas width="516" height="100" id="canvas-33"></canvas></div>
2826
3377
  </div>
2827
-
2828
-
2829
3378
  </div>
2830
3379
 
3380
+
3381
+ <div id="geteffectoutput" class="member">
3382
+ <div class="member-link">
3383
+ <a name="geteffectoutput" href="#geteffectoutput"><tt><b>getEffectOutput</b>()</tt></a>
2831
3384
  </div>
2832
- </div>
3385
+ <div class="member-description hidden">
3386
+ <div class="member-text">
3387
+ <p>Returns what the item&rsquo;s visible effects make of it, in the item&rsquo;s own coordinates, outside of the scene graph, or <code>null</code> if it has none. It is kept until the item, its content, its effects or the registered effects change, so changing it isn&rsquo;t tracked.</p>
3388
+
3389
+
3390
+
3391
+ <ul class="member-list">
3392
+ <h4>Returns:</h4>
2833
3393
 
2834
- </div>
3394
+ <li>
3395
+ <tt><a href="../classes/Item.html"><tt>Item</tt></a>⟋<tt>null</tt></tt>&nbsp;&mdash;&nbsp;the output of the effects
3396
+ </li>
2835
3397
 
3398
+
3399
+ </ul>
2836
3400
 
2837
3401
 
2838
3402
 
3403
+
3404
+
3405
+ </div>
3406
+ </div>
3407
+ </div>
2839
3408
 
2840
- <!-- ============================== methods ================================ -->
2841
- <div class="reference-members">
2842
- <h2>Methods</h2>
2843
-
2844
3409
 
2845
3410
  <div id="set-props" class="member">
2846
3411
  <div class="member-link">
@@ -2885,7 +3450,7 @@ path.onMouseLeave = function(event) {
2885
3450
  <div class="button run">Run</div>
2886
3451
  </div>
2887
3452
 
2888
- <script type="text/paperscript" canvas="canvas-34">
3453
+ <script type="text/paperscript" canvas="canvas-37">
2889
3454
  var circle = new Path.Circle({
2890
3455
  center: [80, 50],
2891
3456
  radius: 35
@@ -2898,7 +3463,7 @@ circle.set({
2898
3463
  selected: true
2899
3464
  });
2900
3465
  </script>
2901
- <div class="canvas"><canvas width="516" height="100" id="canvas-34"></canvas></div>
3466
+ <div class="canvas"><canvas width="516" height="100" id="canvas-37"></canvas></div>
2902
3467
  </div>
2903
3468
 
2904
3469
 
@@ -2954,7 +3519,7 @@ circle.set({
2954
3519
  <div class="button run">Run</div>
2955
3520
  </div>
2956
3521
 
2957
- <script type="text/paperscript" canvas="canvas-35">
3522
+ <script type="text/paperscript" canvas="canvas-38">
2958
3523
  var circle = new Path.Circle({
2959
3524
  center: [50, 50],
2960
3525
  radius: 10,
@@ -2969,7 +3534,7 @@ for (var i = 0; i < 20; i++) {
2969
3534
  copy.position.x += i * copy.bounds.width;
2970
3535
  }
2971
3536
  </script>
2972
- <div class="canvas"><canvas width="516" height="100" id="canvas-35"></canvas></div>
3537
+ <div class="canvas"><canvas width="516" height="100" id="canvas-38"></canvas></div>
2973
3538
  </div>
2974
3539
 
2975
3540
 
@@ -3095,7 +3660,7 @@ for (var i = 0; i < 20; i++) {
3095
3660
  <div class="button run">Run</div>
3096
3661
  </div>
3097
3662
 
3098
- <script type="text/paperscript" canvas="canvas-36">
3663
+ <script type="text/paperscript" canvas="canvas-39">
3099
3664
  var circle = new Path.Circle({
3100
3665
  center: [50, 50],
3101
3666
  radius: 5,
@@ -3112,7 +3677,7 @@ raster.position.x += 100;
3112
3677
  circle.scale(5);
3113
3678
  raster.scale(5);
3114
3679
  </script>
3115
- <div class="canvas"><canvas width="516" height="100" id="canvas-36"></canvas></div>
3680
+ <div class="canvas"><canvas width="516" height="100" id="canvas-39"></canvas></div>
3116
3681
  </div>
3117
3682
 
3118
3683
 
@@ -3166,7 +3731,7 @@ raster.scale(5);
3166
3731
  <div class="button run">Run</div>
3167
3732
  </div>
3168
3733
 
3169
- <script type="text/paperscript" canvas="canvas-37">
3734
+ <script type="text/paperscript" canvas="canvas-40">
3170
3735
  var path = new Path.Star({
3171
3736
  center: [50, 50],
3172
3737
  points: 12,
@@ -3187,7 +3752,7 @@ function onMouseDown(event) {
3187
3752
  }
3188
3753
  }
3189
3754
  </script>
3190
- <div class="canvas"><canvas width="516" height="100" id="canvas-37"></canvas></div>
3755
+ <div class="canvas"><canvas width="516" height="100" id="canvas-40"></canvas></div>
3191
3756
  </div>
3192
3757
 
3193
3758
 
@@ -3705,11 +4270,17 @@ function onMouseDown(event) {
3705
4270
  </div>
3706
4271
  <div class="member-description hidden">
3707
4272
  <div class="member-text">
3708
- <p>Exports the item with its content and child items as an SVG DOM.</p>
4273
+ <p>Exports the item with its content and child items as an SVG DOM. With <code>options.bounds</code> or <code>options.matrix</code>, the item is wrapped in an <code>&lt;svg&gt;</code> element sized to the bounds, as <a href="../classes/Project.html#exportsvg-options"><tt>project.exportSVG(options)</tt></a> does.</p>
3709
4274
  <ul class="member-list">
3710
4275
  <h4>Options:</h4>
3711
- <li><tt>options.bounds: <tt>String</tt>⟋<a href="../classes/Rectangle.html"><tt>Rectangle</tt></a></tt> &mdash; the bounds of the area to export, either as a string (<tt>&lsquo;view&rsquo;</tt>, <tt>content&rsquo;</tt>), or a <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a> object: <code>&#39;view&#39;</code> uses the view bounds, <code>&#39;content&#39;</code> uses the stroke bounds of all content &mdash;&nbsp;default: <tt>&lsquo;view&rsquo;</tt></li>
3712
- <li><tt>options.matrix: <a href="../classes/Matrix.html"><tt>Matrix</tt></a></tt> &mdash; the matrix with which to transform the exported content: If <code>options.bounds</code> is set to <code>&#39;view&#39;</code>, <code>paper.view.matrix</code> is used, for all other settings of <code>options.bounds</code> the identity matrix is used. &mdash;&nbsp;default: <tt>paper.view.matrix</tt></li>
4276
+ <li>[options.bounds] {String|Rectangle} the bounds of the area to
4277
+ export, either as a string ({@values 'view', content'}), or a
4278
+ {@link Rectangle} object: `'view'` uses the view bounds,
4279
+ `'content'` uses the stroke bounds of the item</li>
4280
+ <li>[options.matrix] {Matrix} the matrix with which to transform the
4281
+ exported content: If `options.bounds` is set to `'view'`,
4282
+ `paper.view.matrix` is used, for all other settings of
4283
+ `options.bounds` the identity matrix is used.</li>
3713
4284
  <li><tt>options.asString: <tt>Boolean</tt></tt> &mdash; whether a SVG node or a <code>String</code> is to be returned &mdash;&nbsp;default: <tt>false</tt></li>
3714
4285
  <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>
3715
4286
  <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>
@@ -3717,6 +4288,12 @@ function onMouseDown(event) {
3717
4288
  <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>
3718
4289
  <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>
3719
4290
  <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>
4291
+ <li>[options.processNode] {Function} the function to process the
4292
+ SVG node made for each exported item, receiving an object with the
4293
+ `item` and its `node`: It can change the node, e.g. to add attributes
4294
+ that Paper.js doesn't export, or return a node to replace it with. It
4295
+ is called before the item's name, style, visibility and data are set
4296
+ on the node, which replace attributes of the same names.</li>
3720
4297
  </ul>
3721
4298
 
3722
4299
  <ul class="member-list">
@@ -3759,6 +4336,7 @@ function onMouseDown(event) {
3759
4336
  <div class="member-text">
3760
4337
  <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>
3761
4338
  <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>
4339
+ <p>The layers in SVG content that Paper.js exported come back as <a href="../classes/Layer.html"><tt>Layer</tt></a> items inside the imported group. To make the layers of a project&rsquo;s SVG the layers of a project again, add them to it with <code>item.children.slice().forEach(project.addLayer, project)</code>.</p>
3762
4340
  <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>
3763
4341
  <ul class="member-list">
3764
4342
  <h4>Options:</h4>
@@ -3770,6 +4348,13 @@ function onMouseDown(event) {
3770
4348
  <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>
3771
4349
  <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>
3772
4350
  <li><tt>options.applyMatrix: <tt>Boolean</tt></tt> &mdash; whether the imported items should have their transformation matrices applied to their contents or not &mdash;&nbsp;default: <tt><a href="../classes/PaperScope.html#settings"><tt>paperScope.settings</tt></a>.applyMatrix</tt></li>
4351
+ <li>[options.processItem] {Function} the function to process the
4352
+ item made for each imported SVG element, receiving an object with
4353
+ the `item` and its `node`: It can read attributes that Paper.js
4354
+ doesn't import, or return an item to replace it with. It is called
4355
+ after the element's attributes and data are applied to the item, so
4356
+ it can extend `item.data`. A replacement item doesn't receive them:
4357
+ copy them over from `item` as needed.</li>
3773
4358
  </ul>
3774
4359
 
3775
4360
  <ul class="member-list">
@@ -5049,7 +5634,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
5049
5634
  <div class="button run">Run</div>
5050
5635
  </div>
5051
5636
 
5052
- <script type="text/paperscript" canvas="canvas-38">
5637
+ <script type="text/paperscript" canvas="canvas-41">
5053
5638
  // Create a rectangle shaped path with its top left
5054
5639
  // point at {x: 80, y: 25} and a size of {width: 50, height: 50}:
5055
5640
  var path = new Path.Rectangle(new Point(80, 25), new Size(50, 50));
@@ -5058,7 +5643,7 @@ path.fillColor = 'black';
5058
5643
  // Rotate the path by 30 degrees:
5059
5644
  path.rotate(30);
5060
5645
  </script>
5061
- <div class="canvas"><canvas width="516" height="100" id="canvas-38"></canvas></div>
5646
+ <div class="canvas"><canvas width="516" height="100" id="canvas-41"></canvas></div>
5062
5647
  </div>
5063
5648
 
5064
5649
 
@@ -5070,7 +5655,7 @@ path.rotate(30);
5070
5655
  <div class="button run">Run</div>
5071
5656
  </div>
5072
5657
 
5073
- <script type="text/paperscript" canvas="canvas-39">
5658
+ <script type="text/paperscript" canvas="canvas-42">
5074
5659
  // Create a rectangle shaped path with its top left
5075
5660
  // point at {x: 175, y: 50} and a size of {width: 100, height: 100}:
5076
5661
  var topLeft = new Point(175, 50);
@@ -5092,7 +5677,7 @@ function onFrame(event) {
5092
5677
  path.rotate(3, view.center);
5093
5678
  }
5094
5679
  </script>
5095
- <div class="canvas"><canvas width="516" height="200" id="canvas-39"></canvas></div>
5680
+ <div class="canvas"><canvas width="516" height="200" id="canvas-42"></canvas></div>
5096
5681
  </div>
5097
5682
 
5098
5683
 
@@ -5141,7 +5726,7 @@ function onFrame(event) {
5141
5726
  <div class="button run">Run</div>
5142
5727
  </div>
5143
5728
 
5144
- <script type="text/paperscript" canvas="canvas-40">
5729
+ <script type="text/paperscript" canvas="canvas-43">
5145
5730
  // Create a circle shaped path at { x: 80, y: 50 }
5146
5731
  // with a radius of 20:
5147
5732
  var circle = new Path.Circle({
@@ -5153,7 +5738,7 @@ var circle = new Path.Circle({
5153
5738
  // Scale the path by 150% from its center point
5154
5739
  circle.scale(1.5);
5155
5740
  </script>
5156
- <div class="canvas"><canvas width="516" height="100" id="canvas-40"></canvas></div>
5741
+ <div class="canvas"><canvas width="516" height="100" id="canvas-43"></canvas></div>
5157
5742
  </div>
5158
5743
 
5159
5744
 
@@ -5165,7 +5750,7 @@ circle.scale(1.5);
5165
5750
  <div class="button run">Run</div>
5166
5751
  </div>
5167
5752
 
5168
- <script type="text/paperscript" canvas="canvas-41">
5753
+ <script type="text/paperscript" canvas="canvas-44">
5169
5754
  // Create a circle shaped path at { x: 80, y: 50 }
5170
5755
  // with a radius of 20:
5171
5756
  var circle = new Path.Circle({
@@ -5177,7 +5762,7 @@ var circle = new Path.Circle({
5177
5762
  // Scale the path 150% from its bottom left corner
5178
5763
  circle.scale(1.5, circle.bounds.bottomLeft);
5179
5764
  </script>
5180
- <div class="canvas"><canvas width="516" height="100" id="canvas-41"></canvas></div>
5765
+ <div class="canvas"><canvas width="516" height="100" id="canvas-44"></canvas></div>
5181
5766
  </div>
5182
5767
 
5183
5768
 
@@ -5233,7 +5818,7 @@ circle.scale(1.5, circle.bounds.bottomLeft);
5233
5818
  <div class="button run">Run</div>
5234
5819
  </div>
5235
5820
 
5236
- <script type="text/paperscript" canvas="canvas-42">
5821
+ <script type="text/paperscript" canvas="canvas-45">
5237
5822
  // Create a circle shaped path at { x: 100, y: 50 }
5238
5823
  // with a radius of 20:
5239
5824
  var circle = new Path.Circle({
@@ -5245,7 +5830,7 @@ var circle = new Path.Circle({
5245
5830
  // Scale the path horizontally by 300%
5246
5831
  circle.scale(3, 1);
5247
5832
  </script>
5248
- <div class="canvas"><canvas width="516" height="100" id="canvas-42"></canvas></div>
5833
+ <div class="canvas"><canvas width="516" height="100" id="canvas-45"></canvas></div>
5249
5834
  </div>
5250
5835
 
5251
5836
 
@@ -5683,7 +6268,7 @@ circle.scale(3, 1);
5683
6268
  <div class="button run">Run</div>
5684
6269
  </div>
5685
6270
 
5686
- <script type="text/paperscript" canvas="canvas-43">
6271
+ <script type="text/paperscript" canvas="canvas-46">
5687
6272
  // Create a rectangle shaped path with its top left corner
5688
6273
  // at {x: 80, y: 25} and a size of {width: 75, height: 50}:
5689
6274
  var path = new Path.Rectangle({
@@ -5704,7 +6289,7 @@ var circlePath = new Path.Circle({
5704
6289
  // the rectangular path:
5705
6290
  circlePath.fitBounds(path.bounds);
5706
6291
  </script>
5707
- <div class="canvas"><canvas width="516" height="100" id="canvas-43"></canvas></div>
6292
+ <div class="canvas"><canvas width="516" height="100" id="canvas-46"></canvas></div>
5708
6293
  </div>
5709
6294
 
5710
6295
 
@@ -5716,7 +6301,7 @@ circlePath.fitBounds(path.bounds);
5716
6301
  <div class="button run">Run</div>
5717
6302
  </div>
5718
6303
 
5719
- <script type="text/paperscript" canvas="canvas-44">
6304
+ <script type="text/paperscript" canvas="canvas-47">
5720
6305
  // Create a rectangle shaped path with its top left corner
5721
6306
  // at {x: 80, y: 25} and a size of {width: 75, height: 50}:
5722
6307
  var path = new Path.Rectangle({
@@ -5737,7 +6322,7 @@ var circlePath = new Path.Circle({
5737
6322
  // the rectangular path:
5738
6323
  circlePath.fitBounds(path.bounds, 'cover');
5739
6324
  </script>
5740
- <div class="canvas"><canvas width="516" height="100" id="canvas-44"></canvas></div>
6325
+ <div class="canvas"><canvas width="516" height="100" id="canvas-47"></canvas></div>
5741
6326
  </div>
5742
6327
 
5743
6328
 
@@ -5749,7 +6334,7 @@ circlePath.fitBounds(path.bounds, 'cover');
5749
6334
  <div class="button run">Run</div>
5750
6335
  </div>
5751
6336
 
5752
- <script type="text/paperscript" canvas="canvas-45">
6337
+ <script type="text/paperscript" canvas="canvas-48">
5753
6338
  var path = new Path.Circle({
5754
6339
  center: [80, 50],
5755
6340
  radius: 30,
@@ -5759,7 +6344,7 @@ var path = new Path.Circle({
5759
6344
  // Fit the path to the bounding rectangle of the view:
5760
6345
  path.fitBounds(view.bounds);
5761
6346
  </script>
5762
- <div class="canvas"><canvas width="516" height="200" id="canvas-45"></canvas></div>
6347
+ <div class="canvas"><canvas width="516" height="200" id="canvas-48"></canvas></div>
5763
6348
  </div>
5764
6349
 
5765
6350
 
@@ -5785,7 +6370,7 @@ path.fitBounds(view.bounds);
5785
6370
  <li>
5786
6371
  <tt>type:</tt>
5787
6372
  <tt>String</tt>
5788
- &mdash;&nbsp;the type of event: <tt>&lsquo;frame&rsquo;</tt>, <tt>mousedown&rsquo;</tt>, <tt>&lsquo;mouseup&rsquo;</tt>, <tt>&lsquo;mousedrag&rsquo;</tt>, <tt>&lsquo;click&rsquo;</tt>, <tt>&lsquo;doubleclick&rsquo;</tt>, <tt>&lsquo;mousemove&rsquo;</tt>, <tt>&lsquo;mouseenter&rsquo;</tt>, <tt>&lsquo;mouseleave&rsquo;</tt>
6373
+ &mdash;&nbsp;the type of event: <tt>&lsquo;frame&rsquo;</tt>, <tt>mousedown&rsquo;</tt>, <tt>&lsquo;mouseup&rsquo;</tt>, <tt>&lsquo;mousedrag&rsquo;</tt>, <tt>&lsquo;click&rsquo;</tt>, <tt>&lsquo;doubleclick&rsquo;</tt>, <tt>&lsquo;mousemove&rsquo;</tt>, <tt>&lsquo;mouseenter&rsquo;</tt>, <tt>&lsquo;mouseleave&rsquo;</tt>, <tt>&lsquo;draw&rsquo;</tt>, <tt>&lsquo;drawselection&rsquo;</tt>
5789
6374
 
5790
6375
  </li>
5791
6376
 
@@ -5820,7 +6405,7 @@ path.fitBounds(view.bounds);
5820
6405
  <div class="button run">Run</div>
5821
6406
  </div>
5822
6407
 
5823
- <script type="text/paperscript" canvas="canvas-46">
6408
+ <script type="text/paperscript" canvas="canvas-49">
5824
6409
  // Create a circle shaped path at the center of the view:
5825
6410
  var path = new Path.Circle({
5826
6411
  center: view.center,
@@ -5838,7 +6423,7 @@ path.on('mouseleave', function() {
5838
6423
  this.fillColor = 'black';
5839
6424
  });
5840
6425
  </script>
5841
- <div class="canvas"><canvas width="516" height="100" id="canvas-46"></canvas></div>
6426
+ <div class="canvas"><canvas width="516" height="100" id="canvas-49"></canvas></div>
5842
6427
  </div>
5843
6428
 
5844
6429
 
@@ -5862,7 +6447,7 @@ path.on('mouseleave', function() {
5862
6447
  <li>
5863
6448
  <tt>object:</tt>
5864
6449
  <tt>Object</tt>
5865
- &mdash;&nbsp;an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
6450
+ &mdash;&nbsp;an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>, <tt>draw</tt>, <tt>drawselection</tt>
5866
6451
 
5867
6452
  </li>
5868
6453
 
@@ -5890,7 +6475,7 @@ path.on('mouseleave', function() {
5890
6475
  <div class="button run">Run</div>
5891
6476
  </div>
5892
6477
 
5893
- <script type="text/paperscript" canvas="canvas-47">
6478
+ <script type="text/paperscript" canvas="canvas-50">
5894
6479
  // Create a circle shaped path at the center of the view:
5895
6480
  var path = new Path.Circle({
5896
6481
  center: view.center,
@@ -5908,7 +6493,7 @@ path.on({
5908
6493
  }
5909
6494
  });
5910
6495
  </script>
5911
- <div class="canvas"><canvas width="516" height="100" id="canvas-47"></canvas></div>
6496
+ <div class="canvas"><canvas width="516" height="100" id="canvas-50"></canvas></div>
5912
6497
  </div>
5913
6498
 
5914
6499
 
@@ -5920,7 +6505,7 @@ path.on({
5920
6505
  <div class="button run">Run</div>
5921
6506
  </div>
5922
6507
 
5923
- <script type="text/paperscript" canvas="canvas-48">
6508
+ <script type="text/paperscript" canvas="canvas-51">
5924
6509
  var pathHandlers = {
5925
6510
  mouseenter: function(event) {
5926
6511
  this.fillColor = 'red';
@@ -5943,7 +6528,7 @@ function onMouseDown(event) {
5943
6528
  path.on(pathHandlers);
5944
6529
  }
5945
6530
  </script>
5946
- <div class="canvas"><canvas width="516" height="100" id="canvas-48"></canvas></div>
6531
+ <div class="canvas"><canvas width="516" height="100" id="canvas-51"></canvas></div>
5947
6532
  </div>
5948
6533
 
5949
6534
 
@@ -5967,7 +6552,7 @@ function onMouseDown(event) {
5967
6552
  <li>
5968
6553
  <tt>type:</tt>
5969
6554
  <tt>String</tt>
5970
- &mdash;&nbsp;the type of event: <tt>&lsquo;frame&rsquo;</tt>, <tt>mousedown&rsquo;</tt>, <tt>&lsquo;mouseup&rsquo;</tt>, <tt>&lsquo;mousedrag&rsquo;</tt>, <tt>&lsquo;click&rsquo;</tt>, <tt>&lsquo;doubleclick&rsquo;</tt>, <tt>&lsquo;mousemove&rsquo;</tt>, <tt>&lsquo;mouseenter&rsquo;</tt>, <tt>&lsquo;mouseleave&rsquo;</tt>
6555
+ &mdash;&nbsp;the type of event: <tt>&lsquo;frame&rsquo;</tt>, <tt>mousedown&rsquo;</tt>, <tt>&lsquo;mouseup&rsquo;</tt>, <tt>&lsquo;mousedrag&rsquo;</tt>, <tt>&lsquo;click&rsquo;</tt>, <tt>&lsquo;doubleclick&rsquo;</tt>, <tt>&lsquo;mousemove&rsquo;</tt>, <tt>&lsquo;mouseenter&rsquo;</tt>, <tt>&lsquo;mouseleave&rsquo;</tt>, <tt>&lsquo;draw&rsquo;</tt>, <tt>&lsquo;drawselection&rsquo;</tt>
5971
6556
 
5972
6557
  </li>
5973
6558
 
@@ -6015,7 +6600,7 @@ function onMouseDown(event) {
6015
6600
  <li>
6016
6601
  <tt>object:</tt>
6017
6602
  <tt>Object</tt>
6018
- &mdash;&nbsp;an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
6603
+ &mdash;&nbsp;an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>, <tt>draw</tt>, <tt>drawselection</tt>
6019
6604
 
6020
6605
  </li>
6021
6606
 
@@ -6056,7 +6641,7 @@ function onMouseDown(event) {
6056
6641
  <li>
6057
6642
  <tt>type:</tt>
6058
6643
  <tt>String</tt>
6059
- &mdash;&nbsp;the type of event: <tt>&lsquo;frame&rsquo;</tt>, <tt>mousedown&rsquo;</tt>, <tt>&lsquo;mouseup&rsquo;</tt>, <tt>&lsquo;mousedrag&rsquo;</tt>, <tt>&lsquo;click&rsquo;</tt>, <tt>&lsquo;doubleclick&rsquo;</tt>, <tt>&lsquo;mousemove&rsquo;</tt>, <tt>&lsquo;mouseenter&rsquo;</tt>, <tt>&lsquo;mouseleave&rsquo;</tt>
6644
+ &mdash;&nbsp;the type of event: <tt>&lsquo;frame&rsquo;</tt>, <tt>mousedown&rsquo;</tt>, <tt>&lsquo;mouseup&rsquo;</tt>, <tt>&lsquo;mousedrag&rsquo;</tt>, <tt>&lsquo;click&rsquo;</tt>, <tt>&lsquo;doubleclick&rsquo;</tt>, <tt>&lsquo;mousemove&rsquo;</tt>, <tt>&lsquo;mouseenter&rsquo;</tt>, <tt>&lsquo;mouseleave&rsquo;</tt>, <tt>&lsquo;draw&rsquo;</tt>, <tt>&lsquo;drawselection&rsquo;</tt>
6060
6645
 
6061
6646
  </li>
6062
6647
 
@@ -6104,7 +6689,7 @@ function onMouseDown(event) {
6104
6689
  <li>
6105
6690
  <tt>type:</tt>
6106
6691
  <tt>String</tt>
6107
- &mdash;&nbsp;the type of event: <tt>&lsquo;frame&rsquo;</tt>, <tt>mousedown&rsquo;</tt>, <tt>&lsquo;mouseup&rsquo;</tt>, <tt>&lsquo;mousedrag&rsquo;</tt>, <tt>&lsquo;click&rsquo;</tt>, <tt>&lsquo;doubleclick&rsquo;</tt>, <tt>&lsquo;mousemove&rsquo;</tt>, <tt>&lsquo;mouseenter&rsquo;</tt>, <tt>&lsquo;mouseleave&rsquo;</tt>
6692
+ &mdash;&nbsp;the type of event: <tt>&lsquo;frame&rsquo;</tt>, <tt>mousedown&rsquo;</tt>, <tt>&lsquo;mouseup&rsquo;</tt>, <tt>&lsquo;mousedrag&rsquo;</tt>, <tt>&lsquo;click&rsquo;</tt>, <tt>&lsquo;doubleclick&rsquo;</tt>, <tt>&lsquo;mousemove&rsquo;</tt>, <tt>&lsquo;mouseenter&rsquo;</tt>, <tt>&lsquo;mouseleave&rsquo;</tt>, <tt>&lsquo;draw&rsquo;</tt>, <tt>&lsquo;drawselection&rsquo;</tt>
6108
6693
 
6109
6694
  </li>
6110
6695
 
@@ -6171,7 +6756,7 @@ function onMouseDown(event) {
6171
6756
  <div class="button run">Run</div>
6172
6757
  </div>
6173
6758
 
6174
- <script type="text/paperscript" canvas="canvas-49">
6759
+ <script type="text/paperscript" canvas="canvas-52">
6175
6760
  function onMouseDrag(event) {
6176
6761
  // Create a circle shaped path at the mouse position,
6177
6762
  // with a radius of 10:
@@ -6188,7 +6773,7 @@ function onMouseDrag(event) {
6188
6773
  });
6189
6774
  }
6190
6775
  </script>
6191
- <div class="canvas"><canvas width="516" height="200" id="canvas-49"></canvas></div>
6776
+ <div class="canvas"><canvas width="516" height="200" id="canvas-52"></canvas></div>
6192
6777
  </div>
6193
6778
 
6194
6779
 
@@ -6218,7 +6803,7 @@ function onMouseDrag(event) {
6218
6803
  <div class="button run">Run</div>
6219
6804
  </div>
6220
6805
 
6221
- <script type="text/paperscript" canvas="canvas-50">
6806
+ <script type="text/paperscript" canvas="canvas-53">
6222
6807
  function onMouseMove(event) {
6223
6808
  // Create a circle shaped path at the mouse position,
6224
6809
  // with a radius of 10:
@@ -6232,7 +6817,7 @@ function onMouseMove(event) {
6232
6817
  path.removeOnMove();
6233
6818
  }
6234
6819
  </script>
6235
- <div class="canvas"><canvas width="516" height="200" id="canvas-50"></canvas></div>
6820
+ <div class="canvas"><canvas width="516" height="200" id="canvas-53"></canvas></div>
6236
6821
  </div>
6237
6822
 
6238
6823
 
@@ -6262,7 +6847,7 @@ function onMouseMove(event) {
6262
6847
  <div class="button run">Run</div>
6263
6848
  </div>
6264
6849
 
6265
- <script type="text/paperscript" canvas="canvas-51">
6850
+ <script type="text/paperscript" canvas="canvas-54">
6266
6851
  function onMouseDown(event) {
6267
6852
  // Create a circle shaped path at the mouse position,
6268
6853
  // with a radius of 10:
@@ -6276,7 +6861,7 @@ function onMouseDown(event) {
6276
6861
  path.removeOnDown();
6277
6862
  }
6278
6863
  </script>
6279
- <div class="canvas"><canvas width="516" height="200" id="canvas-51"></canvas></div>
6864
+ <div class="canvas"><canvas width="516" height="200" id="canvas-54"></canvas></div>
6280
6865
  </div>
6281
6866
 
6282
6867
 
@@ -6306,7 +6891,7 @@ function onMouseDown(event) {
6306
6891
  <div class="button run">Run</div>
6307
6892
  </div>
6308
6893
 
6309
- <script type="text/paperscript" canvas="canvas-52">
6894
+ <script type="text/paperscript" canvas="canvas-55">
6310
6895
  function onMouseDrag(event) {
6311
6896
  // Create a circle shaped path at the mouse position,
6312
6897
  // with a radius of 10:
@@ -6320,7 +6905,7 @@ function onMouseDrag(event) {
6320
6905
  path.removeOnDrag();
6321
6906
  }
6322
6907
  </script>
6323
- <div class="canvas"><canvas width="516" height="200" id="canvas-52"></canvas></div>
6908
+ <div class="canvas"><canvas width="516" height="200" id="canvas-55"></canvas></div>
6324
6909
  </div>
6325
6910
 
6326
6911
 
@@ -6350,7 +6935,7 @@ function onMouseDrag(event) {
6350
6935
  <div class="button run">Run</div>
6351
6936
  </div>
6352
6937
 
6353
- <script type="text/paperscript" canvas="canvas-53">
6938
+ <script type="text/paperscript" canvas="canvas-56">
6354
6939
  function onMouseDown(event) {
6355
6940
  // Create a circle shaped path at the mouse position,
6356
6941
  // with a radius of 10:
@@ -6364,7 +6949,7 @@ function onMouseDown(event) {
6364
6949
  path.removeOnUp();
6365
6950
  }
6366
6951
  </script>
6367
- <div class="canvas"><canvas width="516" height="200" id="canvas-53"></canvas></div>
6952
+ <div class="canvas"><canvas width="516" height="200" id="canvas-56"></canvas></div>
6368
6953
  </div>
6369
6954
 
6370
6955
 
@@ -6437,7 +7022,7 @@ function onMouseDown(event) {
6437
7022
  <div class="button run">Run</div>
6438
7023
  </div>
6439
7024
 
6440
- <script type="text/paperscript" canvas="canvas-54">
7025
+ <script type="text/paperscript" canvas="canvas-57">
6441
7026
  var path = new Path.Circle({
6442
7027
  radius: view.bounds.height * 0.4,
6443
7028
  center: view.center
@@ -6448,7 +7033,7 @@ path.tween(
6448
7033
  3000
6449
7034
  );
6450
7035
  </script>
6451
- <div class="canvas"><canvas width="516" height="100" id="canvas-54"></canvas></div>
7036
+ <div class="canvas"><canvas width="516" height="100" id="canvas-57"></canvas></div>
6452
7037
  </div>
6453
7038
 
6454
7039
 
@@ -6460,7 +7045,7 @@ path.tween(
6460
7045
  <div class="button run">Run</div>
6461
7046
  </div>
6462
7047
 
6463
- <script type="text/paperscript" canvas="canvas-55">
7048
+ <script type="text/paperscript" canvas="canvas-58">
6464
7049
  var path = new Shape.Rectangle({
6465
7050
  fillColor: 'red',
6466
7051
  center: [50, view.center.y],
@@ -6475,7 +7060,7 @@ path.tween({
6475
7060
  duration: 2000
6476
7061
  });
6477
7062
  </script>
6478
- <div class="canvas"><canvas width="516" height="100" id="canvas-55"></canvas></div>
7063
+ <div class="canvas"><canvas width="516" height="100" id="canvas-58"></canvas></div>
6479
7064
  </div>
6480
7065
 
6481
7066
 
@@ -6541,7 +7126,7 @@ path.tween({
6541
7126
  <div class="button run">Run</div>
6542
7127
  </div>
6543
7128
 
6544
- <script type="text/paperscript" canvas="canvas-56">
7129
+ <script type="text/paperscript" canvas="canvas-59">
6545
7130
  var path = new Path.Rectangle({
6546
7131
  size: [100, 100],
6547
7132
  position: view.center,
@@ -6555,7 +7140,7 @@ path.tween({
6555
7140
  'segments[2].point.x': '-= 50'
6556
7141
  }, 3000);
6557
7142
  </script>
6558
- <div class="canvas"><canvas width="516" height="200" id="canvas-56"></canvas></div>
7143
+ <div class="canvas"><canvas width="516" height="200" id="canvas-59"></canvas></div>
6559
7144
  </div>
6560
7145
 
6561
7146
 
@@ -6614,7 +7199,7 @@ path.tween({
6614
7199
  <div class="button run">Run</div>
6615
7200
  </div>
6616
7201
 
6617
- <script type="text/paperscript" canvas="canvas-57">
7202
+ <script type="text/paperscript" canvas="canvas-60">
6618
7203
  var path = new Path.Circle({
6619
7204
  fillColor: 'blue',
6620
7205
  radius: view.bounds.height * 0.4,
@@ -6630,7 +7215,7 @@ path.tween(2000).onUpdate = function(event) {
6630
7215
  path.interpolate(pathFrom, pathTo, event.factor)
6631
7216
  };
6632
7217
  </script>
6633
- <div class="canvas"><canvas width="516" height="100" id="canvas-57"></canvas></div>
7218
+ <div class="canvas"><canvas width="516" height="100" id="canvas-60"></canvas></div>
6634
7219
  </div>
6635
7220
 
6636
7221
 
@@ -6751,7 +7336,7 @@ path.tween(2000).onUpdate = function(event) {
6751
7336
  <div class="button run">Run</div>
6752
7337
  </div>
6753
7338
 
6754
- <script type="text/paperscript" canvas="canvas-58">
7339
+ <script type="text/paperscript" canvas="canvas-61">
6755
7340
  var path = new Path.Circle({
6756
7341
  fillColor: 'blue',
6757
7342
  radius: view.bounds.height * 0.4,
@@ -6759,7 +7344,7 @@ var path = new Path.Circle({
6759
7344
  });
6760
7345
  path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
6761
7346
  </script>
6762
- <div class="canvas"><canvas width="516" height="100" id="canvas-58"></canvas></div>
7347
+ <div class="canvas"><canvas width="516" height="100" id="canvas-61"></canvas></div>
6763
7348
  </div>
6764
7349
 
6765
7350
 
@@ -6833,7 +7418,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
6833
7418
 
6834
7419
  <!-- =========================== copyright notice ========================== -->
6835
7420
  <p class="footer">
6836
- Paper.js v0.15.0<br>
7421
+ Paper.js v0.17.0<br>
6837
7422
  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>
6838
7423
  <div class="content-end"></div>
6839
7424