paper 0.16.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 (63) hide show
  1. package/CHANGELOG.md +95 -0
  2. package/dist/docs/assets/js/paper.js +4565 -733
  3. package/dist/docs/classes/AreaText.html +720 -242
  4. package/dist/docs/classes/ChangeFlag.html +1 -1
  5. package/dist/docs/classes/Color.html +218 -21
  6. package/dist/docs/classes/CompoundPath.html +1146 -296
  7. package/dist/docs/classes/Curve.html +1 -1
  8. package/dist/docs/classes/CurveLocation.html +1 -1
  9. package/dist/docs/classes/DrawEvent.html +69 -0
  10. package/dist/docs/classes/Effect.html +434 -0
  11. package/dist/docs/classes/EffectInstance.html +304 -0
  12. package/dist/docs/classes/Event.html +1 -1
  13. package/dist/docs/classes/Gradient.html +1 -1
  14. package/dist/docs/classes/GradientStop.html +1 -1
  15. package/dist/docs/classes/Group.html +792 -243
  16. package/dist/docs/classes/HitResult.html +1 -1
  17. package/dist/docs/classes/HostItem.html +720 -242
  18. package/dist/docs/classes/Item.html +777 -242
  19. package/dist/docs/classes/Key.html +1 -1
  20. package/dist/docs/classes/KeyEvent.html +1 -1
  21. package/dist/docs/classes/Layer.html +734 -185
  22. package/dist/docs/classes/Matrix.html +1 -1
  23. package/dist/docs/classes/MouseEvent.html +1 -1
  24. package/dist/docs/classes/PaperScope.html +1 -1
  25. package/dist/docs/classes/PaperScript.html +4 -2
  26. package/dist/docs/classes/Path.html +1195 -252
  27. package/dist/docs/classes/PathItem.html +1148 -298
  28. package/dist/docs/classes/PathText.html +720 -242
  29. package/dist/docs/classes/PatternDefinition.html +367 -0
  30. package/dist/docs/classes/Point.html +1 -1
  31. package/dist/docs/classes/PointText.html +720 -242
  32. package/dist/docs/classes/Project.html +177 -7
  33. package/dist/docs/classes/Raster.html +720 -242
  34. package/dist/docs/classes/Rectangle.html +1 -1
  35. package/dist/docs/classes/Segment.html +3 -3
  36. package/dist/docs/classes/Shape.html +720 -242
  37. package/dist/docs/classes/Size.html +1 -1
  38. package/dist/docs/classes/StrokeProfileStop.html +346 -0
  39. package/dist/docs/classes/Style.html +1 -1
  40. package/dist/docs/classes/SymbolDefinition.html +28 -2
  41. package/dist/docs/classes/SymbolItem.html +720 -242
  42. package/dist/docs/classes/TextItem.html +720 -242
  43. package/dist/docs/classes/TextRange.html +1 -1
  44. package/dist/docs/classes/TextStory.html +1 -1
  45. package/dist/docs/classes/Tool.html +2 -2
  46. package/dist/docs/classes/ToolEvent.html +1 -1
  47. package/dist/docs/classes/Tween.html +1 -1
  48. package/dist/docs/classes/View.html +2 -2
  49. package/dist/docs/classes/global.html +1 -1
  50. package/dist/docs/classes/index.html +2 -2
  51. package/dist/docs/index.html +1 -1
  52. package/dist/node/browser.js +15 -0
  53. package/dist/paper-core.js +4476 -674
  54. package/dist/paper-core.min.js +3 -3
  55. package/dist/paper-full.js +4565 -733
  56. package/dist/paper-full.min.js +3 -3
  57. package/dist/paper-hosted.js +5111 -823
  58. package/dist/paper.d.ts +898 -47
  59. package/examples/Paperjs.org/LiveEffects.html +366 -0
  60. package/examples/Paperjs.org/Offsetting.html +379 -0
  61. package/examples/Paperjs.org/StrokeProfiles.html +706 -0
  62. package/examples/Scripts/Patterns.html +57 -0
  63. package/package.json +5 -3
@@ -195,6 +195,91 @@ var text = new PointText({
195
195
  <div class="reference-members"><h2>Properties inherited from <a href="../classes/Item.html"><tt>Item</tt></a></h2>
196
196
 
197
197
 
198
+ <div id="effects" class="member">
199
+ <div class="member-link">
200
+ <a name="effects" href="#effects"><tt><b>effects</b></tt></a>
201
+ </div>
202
+ <div class="member-description hidden">
203
+
204
+ <div class="member-text">
205
+ <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,
206
+ 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>
207
+ <p>Paper.js has these effects, and <a href="../classes/Effect.html"><tt>Effect</tt></a> creates more:</p>
208
+ <ul>
209
+ <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>
210
+ <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>
211
+ </ul>
212
+
213
+
214
+
215
+ <ul class="member-list">
216
+ <h4>Type:</h4>
217
+ <li>
218
+ Array of <a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a> objects
219
+ </li>
220
+ </ul>
221
+
222
+
223
+ <h4>Example:</h4>
224
+
225
+ <div class="paperscript split">
226
+
227
+ <div class="buttons">
228
+ <div class="button run">Run</div>
229
+ </div>
230
+
231
+ <script type="text/paperscript" canvas="canvas-2">
232
+ var path = new Path.Star({
233
+ center: view.center,
234
+ points: 5,
235
+ radius1: 20,
236
+ radius2: 40,
237
+ strokeColor: 'black',
238
+ strokeWidth: 8
239
+ });
240
+ path.effects = [
241
+ { type: 'offset', parameters: { distance: 10, join: 'round' } },
242
+ { type: 'outline' }
243
+ ];
244
+ </script>
245
+ <div class="canvas"><canvas width="516" height="100" id="canvas-2"></canvas></div>
246
+ </div>
247
+
248
+
249
+ </div>
250
+
251
+ </div>
252
+ </div>
253
+
254
+
255
+ <div id="previewbounds-matrix" class="member">
256
+ <div class="member-link">
257
+ <a name="previewbounds-matrix" href="#previewbounds-matrix"><tt><b>previewBounds</b></tt></a>
258
+ </div>
259
+ <div class="member-description hidden">
260
+
261
+ <div class="member-text">
262
+ <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>
263
+
264
+ <p>Read only.</p>
265
+
266
+
267
+
268
+ <ul class="member-list">
269
+ <h4>Type:</h4>
270
+ <li>
271
+ <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
272
+ </li>
273
+ </ul>
274
+
275
+
276
+
277
+ </div>
278
+
279
+ </div>
280
+ </div>
281
+
282
+
198
283
  <div id="key" class="member">
199
284
  <div class="member-link">
200
285
  <a name="key" href="#key"><tt><b>key</b></tt></a>
@@ -307,7 +392,7 @@ var text = new PointText({
307
392
  <div class="button run">Run</div>
308
393
  </div>
309
394
 
310
- <script type="text/paperscript" canvas="canvas-2">
395
+ <script type="text/paperscript" canvas="canvas-3">
311
396
  var path = new Path.Circle({
312
397
  center: [80, 50],
313
398
  radius: 35
@@ -322,7 +407,7 @@ group.addChild(path);
322
407
  // The path can be accessed by name:
323
408
  group.children['example'].fillColor = 'red';
324
409
  </script>
325
- <div class="canvas"><canvas width="516" height="100" id="canvas-2"></canvas></div>
410
+ <div class="canvas"><canvas width="516" height="100" id="canvas-3"></canvas></div>
326
411
  </div>
327
412
 
328
413
 
@@ -360,7 +445,7 @@ group.children['example'].fillColor = 'red';
360
445
  <div class="button run">Run</div>
361
446
  </div>
362
447
 
363
- <script type="text/paperscript" canvas="canvas-3">
448
+ <script type="text/paperscript" canvas="canvas-4">
364
449
  var circle = new Path.Circle({
365
450
  center: [80, 50],
366
451
  radius: 30
@@ -371,7 +456,7 @@ circle.style = {
371
456
  strokeWidth: 5
372
457
  };
373
458
  </script>
374
- <div class="canvas"><canvas width="516" height="100" id="canvas-3"></canvas></div>
459
+ <div class="canvas"><canvas width="516" height="100" id="canvas-4"></canvas></div>
375
460
  </div>
376
461
 
377
462
 
@@ -383,7 +468,7 @@ circle.style = {
383
468
  <div class="button run">Run</div>
384
469
  </div>
385
470
 
386
- <script type="text/paperscript" canvas="canvas-4">
471
+ <script type="text/paperscript" canvas="canvas-5">
387
472
  var path = new Path.Circle({
388
473
  center: [50, 50],
389
474
  radius: 30,
@@ -398,7 +483,7 @@ var path2 = new Path.Circle({
398
483
  // Copy the path style of path:
399
484
  path2.style = path.style;
400
485
  </script>
401
- <div class="canvas"><canvas width="516" height="100" id="canvas-4"></canvas></div>
486
+ <div class="canvas"><canvas width="516" height="100" id="canvas-5"></canvas></div>
402
487
  </div>
403
488
 
404
489
 
@@ -410,7 +495,7 @@ path2.style = path.style;
410
495
  <div class="button run">Run</div>
411
496
  </div>
412
497
 
413
- <script type="text/paperscript" canvas="canvas-5">
498
+ <script type="text/paperscript" canvas="canvas-6">
414
499
  var myStyle = {
415
500
  fillColor: 'red',
416
501
  strokeColor: 'blue',
@@ -429,7 +514,7 @@ var path2 = new Path.Circle({
429
514
  });
430
515
  path2.style = myStyle;
431
516
  </script>
432
- <div class="canvas"><canvas width="516" height="100" id="canvas-5"></canvas></div>
517
+ <div class="canvas"><canvas width="516" height="100" id="canvas-6"></canvas></div>
433
518
  </div>
434
519
 
435
520
 
@@ -471,7 +556,7 @@ path2.style = myStyle;
471
556
  <div class="button run">Run</div>
472
557
  </div>
473
558
 
474
- <script type="text/paperscript" canvas="canvas-6">
559
+ <script type="text/paperscript" canvas="canvas-7">
475
560
  var unlockedItem = new Path.Circle({
476
561
  center: view.center - [35, 0],
477
562
  radius: 30,
@@ -498,7 +583,7 @@ new PointText({
498
583
  justification: 'center'
499
584
  });
500
585
  </script>
501
- <div class="canvas"><canvas width="516" height="100" id="canvas-6"></canvas></div>
586
+ <div class="canvas"><canvas width="516" height="100" id="canvas-7"></canvas></div>
502
587
  </div>
503
588
 
504
589
 
@@ -540,7 +625,7 @@ new PointText({
540
625
  <div class="button run">Run</div>
541
626
  </div>
542
627
 
543
- <script type="text/paperscript" canvas="canvas-7">
628
+ <script type="text/paperscript" canvas="canvas-8">
544
629
  var path = new Path.Circle({
545
630
  center: [50, 50],
546
631
  radius: 20,
@@ -550,7 +635,7 @@ var path = new Path.Circle({
550
635
  // Hide the path:
551
636
  path.visible = false;
552
637
  </script>
553
- <div class="canvas"><canvas width="516" height="100" id="canvas-7"></canvas></div>
638
+ <div class="canvas"><canvas width="516" height="100" id="canvas-8"></canvas></div>
554
639
  </div>
555
640
 
556
641
 
@@ -598,7 +683,7 @@ path.visible = false;
598
683
  <div class="button run">Run</div>
599
684
  </div>
600
685
 
601
- <script type="text/paperscript" canvas="canvas-8">
686
+ <script type="text/paperscript" canvas="canvas-9">
602
687
  // Create a white rectangle in the background
603
688
  // with the same dimensions as the view:
604
689
  var background = new Path.Rectangle(view.bounds);
@@ -619,7 +704,7 @@ var circle2 = new Path.Circle({
619
704
  // Set the blend mode of circle2:
620
705
  circle2.blendMode = 'multiply';
621
706
  </script>
622
- <div class="canvas"><canvas width="516" height="100" id="canvas-8"></canvas></div>
707
+ <div class="canvas"><canvas width="516" height="100" id="canvas-9"></canvas></div>
623
708
  </div>
624
709
 
625
710
 
@@ -661,7 +746,7 @@ circle2.blendMode = 'multiply';
661
746
  <div class="button run">Run</div>
662
747
  </div>
663
748
 
664
- <script type="text/paperscript" canvas="canvas-9">
749
+ <script type="text/paperscript" canvas="canvas-10">
665
750
  var circle = new Path.Circle({
666
751
  center: [80, 50],
667
752
  radius: 35,
@@ -679,7 +764,7 @@ var circle2 = new Path.Circle({
679
764
  // Make circle2 50% transparent:
680
765
  circle2.opacity = 0.5;
681
766
  </script>
682
- <div class="canvas"><canvas width="516" height="100" id="canvas-9"></canvas></div>
767
+ <div class="canvas"><canvas width="516" height="100" id="canvas-10"></canvas></div>
683
768
  </div>
684
769
 
685
770
 
@@ -802,14 +887,14 @@ circle.textWrap = { offset: 10 };</code></pre>
802
887
  <div class="button run">Run</div>
803
888
  </div>
804
889
 
805
- <script type="text/paperscript" canvas="canvas-10">
890
+ <script type="text/paperscript" canvas="canvas-11">
806
891
  var path = new Path.Circle({
807
892
  center: [80, 50],
808
893
  radius: 35
809
894
  });
810
895
  path.selected = true; // Select the path
811
896
  </script>
812
- <div class="canvas"><canvas width="516" height="100" id="canvas-10"></canvas></div>
897
+ <div class="canvas"><canvas width="516" height="100" id="canvas-11"></canvas></div>
813
898
  </div>
814
899
 
815
900
 
@@ -966,7 +1051,7 @@ console.log(path.data.pets.length); // 1</code></pre>
966
1051
  <div class="button run">Run</div>
967
1052
  </div>
968
1053
 
969
- <script type="text/paperscript" canvas="canvas-11">
1054
+ <script type="text/paperscript" canvas="canvas-12">
970
1055
  // Create a circle at position { x: 10, y: 10 }
971
1056
  var circle = new Path.Circle({
972
1057
  center: new Point(10, 10),
@@ -980,7 +1065,7 @@ circle.position = new Point(20, 20);
980
1065
  // Move the circle 100 points to the right and 50 points down
981
1066
  circle.position += new Point(100, 50);
982
1067
  </script>
983
- <div class="canvas"><canvas width="516" height="100" id="canvas-11"></canvas></div>
1068
+ <div class="canvas"><canvas width="516" height="100" id="canvas-12"></canvas></div>
984
1069
  </div>
985
1070
 
986
1071
 
@@ -992,7 +1077,7 @@ circle.position += new Point(100, 50);
992
1077
  <div class="button run">Run</div>
993
1078
  </div>
994
1079
 
995
- <script type="text/paperscript" canvas="canvas-12">
1080
+ <script type="text/paperscript" canvas="canvas-13">
996
1081
  // Create a circle at position { x: 20, y: 20 }
997
1082
  var circle = new Path.Circle({
998
1083
  center: new Point(20, 20),
@@ -1003,7 +1088,7 @@ var circle = new Path.Circle({
1003
1088
  // Move the circle 100 points to the right
1004
1089
  circle.position.x += 100;
1005
1090
  </script>
1006
- <div class="canvas"><canvas width="516" height="100" id="canvas-12"></canvas></div>
1091
+ <div class="canvas"><canvas width="516" height="100" id="canvas-13"></canvas></div>
1007
1092
  </div>
1008
1093
 
1009
1094
 
@@ -1529,7 +1614,7 @@ console.log(group.children[0] == path); // true</code></pre>
1529
1614
  <div class="button run">Run</div>
1530
1615
  </div>
1531
1616
 
1532
- <script type="text/paperscript" canvas="canvas-13">
1617
+ <script type="text/paperscript" canvas="canvas-14">
1533
1618
  var path = new Path.Circle({
1534
1619
  center: [80, 50],
1535
1620
  radius: 35
@@ -1542,7 +1627,7 @@ group.addChild(path);
1542
1627
  // Access the path through the group's children array:
1543
1628
  group.children[0].fillColor = 'red';
1544
1629
  </script>
1545
- <div class="canvas"><canvas width="516" height="100" id="canvas-13"></canvas></div>
1630
+ <div class="canvas"><canvas width="516" height="100" id="canvas-14"></canvas></div>
1546
1631
  </div>
1547
1632
 
1548
1633
 
@@ -1554,7 +1639,7 @@ group.children[0].fillColor = 'red';
1554
1639
  <div class="button run">Run</div>
1555
1640
  </div>
1556
1641
 
1557
- <script type="text/paperscript" canvas="canvas-14">
1642
+ <script type="text/paperscript" canvas="canvas-15">
1558
1643
  var path = new Path.Circle({
1559
1644
  center: [80, 50],
1560
1645
  radius: 35
@@ -1569,7 +1654,7 @@ group.addChild(path);
1569
1654
  // The path can be accessed by name:
1570
1655
  group.children['example'].fillColor = 'orange';
1571
1656
  </script>
1572
- <div class="canvas"><canvas width="516" height="100" id="canvas-14"></canvas></div>
1657
+ <div class="canvas"><canvas width="516" height="100" id="canvas-15"></canvas></div>
1573
1658
  </div>
1574
1659
 
1575
1660
 
@@ -1581,7 +1666,7 @@ group.children['example'].fillColor = 'orange';
1581
1666
  <div class="button run">Run</div>
1582
1667
  </div>
1583
1668
 
1584
- <script type="text/paperscript" canvas="canvas-15">
1669
+ <script type="text/paperscript" canvas="canvas-16">
1585
1670
  var path = new Path.Circle({
1586
1671
  center: [80, 50],
1587
1672
  radius: 35
@@ -1593,7 +1678,7 @@ group.children = [path];
1593
1678
  // The path is the first child of the group:
1594
1679
  group.firstChild.fillColor = 'green';
1595
1680
  </script>
1596
- <div class="canvas"><canvas width="516" height="100" id="canvas-15"></canvas></div>
1681
+ <div class="canvas"><canvas width="516" height="100" id="canvas-16"></canvas></div>
1597
1682
  </div>
1598
1683
 
1599
1684
 
@@ -1770,7 +1855,7 @@ group.firstChild.fillColor = 'green';
1770
1855
  <div class="button run">Run</div>
1771
1856
  </div>
1772
1857
 
1773
- <script type="text/paperscript" canvas="canvas-16">
1858
+ <script type="text/paperscript" canvas="canvas-17">
1774
1859
  // Create a circle shaped path at { x: 80, y: 50 }
1775
1860
  // with a radius of 35:
1776
1861
  var circle = new Path.Circle({
@@ -1781,7 +1866,7 @@ var circle = new Path.Circle({
1781
1866
  // Set its stroke color to RGB red:
1782
1867
  circle.strokeColor = new Color(1, 0, 0);
1783
1868
  </script>
1784
- <div class="canvas"><canvas width="516" height="100" id="canvas-16"></canvas></div>
1869
+ <div class="canvas"><canvas width="516" height="100" id="canvas-17"></canvas></div>
1785
1870
  </div>
1786
1871
 
1787
1872
 
@@ -1818,7 +1903,7 @@ circle.strokeColor = new Color(1, 0, 0);
1818
1903
  <div class="button run">Run</div>
1819
1904
  </div>
1820
1905
 
1821
- <script type="text/paperscript" canvas="canvas-17">
1906
+ <script type="text/paperscript" canvas="canvas-18">
1822
1907
  // Create a circle shaped path at { x: 80, y: 50 }
1823
1908
  // with a radius of 35:
1824
1909
  var circle = new Path.Circle({
@@ -1830,7 +1915,7 @@ var circle = new Path.Circle({
1830
1915
  // Set its stroke width to 10:
1831
1916
  circle.strokeWidth = 10;
1832
1917
  </script>
1833
- <div class="canvas"><canvas width="516" height="100" id="canvas-17"></canvas></div>
1918
+ <div class="canvas"><canvas width="516" height="100" id="canvas-18"></canvas></div>
1834
1919
  </div>
1835
1920
 
1836
1921
 
@@ -1877,7 +1962,7 @@ circle.strokeWidth = 10;
1877
1962
  <div class="button run">Run</div>
1878
1963
  </div>
1879
1964
 
1880
- <script type="text/paperscript" canvas="canvas-18">
1965
+ <script type="text/paperscript" canvas="canvas-19">
1881
1966
  var line = new Path({
1882
1967
  segments: [[80, 50], [420, 50]],
1883
1968
  strokeColor: 'black',
@@ -1898,7 +1983,7 @@ var line2 = line.clone();
1898
1983
  line2.position.y += 100;
1899
1984
  line2.strokeCap = 'butt';
1900
1985
  </script>
1901
- <div class="canvas"><canvas width="516" height="200" id="canvas-18"></canvas></div>
1986
+ <div class="canvas"><canvas width="516" height="200" id="canvas-19"></canvas></div>
1902
1987
  </div>
1903
1988
 
1904
1989
 
@@ -1945,7 +2030,7 @@ line2.strokeCap = 'butt';
1945
2030
  <div class="button run">Run</div>
1946
2031
  </div>
1947
2032
 
1948
- <script type="text/paperscript" canvas="canvas-19">
2033
+ <script type="text/paperscript" canvas="canvas-20">
1949
2034
  var path = new Path({
1950
2035
  segments: [[80, 100], [120, 40], [160, 100]],
1951
2036
  strokeColor: 'black',
@@ -1962,7 +2047,7 @@ var path3 = path2.clone();
1962
2047
  path3.position.x += path3.bounds.width * 1.5;
1963
2048
  path3.strokeJoin = 'bevel';
1964
2049
  </script>
1965
- <div class="canvas"><canvas width="516" height="120" id="canvas-19"></canvas></div>
2050
+ <div class="canvas"><canvas width="516" height="120" id="canvas-20"></canvas></div>
1966
2051
  </div>
1967
2052
 
1968
2053
 
@@ -2066,7 +2151,7 @@ path3.strokeJoin = 'bevel';
2066
2151
  <div class="button run">Run</div>
2067
2152
  </div>
2068
2153
 
2069
- <script type="text/paperscript" canvas="canvas-20">
2154
+ <script type="text/paperscript" canvas="canvas-21">
2070
2155
  var path = new Path.Circle({
2071
2156
  center: [80, 50],
2072
2157
  radius: 40,
@@ -2077,7 +2162,7 @@ var path = new Path.Circle({
2077
2162
  // Set the dashed stroke to [10pt dash, 4pt gap]:
2078
2163
  path.dashArray = [10, 4];
2079
2164
  </script>
2080
- <div class="canvas"><canvas width="516" height="100" id="canvas-20"></canvas></div>
2165
+ <div class="canvas"><canvas width="516" height="100" id="canvas-21"></canvas></div>
2081
2166
  </div>
2082
2167
 
2083
2168
 
@@ -2183,7 +2268,7 @@ path.dashArray = [10, 4];
2183
2268
  <div class="button run">Run</div>
2184
2269
  </div>
2185
2270
 
2186
- <script type="text/paperscript" canvas="canvas-21">
2271
+ <script type="text/paperscript" canvas="canvas-22">
2187
2272
  // Create a circle shaped path at { x: 80, y: 50 }
2188
2273
  // with a radius of 35:
2189
2274
  var circle = new Path.Circle({
@@ -2194,7 +2279,7 @@ var circle = new Path.Circle({
2194
2279
  // Set the fill color of the circle to RGB red:
2195
2280
  circle.fillColor = new Color(1, 0, 0);
2196
2281
  </script>
2197
- <div class="canvas"><canvas width="516" height="100" id="canvas-21"></canvas></div>
2282
+ <div class="canvas"><canvas width="516" height="100" id="canvas-22"></canvas></div>
2198
2283
  </div>
2199
2284
 
2200
2285
 
@@ -2269,7 +2354,7 @@ circle.fillColor = new Color(1, 0, 0);
2269
2354
  <div class="button run">Run</div>
2270
2355
  </div>
2271
2356
 
2272
- <script type="text/paperscript" canvas="canvas-22">
2357
+ <script type="text/paperscript" canvas="canvas-23">
2273
2358
  var circle = new Path.Circle({
2274
2359
  center: [80, 50],
2275
2360
  radius: 35,
@@ -2282,7 +2367,7 @@ var circle = new Path.Circle({
2282
2367
  shadowOffset: new Point(5, 5)
2283
2368
  });
2284
2369
  </script>
2285
- <div class="canvas"><canvas width="516" height="100" id="canvas-22"></canvas></div>
2370
+ <div class="canvas"><canvas width="516" height="100" id="canvas-23"></canvas></div>
2286
2371
  </div>
2287
2372
 
2288
2373
 
@@ -2423,7 +2508,7 @@ var circle = new Path.Circle({
2423
2508
  <div class="button run">Run</div>
2424
2509
  </div>
2425
2510
 
2426
- <script type="text/paperscript" canvas="canvas-23">
2511
+ <script type="text/paperscript" canvas="canvas-24">
2427
2512
  // Create a rectangle shaped path with its top left point at:
2428
2513
  // {x: 50, y: 25} and a size of {width: 50, height: 50}
2429
2514
  var path = new Path.Rectangle(new Point(50, 25), new Size(50, 50));
@@ -2434,7 +2519,7 @@ path.onFrame = function(event) {
2434
2519
  this.rotate(3);
2435
2520
  }
2436
2521
  </script>
2437
- <div class="canvas"><canvas width="516" height="100" id="canvas-23"></canvas></div>
2522
+ <div class="canvas"><canvas width="516" height="100" id="canvas-24"></canvas></div>
2438
2523
  </div>
2439
2524
 
2440
2525
 
@@ -2478,7 +2563,7 @@ path.onFrame = function(event) {
2478
2563
  <div class="button run">Run</div>
2479
2564
  </div>
2480
2565
 
2481
- <script type="text/paperscript" canvas="canvas-24">
2566
+ <script type="text/paperscript" canvas="canvas-25">
2482
2567
  // Create a circle shaped path at the center of the view:
2483
2568
  var path = new Path.Circle({
2484
2569
  center: view.center,
@@ -2492,7 +2577,7 @@ path.onMouseDown = function(event) {
2492
2577
  this.fillColor = 'red';
2493
2578
  }
2494
2579
  </script>
2495
- <div class="canvas"><canvas width="516" height="100" id="canvas-24"></canvas></div>
2580
+ <div class="canvas"><canvas width="516" height="100" id="canvas-25"></canvas></div>
2496
2581
  </div>
2497
2582
 
2498
2583
 
@@ -2504,7 +2589,7 @@ path.onMouseDown = function(event) {
2504
2589
  <div class="button run">Run</div>
2505
2590
  </div>
2506
2591
 
2507
- <script type="text/paperscript" canvas="canvas-25">
2592
+ <script type="text/paperscript" canvas="canvas-26">
2508
2593
  // Loop 30 times:
2509
2594
  for (var i = 0; i < 30; i++) {
2510
2595
  // Create a circle shaped path at a random position
@@ -2522,7 +2607,7 @@ for (var i = 0; i < 30; i++) {
2522
2607
  }
2523
2608
  }
2524
2609
  </script>
2525
- <div class="canvas"><canvas width="516" height="100" id="canvas-25"></canvas></div>
2610
+ <div class="canvas"><canvas width="516" height="100" id="canvas-26"></canvas></div>
2526
2611
  </div>
2527
2612
 
2528
2613
 
@@ -2566,7 +2651,7 @@ for (var i = 0; i < 30; i++) {
2566
2651
  <div class="button run">Run</div>
2567
2652
  </div>
2568
2653
 
2569
- <script type="text/paperscript" canvas="canvas-26">
2654
+ <script type="text/paperscript" canvas="canvas-27">
2570
2655
  // Create a circle shaped path at the center of the view:
2571
2656
  var path = new Path.Circle({
2572
2657
  center: view.center,
@@ -2579,7 +2664,7 @@ path.onMouseDrag = function(event) {
2579
2664
  path.position += event.delta;
2580
2665
  }
2581
2666
  </script>
2582
- <div class="canvas"><canvas width="516" height="240" id="canvas-26"></canvas></div>
2667
+ <div class="canvas"><canvas width="516" height="240" id="canvas-27"></canvas></div>
2583
2668
  </div>
2584
2669
 
2585
2670
 
@@ -2623,7 +2708,7 @@ path.onMouseDrag = function(event) {
2623
2708
  <div class="button run">Run</div>
2624
2709
  </div>
2625
2710
 
2626
- <script type="text/paperscript" canvas="canvas-27">
2711
+ <script type="text/paperscript" canvas="canvas-28">
2627
2712
  // Create a circle shaped path at the center of the view:
2628
2713
  var path = new Path.Circle({
2629
2714
  center: view.center,
@@ -2637,7 +2722,7 @@ path.onMouseUp = function(event) {
2637
2722
  this.fillColor = 'red';
2638
2723
  }
2639
2724
  </script>
2640
- <div class="canvas"><canvas width="516" height="100" id="canvas-27"></canvas></div>
2725
+ <div class="canvas"><canvas width="516" height="100" id="canvas-28"></canvas></div>
2641
2726
  </div>
2642
2727
 
2643
2728
 
@@ -2681,7 +2766,7 @@ path.onMouseUp = function(event) {
2681
2766
  <div class="button run">Run</div>
2682
2767
  </div>
2683
2768
 
2684
- <script type="text/paperscript" canvas="canvas-28">
2769
+ <script type="text/paperscript" canvas="canvas-29">
2685
2770
  // Create a circle shaped path at the center of the view:
2686
2771
  var path = new Path.Circle({
2687
2772
  center: view.center,
@@ -2695,7 +2780,7 @@ path.onClick = function(event) {
2695
2780
  this.fillColor = 'red';
2696
2781
  }
2697
2782
  </script>
2698
- <div class="canvas"><canvas width="516" height="100" id="canvas-28"></canvas></div>
2783
+ <div class="canvas"><canvas width="516" height="100" id="canvas-29"></canvas></div>
2699
2784
  </div>
2700
2785
 
2701
2786
 
@@ -2707,7 +2792,7 @@ path.onClick = function(event) {
2707
2792
  <div class="button run">Run</div>
2708
2793
  </div>
2709
2794
 
2710
- <script type="text/paperscript" canvas="canvas-29">
2795
+ <script type="text/paperscript" canvas="canvas-30">
2711
2796
  // Loop 30 times:
2712
2797
  for (var i = 0; i < 30; i++) {
2713
2798
  // Create a circle shaped path at a random position
@@ -2725,7 +2810,7 @@ for (var i = 0; i < 30; i++) {
2725
2810
  }
2726
2811
  }
2727
2812
  </script>
2728
- <div class="canvas"><canvas width="516" height="100" id="canvas-29"></canvas></div>
2813
+ <div class="canvas"><canvas width="516" height="100" id="canvas-30"></canvas></div>
2729
2814
  </div>
2730
2815
 
2731
2816
 
@@ -2769,7 +2854,7 @@ for (var i = 0; i < 30; i++) {
2769
2854
  <div class="button run">Run</div>
2770
2855
  </div>
2771
2856
 
2772
- <script type="text/paperscript" canvas="canvas-30">
2857
+ <script type="text/paperscript" canvas="canvas-31">
2773
2858
  // Create a circle shaped path at the center of the view:
2774
2859
  var path = new Path.Circle({
2775
2860
  center: view.center,
@@ -2783,7 +2868,7 @@ path.onDoubleClick = function(event) {
2783
2868
  this.fillColor = 'red';
2784
2869
  }
2785
2870
  </script>
2786
- <div class="canvas"><canvas width="516" height="100" id="canvas-30"></canvas></div>
2871
+ <div class="canvas"><canvas width="516" height="100" id="canvas-31"></canvas></div>
2787
2872
  </div>
2788
2873
 
2789
2874
 
@@ -2795,7 +2880,7 @@ path.onDoubleClick = function(event) {
2795
2880
  <div class="button run">Run</div>
2796
2881
  </div>
2797
2882
 
2798
- <script type="text/paperscript" canvas="canvas-31">
2883
+ <script type="text/paperscript" canvas="canvas-32">
2799
2884
  // Loop 30 times:
2800
2885
  for (var i = 0; i < 30; i++) {
2801
2886
  // Create a circle shaped path at a random position
@@ -2813,7 +2898,7 @@ for (var i = 0; i < 30; i++) {
2813
2898
  }
2814
2899
  }
2815
2900
  </script>
2816
- <div class="canvas"><canvas width="516" height="100" id="canvas-31"></canvas></div>
2901
+ <div class="canvas"><canvas width="516" height="100" id="canvas-32"></canvas></div>
2817
2902
  </div>
2818
2903
 
2819
2904
 
@@ -2857,7 +2942,7 @@ for (var i = 0; i < 30; i++) {
2857
2942
  <div class="button run">Run</div>
2858
2943
  </div>
2859
2944
 
2860
- <script type="text/paperscript" canvas="canvas-32">
2945
+ <script type="text/paperscript" canvas="canvas-33">
2861
2946
  // Create a circle shaped path at the center of the view:
2862
2947
  var path = new Path.Circle({
2863
2948
  center: view.center,
@@ -2865,180 +2950,567 @@ for (var i = 0; i < 30; i++) {
2865
2950
  fillColor: 'black'
2866
2951
  });
2867
2952
 
2868
- // When the mouse moves on top of the item, set its opacity
2869
- // to a random value between 0 and 1:
2870
- path.onMouseMove = function(event) {
2871
- this.opacity = Math.random();
2872
- }
2873
- </script>
2874
- <div class="canvas"><canvas width="516" height="100" id="canvas-32"></canvas></div>
2875
- </div>
2953
+ // When the mouse moves on top of the item, set its opacity
2954
+ // to a random value between 0 and 1:
2955
+ path.onMouseMove = function(event) {
2956
+ this.opacity = Math.random();
2957
+ }
2958
+ </script>
2959
+ <div class="canvas"><canvas width="516" height="100" id="canvas-33"></canvas></div>
2960
+ </div>
2961
+
2962
+
2963
+ </div>
2964
+
2965
+ </div>
2966
+ </div>
2967
+
2968
+
2969
+ <div id="onmouseenter" class="member">
2970
+ <div class="member-link">
2971
+ <a name="onmouseenter" href="#onmouseenter"><tt><b>onMouseEnter</b></tt></a>
2972
+ </div>
2973
+ <div class="member-description hidden">
2974
+
2975
+ <div class="member-text">
2976
+ <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>
2977
+
2978
+
2979
+
2980
+ <ul class="member-list">
2981
+ <h4>Type:</h4>
2982
+ <li>
2983
+ <tt>Function</tt>⟋<tt>null</tt>
2984
+ </li>
2985
+ </ul>
2986
+
2987
+
2988
+ <ul class="member-list">
2989
+ <h4>See also:</h4>
2990
+
2991
+ <li><tt><a href="../classes/View.html#onmouseenter"><tt>view.onMouseEnter</tt></a></tt></li>
2992
+
2993
+ </ul>
2994
+
2995
+ <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>
2996
+
2997
+ <div class="paperscript split">
2998
+
2999
+ <div class="buttons">
3000
+ <div class="button run">Run</div>
3001
+ </div>
3002
+
3003
+ <script type="text/paperscript" canvas="canvas-34">
3004
+ // Create a circle shaped path at the center of the view:
3005
+ var path = new Path.Circle({
3006
+ center: view.center,
3007
+ radius: 25,
3008
+ fillColor: 'black'
3009
+ });
3010
+
3011
+ // When the mouse enters the item, set its fill color to red:
3012
+ path.onMouseEnter = function(event) {
3013
+ this.fillColor = 'red';
3014
+ }
3015
+
3016
+ // When the mouse leaves the item, set its fill color to black:
3017
+ path.onMouseLeave = function(event) {
3018
+ this.fillColor = 'black';
3019
+ }
3020
+ </script>
3021
+ <div class="canvas"><canvas width="516" height="100" id="canvas-34"></canvas></div>
3022
+ </div>
3023
+
3024
+
3025
+ <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>
3026
+
3027
+ <div class="paperscript split">
3028
+
3029
+ <div class="buttons">
3030
+ <div class="button run">Run</div>
3031
+ </div>
3032
+
3033
+ <script type="text/paperscript" canvas="canvas-35">
3034
+ function enter(event) {
3035
+ this.fillColor = 'red';
3036
+ }
3037
+
3038
+ function leave(event) {
3039
+ this.fillColor = 'black';
3040
+ }
3041
+
3042
+ // When the mouse is pressed:
3043
+ function onMouseDown(event) {
3044
+ // Create a circle shaped path at the position of the mouse:
3045
+ var path = new Path.Circle(event.point, 25);
3046
+ path.fillColor = 'black';
3047
+
3048
+ // When the mouse enters the item, set its fill color to red:
3049
+ path.onMouseEnter = enter;
3050
+
3051
+ // When the mouse leaves the item, set its fill color to black:
3052
+ path.onMouseLeave = leave;
3053
+ }
3054
+ </script>
3055
+ <div class="canvas"><canvas width="516" height="100" id="canvas-35"></canvas></div>
3056
+ </div>
3057
+
3058
+
3059
+ </div>
3060
+
3061
+ </div>
3062
+ </div>
3063
+
3064
+
3065
+ <div id="onmouseleave" class="member">
3066
+ <div class="member-link">
3067
+ <a name="onmouseleave" href="#onmouseleave"><tt><b>onMouseLeave</b></tt></a>
3068
+ </div>
3069
+ <div class="member-description hidden">
3070
+
3071
+ <div class="member-text">
3072
+ <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>
3073
+
3074
+
3075
+
3076
+ <ul class="member-list">
3077
+ <h4>Type:</h4>
3078
+ <li>
3079
+ <tt>Function</tt>⟋<tt>null</tt>
3080
+ </li>
3081
+ </ul>
3082
+
3083
+
3084
+ <ul class="member-list">
3085
+ <h4>See also:</h4>
3086
+
3087
+ <li><tt><a href="../classes/View.html#onmouseleave"><tt>view.onMouseLeave</tt></a></tt></li>
3088
+
3089
+ </ul>
3090
+
3091
+ <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>
3092
+
3093
+ <div class="paperscript split">
3094
+
3095
+ <div class="buttons">
3096
+ <div class="button run">Run</div>
3097
+ </div>
3098
+
3099
+ <script type="text/paperscript" canvas="canvas-36">
3100
+ // Create a circle shaped path at the center of the view:
3101
+ var path = new Path.Circle({
3102
+ center: view.center,
3103
+ radius: 25,
3104
+ fillColor: 'black'
3105
+ });
3106
+
3107
+ // When the mouse leaves the item, set its fill color to red:
3108
+ path.onMouseLeave = function(event) {
3109
+ this.fillColor = 'red';
3110
+ }
3111
+ </script>
3112
+ <div class="canvas"><canvas width="516" height="100" id="canvas-36"></canvas></div>
3113
+ </div>
3114
+
3115
+
3116
+ </div>
3117
+
3118
+ </div>
3119
+ </div>
3120
+
3121
+
3122
+ <div id="ondraw" class="member">
3123
+ <div class="member-link">
3124
+ <a name="ondraw" href="#ondraw"><tt><b>onDraw</b></tt></a>
3125
+ </div>
3126
+ <div class="member-description hidden">
3127
+
3128
+ <div class="member-text">
3129
+ <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>
3130
+
3131
+
3132
+
3133
+ <ul class="member-list">
3134
+ <h4>Type:</h4>
3135
+ <li>
3136
+ <tt>Function</tt>⟋<tt>null</tt>
3137
+ </li>
3138
+ </ul>
3139
+ <ul class="member-list">
3140
+ <h4>Options:</h4>
3141
+ <li><tt>event.item: <a href="../classes/Item.html"><tt>Item</tt></a></tt> &mdash; the item that is drawn</li>
3142
+ <li><tt>event.context: <tt>CanvasRenderingContext2D</tt></tt> &mdash; the canvas context, transformed into the item&rsquo;s coordinates</li>
3143
+ <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>
3144
+ <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>
3145
+ <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>()
3146
+ 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>
3147
+ </ul>
3148
+
3149
+ <h4>Example:<span class="description">Draw a hairline cross through the center of a circle, beneath it:</span></h4>
3150
+
3151
+ <div class="paperscript split">
3152
+
3153
+ <div class="buttons">
3154
+ <div class="button run">Run</div>
3155
+ </div>
3156
+
3157
+ <script type="text/paperscript" canvas="canvas-37">
3158
+ var path = new Path.Circle({
3159
+ center: view.center,
3160
+ radius: 25,
3161
+ fillColor: 'rgba(255, 0, 0, 0.5)'
3162
+ });
3163
+
3164
+ path.onDraw = function(event) {
3165
+ var ctx = event.context,
3166
+ center = this.position,
3167
+ scale = event.matrix.scaling.x;
3168
+ ctx.beginPath();
3169
+ ctx.moveTo(center.x - 40, center.y);
3170
+ ctx.lineTo(center.x + 40, center.y);
3171
+ ctx.moveTo(center.x, center.y - 40);
3172
+ ctx.lineTo(center.x, center.y + 40);
3173
+ ctx.lineWidth = 1 / scale;
3174
+ ctx.stroke();
3175
+ }
3176
+ </script>
3177
+ <div class="canvas"><canvas width="516" height="100" id="canvas-37"></canvas></div>
3178
+ </div>
3179
+
3180
+
3181
+ </div>
3182
+
3183
+ </div>
3184
+ </div>
3185
+
3186
+
3187
+ <div id="ondrawselection" class="member">
3188
+ <div class="member-link">
3189
+ <a name="ondrawselection" href="#ondrawselection"><tt><b>onDrawSelection</b></tt></a>
3190
+ </div>
3191
+ <div class="member-description hidden">
3192
+
3193
+ <div class="member-text">
3194
+ <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>
3195
+
3196
+
3197
+
3198
+ <ul class="member-list">
3199
+ <h4>Type:</h4>
3200
+ <li>
3201
+ <tt>Function</tt>⟋<tt>null</tt>
3202
+ </li>
3203
+ </ul>
3204
+ <ul class="member-list">
3205
+ <h4>Options:</h4>
3206
+ <li><tt>event.item: <a href="../classes/Item.html"><tt>Item</tt></a></tt> &mdash; the selected item</li>
3207
+ <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>
3208
+ <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>
3209
+ <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>
3210
+ <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>
3211
+ <li><tt>event.view: <a href="../classes/View.html"><tt>View</tt></a></tt> &mdash; the view drawn into
3212
+ What the handler draws isn&rsquo;t part of the item&rsquo;s hit testing, its bounds or its SVG export.</li>
3213
+ </ul>
3214
+
3215
+ <h4>Example:<span class="description">Draw the selection of a path as a dot at each segment:</span></h4>
3216
+
3217
+ <div class="paperscript split">
3218
+
3219
+ <div class="buttons">
3220
+ <div class="button run">Run</div>
3221
+ </div>
3222
+
3223
+ <script type="text/paperscript" canvas="canvas-38">
3224
+ var path = new Path.Star({
3225
+ center: view.center,
3226
+ points: 5,
3227
+ radius1: 20,
3228
+ radius2: 40,
3229
+ strokeColor: 'black',
3230
+ selected: true
3231
+ });
3232
+
3233
+ path.onDrawSelection = function(event) {
3234
+ var ctx = event.context;
3235
+ this.segments.forEach(function(segment) {
3236
+ var point = event.matrix.transform(segment.point);
3237
+ ctx.beginPath();
3238
+ ctx.arc(point.x, point.y, event.size, 0, Math.PI * 2);
3239
+ ctx.fill();
3240
+ });
3241
+ return false;
3242
+ }
3243
+ </script>
3244
+ <div class="canvas"><canvas width="516" height="100" id="canvas-38"></canvas></div>
3245
+ </div>
3246
+
3247
+
3248
+ </div>
3249
+
3250
+ </div>
3251
+ </div>
3252
+
3253
+ </div>
3254
+
3255
+
3256
+ <!-- =========================== inherited methods ========================= -->
3257
+ <div class="reference-members"><h2>Methods inherited from <a href="../classes/Item.html"><tt>Item</tt></a></h2>
3258
+
3259
+
3260
+ <div id="addeffect-effect" class="member">
3261
+ <div class="member-link">
3262
+ <a name="addeffect-effect" href="#addeffect-effect"><tt><b>addEffect</b>(effect)</tt></a>
3263
+ </div>
3264
+ <div class="member-description hidden">
3265
+ <div class="member-text">
3266
+ <p>Adds an effect at the end of the item&rsquo;s effects.</p>
3267
+
3268
+
3269
+ <ul class="member-list">
3270
+ <h4>Parameters:</h4>
3271
+
3272
+ <li>
3273
+ <tt>effect:</tt>
3274
+ <tt>Object</tt>
3275
+ &mdash;&nbsp;the plain object describing the effect
3276
+
3277
+ </li>
3278
+
3279
+ </ul>
3280
+
3281
+
3282
+ <ul class="member-list">
3283
+ <h4>Returns:</h4>
3284
+
3285
+ <li>
3286
+ <tt><a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a></tt>&nbsp;&mdash;&nbsp;the added instance
3287
+ </li>
3288
+
3289
+
3290
+ </ul>
3291
+
3292
+
3293
+
3294
+
3295
+
3296
+ </div>
3297
+ </div>
3298
+ </div>
3299
+
3300
+
3301
+ <div id="inserteffect-index-effect" class="member">
3302
+ <div class="member-link">
3303
+ <a name="inserteffect-index-effect" href="#inserteffect-index-effect"><tt><b>insertEffect</b>(index, effect)</tt></a>
3304
+ </div>
3305
+ <div class="member-description hidden">
3306
+ <div class="member-text">
3307
+ <p>Inserts an effect into the item&rsquo;s effects at the given index.</p>
3308
+
3309
+
3310
+ <ul class="member-list">
3311
+ <h4>Parameters:</h4>
3312
+
3313
+ <li>
3314
+ <tt>index:</tt>
3315
+ <tt>Number</tt>
3316
+ &mdash;&nbsp;the index at which to insert the effect
3317
+
3318
+ </li>
3319
+
3320
+ <li>
3321
+ <tt>effect:</tt>
3322
+ <tt>Object</tt>
3323
+ &mdash;&nbsp;the plain object describing the effect
3324
+
3325
+ </li>
3326
+
3327
+ </ul>
3328
+
3329
+
3330
+ <ul class="member-list">
3331
+ <h4>Returns:</h4>
3332
+
3333
+ <li>
3334
+ <tt><a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a></tt>&nbsp;&mdash;&nbsp;the inserted instance
3335
+ </li>
3336
+
3337
+
3338
+ </ul>
3339
+
3340
+
3341
+
3342
+
3343
+
3344
+ </div>
3345
+ </div>
3346
+ </div>
3347
+
3348
+
3349
+ <div id="inserteffects-index-effects" class="member">
3350
+ <div class="member-link">
3351
+ <a name="inserteffects-index-effects" href="#inserteffects-index-effects"><tt><b>insertEffects</b>(index, effects)</tt></a>
3352
+ </div>
3353
+ <div class="member-description hidden">
3354
+ <div class="member-text">
3355
+ <p>Inserts effects into the item&rsquo;s effects at the given index.</p>
3356
+
3357
+
3358
+ <ul class="member-list">
3359
+ <h4>Parameters:</h4>
3360
+
3361
+ <li>
3362
+ <tt>index:</tt>
3363
+ <tt>Number</tt>
3364
+ &mdash;&nbsp;the index at which to insert the effects
3365
+
3366
+ </li>
3367
+
3368
+ <li>
3369
+ <tt>effects:</tt>
3370
+ Array of <tt>Object</tt> objects
3371
+ &mdash;&nbsp;the plain objects describing the effects
3372
+
3373
+ </li>
3374
+
3375
+ </ul>
3376
+
3377
+
3378
+ <ul class="member-list">
3379
+ <h4>Returns:</h4>
3380
+
3381
+ <li>
3382
+ <tt>Array of <a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a> objects</tt>&nbsp;&mdash;&nbsp;the inserted instances
3383
+ </li>
3384
+
3385
+
3386
+ </ul>
2876
3387
 
2877
3388
 
2878
- </div>
2879
3389
 
3390
+
3391
+
3392
+ </div>
2880
3393
  </div>
2881
3394
  </div>
2882
3395
 
2883
3396
 
2884
- <div id="onmouseenter" class="member">
3397
+ <div id="removeeffect-index" class="member">
2885
3398
  <div class="member-link">
2886
- <a name="onmouseenter" href="#onmouseenter"><tt><b>onMouseEnter</b></tt></a>
3399
+ <a name="removeeffect-index" href="#removeeffect-index"><tt><b>removeEffect</b>(index)</tt></a>
2887
3400
  </div>
2888
3401
  <div class="member-description hidden">
2889
-
2890
3402
  <div class="member-text">
2891
- <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>
3403
+ <p>Removes the effect at the given index from the item&rsquo;s effects.</p>
3404
+
2892
3405
 
3406
+ <ul class="member-list">
3407
+ <h4>Parameters:</h4>
2893
3408
 
3409
+ <li>
3410
+ <tt>index:</tt>
3411
+ <tt>Number</tt>
3412
+ &mdash;&nbsp;the index of the effect to remove
3413
+
3414
+ </li>
2894
3415
 
2895
- <ul class="member-list">
2896
- <h4>Type:</h4>
2897
- <li>
2898
- <tt>Function</tt>⟋<tt>null</tt>
2899
- </li>
2900
- </ul>
2901
-
3416
+ </ul>
3417
+
2902
3418
 
2903
3419
  <ul class="member-list">
2904
- <h4>See also:</h4>
3420
+ <h4>Returns:</h4>
2905
3421
 
2906
- <li><tt><a href="../classes/View.html#onmouseenter"><tt>view.onMouseEnter</tt></a></tt></li>
3422
+ <li>
3423
+ <tt><a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a></tt>&nbsp;&mdash;&nbsp;the removed instance, or <code>null</code>
3424
+ </li>
3425
+
2907
3426
 
2908
3427
  </ul>
2909
3428
 
2910
- <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>
2911
3429
 
2912
- <div class="paperscript split">
2913
3430
 
2914
- <div class="buttons">
2915
- <div class="button run">Run</div>
3431
+
3432
+
2916
3433
  </div>
2917
-
2918
- <script type="text/paperscript" canvas="canvas-33">
2919
- // Create a circle shaped path at the center of the view:
2920
- var path = new Path.Circle({
2921
- center: view.center,
2922
- radius: 25,
2923
- fillColor: 'black'
2924
- });
2925
-
2926
- // When the mouse enters the item, set its fill color to red:
2927
- path.onMouseEnter = function(event) {
2928
- this.fillColor = 'red';
2929
- }
2930
-
2931
- // When the mouse leaves the item, set its fill color to black:
2932
- path.onMouseLeave = function(event) {
2933
- this.fillColor = 'black';
2934
- }
2935
- </script>
2936
- <div class="canvas"><canvas width="516" height="100" id="canvas-33"></canvas></div>
2937
3434
  </div>
2938
-
2939
-
2940
- <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>
2941
-
2942
- <div class="paperscript split">
2943
-
2944
- <div class="buttons">
2945
- <div class="button run">Run</div>
2946
3435
  </div>
2947
3436
 
2948
- <script type="text/paperscript" canvas="canvas-34">
2949
- function enter(event) {
2950
- this.fillColor = 'red';
2951
- }
2952
-
2953
- function leave(event) {
2954
- this.fillColor = 'black';
2955
- }
3437
+
3438
+ <div id="removeeffects" class="member">
3439
+ <div class="member-link">
3440
+ <a name="removeeffects" href="#removeeffects"><tt><b>removeEffects</b>([start[, end]])</tt></a>
3441
+ </div>
3442
+ <div class="member-description hidden">
3443
+ <div class="member-text">
3444
+ <p>Removes the effects from the start index to the end index from the item&rsquo;s effects, or all of them.</p>
3445
+
3446
+
3447
+ <ul class="member-list">
3448
+ <h4>Parameters:</h4>
3449
+
3450
+ <li>
3451
+ <tt>start:</tt>
3452
+ <tt>Number</tt>
3453
+ &mdash;&nbsp;the index of the first effect to remove
3454
+ &mdash;&nbsp;optional, default: <tt>0</tt>
3455
+ </li>
3456
+
3457
+ <li>
3458
+ <tt>end:</tt>
3459
+ <tt>Number</tt>
3460
+ &mdash;&nbsp;the index after the last one
3461
+ &mdash;&nbsp;optional, default: <tt>effects.length</tt>
3462
+ </li>
3463
+
3464
+ </ul>
2956
3465
 
2957
- // When the mouse is pressed:
2958
- function onMouseDown(event) {
2959
- // Create a circle shaped path at the position of the mouse:
2960
- var path = new Path.Circle(event.point, 25);
2961
- path.fillColor = 'black';
3466
+
3467
+ <ul class="member-list">
3468
+ <h4>Returns:</h4>
3469
+
3470
+ <li>
3471
+ <tt>Array of <a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a> objects</tt>&nbsp;&mdash;&nbsp;the removed instances
3472
+ </li>
2962
3473
 
2963
- // When the mouse enters the item, set its fill color to red:
2964
- path.onMouseEnter = enter;
3474
+
3475
+ </ul>
2965
3476
 
2966
- // When the mouse leaves the item, set its fill color to black:
2967
- path.onMouseLeave = leave;
2968
- }
2969
- </script>
2970
- <div class="canvas"><canvas width="516" height="100" id="canvas-34"></canvas></div>
2971
- </div>
2972
3477
 
2973
3478
 
3479
+
3480
+
2974
3481
  </div>
2975
-
2976
3482
  </div>
2977
3483
  </div>
2978
3484
 
2979
3485
 
2980
- <div id="onmouseleave" class="member">
3486
+ <div id="geteffectoutput" class="member">
2981
3487
  <div class="member-link">
2982
- <a name="onmouseleave" href="#onmouseleave"><tt><b>onMouseLeave</b></tt></a>
3488
+ <a name="geteffectoutput" href="#geteffectoutput"><tt><b>getEffectOutput</b>()</tt></a>
2983
3489
  </div>
2984
3490
  <div class="member-description hidden">
2985
-
2986
3491
  <div class="member-text">
2987
- <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>
2988
-
2989
-
2990
-
2991
- <ul class="member-list">
2992
- <h4>Type:</h4>
2993
- <li>
2994
- <tt>Function</tt>⟋<tt>null</tt>
2995
- </li>
2996
- </ul>
3492
+ <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>
2997
3493
 
2998
3494
 
3495
+
2999
3496
  <ul class="member-list">
3000
- <h4>See also:</h4>
3497
+ <h4>Returns:</h4>
3001
3498
 
3002
- <li><tt><a href="../classes/View.html#onmouseleave"><tt>view.onMouseLeave</tt></a></tt></li>
3499
+ <li>
3500
+ <tt><a href="../classes/Item.html"><tt>Item</tt></a>⟋<tt>null</tt></tt>&nbsp;&mdash;&nbsp;the output of the effects
3501
+ </li>
3502
+
3003
3503
 
3004
3504
  </ul>
3005
3505
 
3006
- <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>
3007
-
3008
- <div class="paperscript split">
3009
-
3010
- <div class="buttons">
3011
- <div class="button run">Run</div>
3012
- </div>
3013
-
3014
- <script type="text/paperscript" canvas="canvas-35">
3015
- // Create a circle shaped path at the center of the view:
3016
- var path = new Path.Circle({
3017
- center: view.center,
3018
- radius: 25,
3019
- fillColor: 'black'
3020
- });
3021
-
3022
- // When the mouse leaves the item, set its fill color to red:
3023
- path.onMouseLeave = function(event) {
3024
- this.fillColor = 'red';
3025
- }
3026
- </script>
3027
- <div class="canvas"><canvas width="516" height="100" id="canvas-35"></canvas></div>
3028
- </div>
3029
-
3030
3506
 
3031
- </div>
3032
3507
 
3508
+
3509
+
3033
3510
  </div>
3034
3511
  </div>
3035
-
3036
3512
  </div>
3037
3513
 
3038
-
3039
- <!-- =========================== inherited methods ========================= -->
3040
- <div class="reference-members"><h2>Methods inherited from <a href="../classes/Item.html"><tt>Item</tt></a></h2>
3041
-
3042
3514
 
3043
3515
  <div id="set-props" class="member">
3044
3516
  <div class="member-link">
@@ -3083,7 +3555,7 @@ path.onMouseLeave = function(event) {
3083
3555
  <div class="button run">Run</div>
3084
3556
  </div>
3085
3557
 
3086
- <script type="text/paperscript" canvas="canvas-36">
3558
+ <script type="text/paperscript" canvas="canvas-39">
3087
3559
  var circle = new Path.Circle({
3088
3560
  center: [80, 50],
3089
3561
  radius: 35
@@ -3096,7 +3568,7 @@ circle.set({
3096
3568
  selected: true
3097
3569
  });
3098
3570
  </script>
3099
- <div class="canvas"><canvas width="516" height="100" id="canvas-36"></canvas></div>
3571
+ <div class="canvas"><canvas width="516" height="100" id="canvas-39"></canvas></div>
3100
3572
  </div>
3101
3573
 
3102
3574
 
@@ -3152,7 +3624,7 @@ circle.set({
3152
3624
  <div class="button run">Run</div>
3153
3625
  </div>
3154
3626
 
3155
- <script type="text/paperscript" canvas="canvas-37">
3627
+ <script type="text/paperscript" canvas="canvas-40">
3156
3628
  var circle = new Path.Circle({
3157
3629
  center: [50, 50],
3158
3630
  radius: 10,
@@ -3167,7 +3639,7 @@ for (var i = 0; i < 20; i++) {
3167
3639
  copy.position.x += i * copy.bounds.width;
3168
3640
  }
3169
3641
  </script>
3170
- <div class="canvas"><canvas width="516" height="100" id="canvas-37"></canvas></div>
3642
+ <div class="canvas"><canvas width="516" height="100" id="canvas-40"></canvas></div>
3171
3643
  </div>
3172
3644
 
3173
3645
 
@@ -3293,7 +3765,7 @@ for (var i = 0; i < 20; i++) {
3293
3765
  <div class="button run">Run</div>
3294
3766
  </div>
3295
3767
 
3296
- <script type="text/paperscript" canvas="canvas-38">
3768
+ <script type="text/paperscript" canvas="canvas-41">
3297
3769
  var circle = new Path.Circle({
3298
3770
  center: [50, 50],
3299
3771
  radius: 5,
@@ -3310,7 +3782,7 @@ raster.position.x += 100;
3310
3782
  circle.scale(5);
3311
3783
  raster.scale(5);
3312
3784
  </script>
3313
- <div class="canvas"><canvas width="516" height="100" id="canvas-38"></canvas></div>
3785
+ <div class="canvas"><canvas width="516" height="100" id="canvas-41"></canvas></div>
3314
3786
  </div>
3315
3787
 
3316
3788
 
@@ -3364,7 +3836,7 @@ raster.scale(5);
3364
3836
  <div class="button run">Run</div>
3365
3837
  </div>
3366
3838
 
3367
- <script type="text/paperscript" canvas="canvas-39">
3839
+ <script type="text/paperscript" canvas="canvas-42">
3368
3840
  var path = new Path.Star({
3369
3841
  center: [50, 50],
3370
3842
  points: 12,
@@ -3385,7 +3857,7 @@ function onMouseDown(event) {
3385
3857
  }
3386
3858
  }
3387
3859
  </script>
3388
- <div class="canvas"><canvas width="516" height="100" id="canvas-39"></canvas></div>
3860
+ <div class="canvas"><canvas width="516" height="100" id="canvas-42"></canvas></div>
3389
3861
  </div>
3390
3862
 
3391
3863
 
@@ -3903,11 +4375,17 @@ function onMouseDown(event) {
3903
4375
  </div>
3904
4376
  <div class="member-description hidden">
3905
4377
  <div class="member-text">
3906
- <p>Exports the item with its content and child items as an SVG DOM.</p>
4378
+ <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>
3907
4379
  <ul class="member-list">
3908
4380
  <h4>Options:</h4>
3909
- <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>
3910
- <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>
4381
+ <li>[options.bounds] {String|Rectangle} the bounds of the area to
4382
+ export, either as a string ({@values 'view', content'}), or a
4383
+ {@link Rectangle} object: `'view'` uses the view bounds,
4384
+ `'content'` uses the stroke bounds of the item</li>
4385
+ <li>[options.matrix] {Matrix} the matrix with which to transform the
4386
+ exported content: If `options.bounds` is set to `'view'`,
4387
+ `paper.view.matrix` is used, for all other settings of
4388
+ `options.bounds` the identity matrix is used.</li>
3911
4389
  <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>
3912
4390
  <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>
3913
4391
  <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>
@@ -5261,7 +5739,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
5261
5739
  <div class="button run">Run</div>
5262
5740
  </div>
5263
5741
 
5264
- <script type="text/paperscript" canvas="canvas-40">
5742
+ <script type="text/paperscript" canvas="canvas-43">
5265
5743
  // Create a rectangle shaped path with its top left
5266
5744
  // point at {x: 80, y: 25} and a size of {width: 50, height: 50}:
5267
5745
  var path = new Path.Rectangle(new Point(80, 25), new Size(50, 50));
@@ -5270,7 +5748,7 @@ path.fillColor = 'black';
5270
5748
  // Rotate the path by 30 degrees:
5271
5749
  path.rotate(30);
5272
5750
  </script>
5273
- <div class="canvas"><canvas width="516" height="100" id="canvas-40"></canvas></div>
5751
+ <div class="canvas"><canvas width="516" height="100" id="canvas-43"></canvas></div>
5274
5752
  </div>
5275
5753
 
5276
5754
 
@@ -5282,7 +5760,7 @@ path.rotate(30);
5282
5760
  <div class="button run">Run</div>
5283
5761
  </div>
5284
5762
 
5285
- <script type="text/paperscript" canvas="canvas-41">
5763
+ <script type="text/paperscript" canvas="canvas-44">
5286
5764
  // Create a rectangle shaped path with its top left
5287
5765
  // point at {x: 175, y: 50} and a size of {width: 100, height: 100}:
5288
5766
  var topLeft = new Point(175, 50);
@@ -5304,7 +5782,7 @@ function onFrame(event) {
5304
5782
  path.rotate(3, view.center);
5305
5783
  }
5306
5784
  </script>
5307
- <div class="canvas"><canvas width="516" height="200" id="canvas-41"></canvas></div>
5785
+ <div class="canvas"><canvas width="516" height="200" id="canvas-44"></canvas></div>
5308
5786
  </div>
5309
5787
 
5310
5788
 
@@ -5353,7 +5831,7 @@ function onFrame(event) {
5353
5831
  <div class="button run">Run</div>
5354
5832
  </div>
5355
5833
 
5356
- <script type="text/paperscript" canvas="canvas-42">
5834
+ <script type="text/paperscript" canvas="canvas-45">
5357
5835
  // Create a circle shaped path at { x: 80, y: 50 }
5358
5836
  // with a radius of 20:
5359
5837
  var circle = new Path.Circle({
@@ -5365,7 +5843,7 @@ var circle = new Path.Circle({
5365
5843
  // Scale the path by 150% from its center point
5366
5844
  circle.scale(1.5);
5367
5845
  </script>
5368
- <div class="canvas"><canvas width="516" height="100" id="canvas-42"></canvas></div>
5846
+ <div class="canvas"><canvas width="516" height="100" id="canvas-45"></canvas></div>
5369
5847
  </div>
5370
5848
 
5371
5849
 
@@ -5377,7 +5855,7 @@ circle.scale(1.5);
5377
5855
  <div class="button run">Run</div>
5378
5856
  </div>
5379
5857
 
5380
- <script type="text/paperscript" canvas="canvas-43">
5858
+ <script type="text/paperscript" canvas="canvas-46">
5381
5859
  // Create a circle shaped path at { x: 80, y: 50 }
5382
5860
  // with a radius of 20:
5383
5861
  var circle = new Path.Circle({
@@ -5389,7 +5867,7 @@ var circle = new Path.Circle({
5389
5867
  // Scale the path 150% from its bottom left corner
5390
5868
  circle.scale(1.5, circle.bounds.bottomLeft);
5391
5869
  </script>
5392
- <div class="canvas"><canvas width="516" height="100" id="canvas-43"></canvas></div>
5870
+ <div class="canvas"><canvas width="516" height="100" id="canvas-46"></canvas></div>
5393
5871
  </div>
5394
5872
 
5395
5873
 
@@ -5445,7 +5923,7 @@ circle.scale(1.5, circle.bounds.bottomLeft);
5445
5923
  <div class="button run">Run</div>
5446
5924
  </div>
5447
5925
 
5448
- <script type="text/paperscript" canvas="canvas-44">
5926
+ <script type="text/paperscript" canvas="canvas-47">
5449
5927
  // Create a circle shaped path at { x: 100, y: 50 }
5450
5928
  // with a radius of 20:
5451
5929
  var circle = new Path.Circle({
@@ -5457,7 +5935,7 @@ var circle = new Path.Circle({
5457
5935
  // Scale the path horizontally by 300%
5458
5936
  circle.scale(3, 1);
5459
5937
  </script>
5460
- <div class="canvas"><canvas width="516" height="100" id="canvas-44"></canvas></div>
5938
+ <div class="canvas"><canvas width="516" height="100" id="canvas-47"></canvas></div>
5461
5939
  </div>
5462
5940
 
5463
5941
 
@@ -5895,7 +6373,7 @@ circle.scale(3, 1);
5895
6373
  <div class="button run">Run</div>
5896
6374
  </div>
5897
6375
 
5898
- <script type="text/paperscript" canvas="canvas-45">
6376
+ <script type="text/paperscript" canvas="canvas-48">
5899
6377
  // Create a rectangle shaped path with its top left corner
5900
6378
  // at {x: 80, y: 25} and a size of {width: 75, height: 50}:
5901
6379
  var path = new Path.Rectangle({
@@ -5916,7 +6394,7 @@ var circlePath = new Path.Circle({
5916
6394
  // the rectangular path:
5917
6395
  circlePath.fitBounds(path.bounds);
5918
6396
  </script>
5919
- <div class="canvas"><canvas width="516" height="100" id="canvas-45"></canvas></div>
6397
+ <div class="canvas"><canvas width="516" height="100" id="canvas-48"></canvas></div>
5920
6398
  </div>
5921
6399
 
5922
6400
 
@@ -5928,7 +6406,7 @@ circlePath.fitBounds(path.bounds);
5928
6406
  <div class="button run">Run</div>
5929
6407
  </div>
5930
6408
 
5931
- <script type="text/paperscript" canvas="canvas-46">
6409
+ <script type="text/paperscript" canvas="canvas-49">
5932
6410
  // Create a rectangle shaped path with its top left corner
5933
6411
  // at {x: 80, y: 25} and a size of {width: 75, height: 50}:
5934
6412
  var path = new Path.Rectangle({
@@ -5949,7 +6427,7 @@ var circlePath = new Path.Circle({
5949
6427
  // the rectangular path:
5950
6428
  circlePath.fitBounds(path.bounds, 'cover');
5951
6429
  </script>
5952
- <div class="canvas"><canvas width="516" height="100" id="canvas-46"></canvas></div>
6430
+ <div class="canvas"><canvas width="516" height="100" id="canvas-49"></canvas></div>
5953
6431
  </div>
5954
6432
 
5955
6433
 
@@ -5961,7 +6439,7 @@ circlePath.fitBounds(path.bounds, 'cover');
5961
6439
  <div class="button run">Run</div>
5962
6440
  </div>
5963
6441
 
5964
- <script type="text/paperscript" canvas="canvas-47">
6442
+ <script type="text/paperscript" canvas="canvas-50">
5965
6443
  var path = new Path.Circle({
5966
6444
  center: [80, 50],
5967
6445
  radius: 30,
@@ -5971,7 +6449,7 @@ var path = new Path.Circle({
5971
6449
  // Fit the path to the bounding rectangle of the view:
5972
6450
  path.fitBounds(view.bounds);
5973
6451
  </script>
5974
- <div class="canvas"><canvas width="516" height="200" id="canvas-47"></canvas></div>
6452
+ <div class="canvas"><canvas width="516" height="200" id="canvas-50"></canvas></div>
5975
6453
  </div>
5976
6454
 
5977
6455
 
@@ -5997,7 +6475,7 @@ path.fitBounds(view.bounds);
5997
6475
  <li>
5998
6476
  <tt>type:</tt>
5999
6477
  <tt>String</tt>
6000
- &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>
6478
+ &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>
6001
6479
 
6002
6480
  </li>
6003
6481
 
@@ -6032,7 +6510,7 @@ path.fitBounds(view.bounds);
6032
6510
  <div class="button run">Run</div>
6033
6511
  </div>
6034
6512
 
6035
- <script type="text/paperscript" canvas="canvas-48">
6513
+ <script type="text/paperscript" canvas="canvas-51">
6036
6514
  // Create a circle shaped path at the center of the view:
6037
6515
  var path = new Path.Circle({
6038
6516
  center: view.center,
@@ -6050,7 +6528,7 @@ path.on('mouseleave', function() {
6050
6528
  this.fillColor = 'black';
6051
6529
  });
6052
6530
  </script>
6053
- <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>
6054
6532
  </div>
6055
6533
 
6056
6534
 
@@ -6074,7 +6552,7 @@ path.on('mouseleave', function() {
6074
6552
  <li>
6075
6553
  <tt>object:</tt>
6076
6554
  <tt>Object</tt>
6077
- &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>
6555
+ &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>
6078
6556
 
6079
6557
  </li>
6080
6558
 
@@ -6102,7 +6580,7 @@ path.on('mouseleave', function() {
6102
6580
  <div class="button run">Run</div>
6103
6581
  </div>
6104
6582
 
6105
- <script type="text/paperscript" canvas="canvas-49">
6583
+ <script type="text/paperscript" canvas="canvas-52">
6106
6584
  // Create a circle shaped path at the center of the view:
6107
6585
  var path = new Path.Circle({
6108
6586
  center: view.center,
@@ -6120,7 +6598,7 @@ path.on({
6120
6598
  }
6121
6599
  });
6122
6600
  </script>
6123
- <div class="canvas"><canvas width="516" height="100" id="canvas-49"></canvas></div>
6601
+ <div class="canvas"><canvas width="516" height="100" id="canvas-52"></canvas></div>
6124
6602
  </div>
6125
6603
 
6126
6604
 
@@ -6132,7 +6610,7 @@ path.on({
6132
6610
  <div class="button run">Run</div>
6133
6611
  </div>
6134
6612
 
6135
- <script type="text/paperscript" canvas="canvas-50">
6613
+ <script type="text/paperscript" canvas="canvas-53">
6136
6614
  var pathHandlers = {
6137
6615
  mouseenter: function(event) {
6138
6616
  this.fillColor = 'red';
@@ -6155,7 +6633,7 @@ function onMouseDown(event) {
6155
6633
  path.on(pathHandlers);
6156
6634
  }
6157
6635
  </script>
6158
- <div class="canvas"><canvas width="516" height="100" id="canvas-50"></canvas></div>
6636
+ <div class="canvas"><canvas width="516" height="100" id="canvas-53"></canvas></div>
6159
6637
  </div>
6160
6638
 
6161
6639
 
@@ -6179,7 +6657,7 @@ function onMouseDown(event) {
6179
6657
  <li>
6180
6658
  <tt>type:</tt>
6181
6659
  <tt>String</tt>
6182
- &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>
6660
+ &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>
6183
6661
 
6184
6662
  </li>
6185
6663
 
@@ -6227,7 +6705,7 @@ function onMouseDown(event) {
6227
6705
  <li>
6228
6706
  <tt>object:</tt>
6229
6707
  <tt>Object</tt>
6230
- &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>
6708
+ &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>
6231
6709
 
6232
6710
  </li>
6233
6711
 
@@ -6268,7 +6746,7 @@ function onMouseDown(event) {
6268
6746
  <li>
6269
6747
  <tt>type:</tt>
6270
6748
  <tt>String</tt>
6271
- &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>
6749
+ &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>
6272
6750
 
6273
6751
  </li>
6274
6752
 
@@ -6316,7 +6794,7 @@ function onMouseDown(event) {
6316
6794
  <li>
6317
6795
  <tt>type:</tt>
6318
6796
  <tt>String</tt>
6319
- &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>
6797
+ &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>
6320
6798
 
6321
6799
  </li>
6322
6800
 
@@ -6383,7 +6861,7 @@ function onMouseDown(event) {
6383
6861
  <div class="button run">Run</div>
6384
6862
  </div>
6385
6863
 
6386
- <script type="text/paperscript" canvas="canvas-51">
6864
+ <script type="text/paperscript" canvas="canvas-54">
6387
6865
  function onMouseDrag(event) {
6388
6866
  // Create a circle shaped path at the mouse position,
6389
6867
  // with a radius of 10:
@@ -6400,7 +6878,7 @@ function onMouseDrag(event) {
6400
6878
  });
6401
6879
  }
6402
6880
  </script>
6403
- <div class="canvas"><canvas width="516" height="200" id="canvas-51"></canvas></div>
6881
+ <div class="canvas"><canvas width="516" height="200" id="canvas-54"></canvas></div>
6404
6882
  </div>
6405
6883
 
6406
6884
 
@@ -6430,7 +6908,7 @@ function onMouseDrag(event) {
6430
6908
  <div class="button run">Run</div>
6431
6909
  </div>
6432
6910
 
6433
- <script type="text/paperscript" canvas="canvas-52">
6911
+ <script type="text/paperscript" canvas="canvas-55">
6434
6912
  function onMouseMove(event) {
6435
6913
  // Create a circle shaped path at the mouse position,
6436
6914
  // with a radius of 10:
@@ -6444,7 +6922,7 @@ function onMouseMove(event) {
6444
6922
  path.removeOnMove();
6445
6923
  }
6446
6924
  </script>
6447
- <div class="canvas"><canvas width="516" height="200" id="canvas-52"></canvas></div>
6925
+ <div class="canvas"><canvas width="516" height="200" id="canvas-55"></canvas></div>
6448
6926
  </div>
6449
6927
 
6450
6928
 
@@ -6474,7 +6952,7 @@ function onMouseMove(event) {
6474
6952
  <div class="button run">Run</div>
6475
6953
  </div>
6476
6954
 
6477
- <script type="text/paperscript" canvas="canvas-53">
6955
+ <script type="text/paperscript" canvas="canvas-56">
6478
6956
  function onMouseDown(event) {
6479
6957
  // Create a circle shaped path at the mouse position,
6480
6958
  // with a radius of 10:
@@ -6488,7 +6966,7 @@ function onMouseDown(event) {
6488
6966
  path.removeOnDown();
6489
6967
  }
6490
6968
  </script>
6491
- <div class="canvas"><canvas width="516" height="200" id="canvas-53"></canvas></div>
6969
+ <div class="canvas"><canvas width="516" height="200" id="canvas-56"></canvas></div>
6492
6970
  </div>
6493
6971
 
6494
6972
 
@@ -6518,7 +6996,7 @@ function onMouseDown(event) {
6518
6996
  <div class="button run">Run</div>
6519
6997
  </div>
6520
6998
 
6521
- <script type="text/paperscript" canvas="canvas-54">
6999
+ <script type="text/paperscript" canvas="canvas-57">
6522
7000
  function onMouseDrag(event) {
6523
7001
  // Create a circle shaped path at the mouse position,
6524
7002
  // with a radius of 10:
@@ -6532,7 +7010,7 @@ function onMouseDrag(event) {
6532
7010
  path.removeOnDrag();
6533
7011
  }
6534
7012
  </script>
6535
- <div class="canvas"><canvas width="516" height="200" id="canvas-54"></canvas></div>
7013
+ <div class="canvas"><canvas width="516" height="200" id="canvas-57"></canvas></div>
6536
7014
  </div>
6537
7015
 
6538
7016
 
@@ -6562,7 +7040,7 @@ function onMouseDrag(event) {
6562
7040
  <div class="button run">Run</div>
6563
7041
  </div>
6564
7042
 
6565
- <script type="text/paperscript" canvas="canvas-55">
7043
+ <script type="text/paperscript" canvas="canvas-58">
6566
7044
  function onMouseDown(event) {
6567
7045
  // Create a circle shaped path at the mouse position,
6568
7046
  // with a radius of 10:
@@ -6576,7 +7054,7 @@ function onMouseDown(event) {
6576
7054
  path.removeOnUp();
6577
7055
  }
6578
7056
  </script>
6579
- <div class="canvas"><canvas width="516" height="200" id="canvas-55"></canvas></div>
7057
+ <div class="canvas"><canvas width="516" height="200" id="canvas-58"></canvas></div>
6580
7058
  </div>
6581
7059
 
6582
7060
 
@@ -6649,7 +7127,7 @@ function onMouseDown(event) {
6649
7127
  <div class="button run">Run</div>
6650
7128
  </div>
6651
7129
 
6652
- <script type="text/paperscript" canvas="canvas-56">
7130
+ <script type="text/paperscript" canvas="canvas-59">
6653
7131
  var path = new Path.Circle({
6654
7132
  radius: view.bounds.height * 0.4,
6655
7133
  center: view.center
@@ -6660,7 +7138,7 @@ path.tween(
6660
7138
  3000
6661
7139
  );
6662
7140
  </script>
6663
- <div class="canvas"><canvas width="516" height="100" id="canvas-56"></canvas></div>
7141
+ <div class="canvas"><canvas width="516" height="100" id="canvas-59"></canvas></div>
6664
7142
  </div>
6665
7143
 
6666
7144
 
@@ -6672,7 +7150,7 @@ path.tween(
6672
7150
  <div class="button run">Run</div>
6673
7151
  </div>
6674
7152
 
6675
- <script type="text/paperscript" canvas="canvas-57">
7153
+ <script type="text/paperscript" canvas="canvas-60">
6676
7154
  var path = new Shape.Rectangle({
6677
7155
  fillColor: 'red',
6678
7156
  center: [50, view.center.y],
@@ -6687,7 +7165,7 @@ path.tween({
6687
7165
  duration: 2000
6688
7166
  });
6689
7167
  </script>
6690
- <div class="canvas"><canvas width="516" height="100" id="canvas-57"></canvas></div>
7168
+ <div class="canvas"><canvas width="516" height="100" id="canvas-60"></canvas></div>
6691
7169
  </div>
6692
7170
 
6693
7171
 
@@ -6753,7 +7231,7 @@ path.tween({
6753
7231
  <div class="button run">Run</div>
6754
7232
  </div>
6755
7233
 
6756
- <script type="text/paperscript" canvas="canvas-58">
7234
+ <script type="text/paperscript" canvas="canvas-61">
6757
7235
  var path = new Path.Rectangle({
6758
7236
  size: [100, 100],
6759
7237
  position: view.center,
@@ -6767,7 +7245,7 @@ path.tween({
6767
7245
  'segments[2].point.x': '-= 50'
6768
7246
  }, 3000);
6769
7247
  </script>
6770
- <div class="canvas"><canvas width="516" height="200" id="canvas-58"></canvas></div>
7248
+ <div class="canvas"><canvas width="516" height="200" id="canvas-61"></canvas></div>
6771
7249
  </div>
6772
7250
 
6773
7251
 
@@ -6826,7 +7304,7 @@ path.tween({
6826
7304
  <div class="button run">Run</div>
6827
7305
  </div>
6828
7306
 
6829
- <script type="text/paperscript" canvas="canvas-59">
7307
+ <script type="text/paperscript" canvas="canvas-62">
6830
7308
  var path = new Path.Circle({
6831
7309
  fillColor: 'blue',
6832
7310
  radius: view.bounds.height * 0.4,
@@ -6842,7 +7320,7 @@ path.tween(2000).onUpdate = function(event) {
6842
7320
  path.interpolate(pathFrom, pathTo, event.factor)
6843
7321
  };
6844
7322
  </script>
6845
- <div class="canvas"><canvas width="516" height="100" id="canvas-59"></canvas></div>
7323
+ <div class="canvas"><canvas width="516" height="100" id="canvas-62"></canvas></div>
6846
7324
  </div>
6847
7325
 
6848
7326
 
@@ -6963,7 +7441,7 @@ path.tween(2000).onUpdate = function(event) {
6963
7441
  <div class="button run">Run</div>
6964
7442
  </div>
6965
7443
 
6966
- <script type="text/paperscript" canvas="canvas-60">
7444
+ <script type="text/paperscript" canvas="canvas-63">
6967
7445
  var path = new Path.Circle({
6968
7446
  fillColor: 'blue',
6969
7447
  radius: view.bounds.height * 0.4,
@@ -6971,7 +7449,7 @@ var path = new Path.Circle({
6971
7449
  });
6972
7450
  path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
6973
7451
  </script>
6974
- <div class="canvas"><canvas width="516" height="100" id="canvas-60"></canvas></div>
7452
+ <div class="canvas"><canvas width="516" height="100" id="canvas-63"></canvas></div>
6975
7453
  </div>
6976
7454
 
6977
7455
 
@@ -8480,7 +8958,7 @@ wordsLongerThan, afterFirst, beforeLast, limit, zone, capitalized }</code>. Kept
8480
8958
 
8481
8959
  <!-- =========================== copyright notice ========================== -->
8482
8960
  <p class="footer">
8483
- Paper.js v0.16.0<br>
8961
+ Paper.js v0.17.0<br>
8484
8962
  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>
8485
8963
  <div class="content-end"></div>
8486
8964