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
@@ -284,6 +284,91 @@ text.fontSize = 16;
284
284
  <div class="reference-members"><h2>Properties inherited from <a href="../classes/Item.html"><tt>Item</tt></a></h2>
285
285
 
286
286
 
287
+ <div id="effects" class="member">
288
+ <div class="member-link">
289
+ <a name="effects" href="#effects"><tt><b>effects</b></tt></a>
290
+ </div>
291
+ <div class="member-description hidden">
292
+
293
+ <div class="member-text">
294
+ <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,
295
+ 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>
296
+ <p>Paper.js has these effects, and <a href="../classes/Effect.html"><tt>Effect</tt></a> creates more:</p>
297
+ <ul>
298
+ <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>
299
+ <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>
300
+ </ul>
301
+
302
+
303
+
304
+ <ul class="member-list">
305
+ <h4>Type:</h4>
306
+ <li>
307
+ Array of <a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a> objects
308
+ </li>
309
+ </ul>
310
+
311
+
312
+ <h4>Example:</h4>
313
+
314
+ <div class="paperscript split">
315
+
316
+ <div class="buttons">
317
+ <div class="button run">Run</div>
318
+ </div>
319
+
320
+ <script type="text/paperscript" canvas="canvas-1">
321
+ var path = new Path.Star({
322
+ center: view.center,
323
+ points: 5,
324
+ radius1: 20,
325
+ radius2: 40,
326
+ strokeColor: 'black',
327
+ strokeWidth: 8
328
+ });
329
+ path.effects = [
330
+ { type: 'offset', parameters: { distance: 10, join: 'round' } },
331
+ { type: 'outline' }
332
+ ];
333
+ </script>
334
+ <div class="canvas"><canvas width="516" height="100" id="canvas-1"></canvas></div>
335
+ </div>
336
+
337
+
338
+ </div>
339
+
340
+ </div>
341
+ </div>
342
+
343
+
344
+ <div id="previewbounds-matrix" class="member">
345
+ <div class="member-link">
346
+ <a name="previewbounds-matrix" href="#previewbounds-matrix"><tt><b>previewBounds</b></tt></a>
347
+ </div>
348
+ <div class="member-description hidden">
349
+
350
+ <div class="member-text">
351
+ <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>
352
+
353
+ <p>Read only.</p>
354
+
355
+
356
+
357
+ <ul class="member-list">
358
+ <h4>Type:</h4>
359
+ <li>
360
+ <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
361
+ </li>
362
+ </ul>
363
+
364
+
365
+
366
+ </div>
367
+
368
+ </div>
369
+ </div>
370
+
371
+
287
372
  <div id="key" class="member">
288
373
  <div class="member-link">
289
374
  <a name="key" href="#key"><tt><b>key</b></tt></a>
@@ -396,7 +481,7 @@ text.fontSize = 16;
396
481
  <div class="button run">Run</div>
397
482
  </div>
398
483
 
399
- <script type="text/paperscript" canvas="canvas-1">
484
+ <script type="text/paperscript" canvas="canvas-2">
400
485
  var path = new Path.Circle({
401
486
  center: [80, 50],
402
487
  radius: 35
@@ -411,7 +496,7 @@ group.addChild(path);
411
496
  // The path can be accessed by name:
412
497
  group.children['example'].fillColor = 'red';
413
498
  </script>
414
- <div class="canvas"><canvas width="516" height="100" id="canvas-1"></canvas></div>
499
+ <div class="canvas"><canvas width="516" height="100" id="canvas-2"></canvas></div>
415
500
  </div>
416
501
 
417
502
 
@@ -449,7 +534,7 @@ group.children['example'].fillColor = 'red';
449
534
  <div class="button run">Run</div>
450
535
  </div>
451
536
 
452
- <script type="text/paperscript" canvas="canvas-2">
537
+ <script type="text/paperscript" canvas="canvas-3">
453
538
  var circle = new Path.Circle({
454
539
  center: [80, 50],
455
540
  radius: 30
@@ -460,7 +545,7 @@ circle.style = {
460
545
  strokeWidth: 5
461
546
  };
462
547
  </script>
463
- <div class="canvas"><canvas width="516" height="100" id="canvas-2"></canvas></div>
548
+ <div class="canvas"><canvas width="516" height="100" id="canvas-3"></canvas></div>
464
549
  </div>
465
550
 
466
551
 
@@ -472,7 +557,7 @@ circle.style = {
472
557
  <div class="button run">Run</div>
473
558
  </div>
474
559
 
475
- <script type="text/paperscript" canvas="canvas-3">
560
+ <script type="text/paperscript" canvas="canvas-4">
476
561
  var path = new Path.Circle({
477
562
  center: [50, 50],
478
563
  radius: 30,
@@ -487,7 +572,7 @@ var path2 = new Path.Circle({
487
572
  // Copy the path style of path:
488
573
  path2.style = path.style;
489
574
  </script>
490
- <div class="canvas"><canvas width="516" height="100" id="canvas-3"></canvas></div>
575
+ <div class="canvas"><canvas width="516" height="100" id="canvas-4"></canvas></div>
491
576
  </div>
492
577
 
493
578
 
@@ -499,7 +584,7 @@ path2.style = path.style;
499
584
  <div class="button run">Run</div>
500
585
  </div>
501
586
 
502
- <script type="text/paperscript" canvas="canvas-4">
587
+ <script type="text/paperscript" canvas="canvas-5">
503
588
  var myStyle = {
504
589
  fillColor: 'red',
505
590
  strokeColor: 'blue',
@@ -518,7 +603,7 @@ var path2 = new Path.Circle({
518
603
  });
519
604
  path2.style = myStyle;
520
605
  </script>
521
- <div class="canvas"><canvas width="516" height="100" id="canvas-4"></canvas></div>
606
+ <div class="canvas"><canvas width="516" height="100" id="canvas-5"></canvas></div>
522
607
  </div>
523
608
 
524
609
 
@@ -560,7 +645,7 @@ path2.style = myStyle;
560
645
  <div class="button run">Run</div>
561
646
  </div>
562
647
 
563
- <script type="text/paperscript" canvas="canvas-5">
648
+ <script type="text/paperscript" canvas="canvas-6">
564
649
  var unlockedItem = new Path.Circle({
565
650
  center: view.center - [35, 0],
566
651
  radius: 30,
@@ -587,7 +672,7 @@ new PointText({
587
672
  justification: 'center'
588
673
  });
589
674
  </script>
590
- <div class="canvas"><canvas width="516" height="100" id="canvas-5"></canvas></div>
675
+ <div class="canvas"><canvas width="516" height="100" id="canvas-6"></canvas></div>
591
676
  </div>
592
677
 
593
678
 
@@ -629,7 +714,7 @@ new PointText({
629
714
  <div class="button run">Run</div>
630
715
  </div>
631
716
 
632
- <script type="text/paperscript" canvas="canvas-6">
717
+ <script type="text/paperscript" canvas="canvas-7">
633
718
  var path = new Path.Circle({
634
719
  center: [50, 50],
635
720
  radius: 20,
@@ -639,7 +724,7 @@ var path = new Path.Circle({
639
724
  // Hide the path:
640
725
  path.visible = false;
641
726
  </script>
642
- <div class="canvas"><canvas width="516" height="100" id="canvas-6"></canvas></div>
727
+ <div class="canvas"><canvas width="516" height="100" id="canvas-7"></canvas></div>
643
728
  </div>
644
729
 
645
730
 
@@ -687,7 +772,7 @@ path.visible = false;
687
772
  <div class="button run">Run</div>
688
773
  </div>
689
774
 
690
- <script type="text/paperscript" canvas="canvas-7">
775
+ <script type="text/paperscript" canvas="canvas-8">
691
776
  // Create a white rectangle in the background
692
777
  // with the same dimensions as the view:
693
778
  var background = new Path.Rectangle(view.bounds);
@@ -708,7 +793,7 @@ var circle2 = new Path.Circle({
708
793
  // Set the blend mode of circle2:
709
794
  circle2.blendMode = 'multiply';
710
795
  </script>
711
- <div class="canvas"><canvas width="516" height="100" id="canvas-7"></canvas></div>
796
+ <div class="canvas"><canvas width="516" height="100" id="canvas-8"></canvas></div>
712
797
  </div>
713
798
 
714
799
 
@@ -750,7 +835,7 @@ circle2.blendMode = 'multiply';
750
835
  <div class="button run">Run</div>
751
836
  </div>
752
837
 
753
- <script type="text/paperscript" canvas="canvas-8">
838
+ <script type="text/paperscript" canvas="canvas-9">
754
839
  var circle = new Path.Circle({
755
840
  center: [80, 50],
756
841
  radius: 35,
@@ -768,7 +853,7 @@ var circle2 = new Path.Circle({
768
853
  // Make circle2 50% transparent:
769
854
  circle2.opacity = 0.5;
770
855
  </script>
771
- <div class="canvas"><canvas width="516" height="100" id="canvas-8"></canvas></div>
856
+ <div class="canvas"><canvas width="516" height="100" id="canvas-9"></canvas></div>
772
857
  </div>
773
858
 
774
859
 
@@ -891,14 +976,14 @@ circle.textWrap = { offset: 10 };</code></pre>
891
976
  <div class="button run">Run</div>
892
977
  </div>
893
978
 
894
- <script type="text/paperscript" canvas="canvas-9">
979
+ <script type="text/paperscript" canvas="canvas-10">
895
980
  var path = new Path.Circle({
896
981
  center: [80, 50],
897
982
  radius: 35
898
983
  });
899
984
  path.selected = true; // Select the path
900
985
  </script>
901
- <div class="canvas"><canvas width="516" height="100" id="canvas-9"></canvas></div>
986
+ <div class="canvas"><canvas width="516" height="100" id="canvas-10"></canvas></div>
902
987
  </div>
903
988
 
904
989
 
@@ -1055,7 +1140,7 @@ console.log(path.data.pets.length); // 1</code></pre>
1055
1140
  <div class="button run">Run</div>
1056
1141
  </div>
1057
1142
 
1058
- <script type="text/paperscript" canvas="canvas-10">
1143
+ <script type="text/paperscript" canvas="canvas-11">
1059
1144
  // Create a circle at position { x: 10, y: 10 }
1060
1145
  var circle = new Path.Circle({
1061
1146
  center: new Point(10, 10),
@@ -1069,7 +1154,7 @@ circle.position = new Point(20, 20);
1069
1154
  // Move the circle 100 points to the right and 50 points down
1070
1155
  circle.position += new Point(100, 50);
1071
1156
  </script>
1072
- <div class="canvas"><canvas width="516" height="100" id="canvas-10"></canvas></div>
1157
+ <div class="canvas"><canvas width="516" height="100" id="canvas-11"></canvas></div>
1073
1158
  </div>
1074
1159
 
1075
1160
 
@@ -1081,7 +1166,7 @@ circle.position += new Point(100, 50);
1081
1166
  <div class="button run">Run</div>
1082
1167
  </div>
1083
1168
 
1084
- <script type="text/paperscript" canvas="canvas-11">
1169
+ <script type="text/paperscript" canvas="canvas-12">
1085
1170
  // Create a circle at position { x: 20, y: 20 }
1086
1171
  var circle = new Path.Circle({
1087
1172
  center: new Point(20, 20),
@@ -1092,7 +1177,7 @@ var circle = new Path.Circle({
1092
1177
  // Move the circle 100 points to the right
1093
1178
  circle.position.x += 100;
1094
1179
  </script>
1095
- <div class="canvas"><canvas width="516" height="100" id="canvas-11"></canvas></div>
1180
+ <div class="canvas"><canvas width="516" height="100" id="canvas-12"></canvas></div>
1096
1181
  </div>
1097
1182
 
1098
1183
 
@@ -1618,7 +1703,7 @@ console.log(group.children[0] == path); // true</code></pre>
1618
1703
  <div class="button run">Run</div>
1619
1704
  </div>
1620
1705
 
1621
- <script type="text/paperscript" canvas="canvas-12">
1706
+ <script type="text/paperscript" canvas="canvas-13">
1622
1707
  var path = new Path.Circle({
1623
1708
  center: [80, 50],
1624
1709
  radius: 35
@@ -1631,7 +1716,7 @@ group.addChild(path);
1631
1716
  // Access the path through the group's children array:
1632
1717
  group.children[0].fillColor = 'red';
1633
1718
  </script>
1634
- <div class="canvas"><canvas width="516" height="100" id="canvas-12"></canvas></div>
1719
+ <div class="canvas"><canvas width="516" height="100" id="canvas-13"></canvas></div>
1635
1720
  </div>
1636
1721
 
1637
1722
 
@@ -1643,7 +1728,7 @@ group.children[0].fillColor = 'red';
1643
1728
  <div class="button run">Run</div>
1644
1729
  </div>
1645
1730
 
1646
- <script type="text/paperscript" canvas="canvas-13">
1731
+ <script type="text/paperscript" canvas="canvas-14">
1647
1732
  var path = new Path.Circle({
1648
1733
  center: [80, 50],
1649
1734
  radius: 35
@@ -1658,7 +1743,7 @@ group.addChild(path);
1658
1743
  // The path can be accessed by name:
1659
1744
  group.children['example'].fillColor = 'orange';
1660
1745
  </script>
1661
- <div class="canvas"><canvas width="516" height="100" id="canvas-13"></canvas></div>
1746
+ <div class="canvas"><canvas width="516" height="100" id="canvas-14"></canvas></div>
1662
1747
  </div>
1663
1748
 
1664
1749
 
@@ -1670,7 +1755,7 @@ group.children['example'].fillColor = 'orange';
1670
1755
  <div class="button run">Run</div>
1671
1756
  </div>
1672
1757
 
1673
- <script type="text/paperscript" canvas="canvas-14">
1758
+ <script type="text/paperscript" canvas="canvas-15">
1674
1759
  var path = new Path.Circle({
1675
1760
  center: [80, 50],
1676
1761
  radius: 35
@@ -1682,7 +1767,7 @@ group.children = [path];
1682
1767
  // The path is the first child of the group:
1683
1768
  group.firstChild.fillColor = 'green';
1684
1769
  </script>
1685
- <div class="canvas"><canvas width="516" height="100" id="canvas-14"></canvas></div>
1770
+ <div class="canvas"><canvas width="516" height="100" id="canvas-15"></canvas></div>
1686
1771
  </div>
1687
1772
 
1688
1773
 
@@ -1859,7 +1944,7 @@ group.firstChild.fillColor = 'green';
1859
1944
  <div class="button run">Run</div>
1860
1945
  </div>
1861
1946
 
1862
- <script type="text/paperscript" canvas="canvas-15">
1947
+ <script type="text/paperscript" canvas="canvas-16">
1863
1948
  // Create a circle shaped path at { x: 80, y: 50 }
1864
1949
  // with a radius of 35:
1865
1950
  var circle = new Path.Circle({
@@ -1870,7 +1955,7 @@ var circle = new Path.Circle({
1870
1955
  // Set its stroke color to RGB red:
1871
1956
  circle.strokeColor = new Color(1, 0, 0);
1872
1957
  </script>
1873
- <div class="canvas"><canvas width="516" height="100" id="canvas-15"></canvas></div>
1958
+ <div class="canvas"><canvas width="516" height="100" id="canvas-16"></canvas></div>
1874
1959
  </div>
1875
1960
 
1876
1961
 
@@ -1907,7 +1992,7 @@ circle.strokeColor = new Color(1, 0, 0);
1907
1992
  <div class="button run">Run</div>
1908
1993
  </div>
1909
1994
 
1910
- <script type="text/paperscript" canvas="canvas-16">
1995
+ <script type="text/paperscript" canvas="canvas-17">
1911
1996
  // Create a circle shaped path at { x: 80, y: 50 }
1912
1997
  // with a radius of 35:
1913
1998
  var circle = new Path.Circle({
@@ -1919,7 +2004,7 @@ var circle = new Path.Circle({
1919
2004
  // Set its stroke width to 10:
1920
2005
  circle.strokeWidth = 10;
1921
2006
  </script>
1922
- <div class="canvas"><canvas width="516" height="100" id="canvas-16"></canvas></div>
2007
+ <div class="canvas"><canvas width="516" height="100" id="canvas-17"></canvas></div>
1923
2008
  </div>
1924
2009
 
1925
2010
 
@@ -1966,7 +2051,7 @@ circle.strokeWidth = 10;
1966
2051
  <div class="button run">Run</div>
1967
2052
  </div>
1968
2053
 
1969
- <script type="text/paperscript" canvas="canvas-17">
2054
+ <script type="text/paperscript" canvas="canvas-18">
1970
2055
  var line = new Path({
1971
2056
  segments: [[80, 50], [420, 50]],
1972
2057
  strokeColor: 'black',
@@ -1987,7 +2072,7 @@ var line2 = line.clone();
1987
2072
  line2.position.y += 100;
1988
2073
  line2.strokeCap = 'butt';
1989
2074
  </script>
1990
- <div class="canvas"><canvas width="516" height="200" id="canvas-17"></canvas></div>
2075
+ <div class="canvas"><canvas width="516" height="200" id="canvas-18"></canvas></div>
1991
2076
  </div>
1992
2077
 
1993
2078
 
@@ -2034,7 +2119,7 @@ line2.strokeCap = 'butt';
2034
2119
  <div class="button run">Run</div>
2035
2120
  </div>
2036
2121
 
2037
- <script type="text/paperscript" canvas="canvas-18">
2122
+ <script type="text/paperscript" canvas="canvas-19">
2038
2123
  var path = new Path({
2039
2124
  segments: [[80, 100], [120, 40], [160, 100]],
2040
2125
  strokeColor: 'black',
@@ -2051,7 +2136,7 @@ var path3 = path2.clone();
2051
2136
  path3.position.x += path3.bounds.width * 1.5;
2052
2137
  path3.strokeJoin = 'bevel';
2053
2138
  </script>
2054
- <div class="canvas"><canvas width="516" height="120" id="canvas-18"></canvas></div>
2139
+ <div class="canvas"><canvas width="516" height="120" id="canvas-19"></canvas></div>
2055
2140
  </div>
2056
2141
 
2057
2142
 
@@ -2155,7 +2240,7 @@ path3.strokeJoin = 'bevel';
2155
2240
  <div class="button run">Run</div>
2156
2241
  </div>
2157
2242
 
2158
- <script type="text/paperscript" canvas="canvas-19">
2243
+ <script type="text/paperscript" canvas="canvas-20">
2159
2244
  var path = new Path.Circle({
2160
2245
  center: [80, 50],
2161
2246
  radius: 40,
@@ -2166,7 +2251,7 @@ var path = new Path.Circle({
2166
2251
  // Set the dashed stroke to [10pt dash, 4pt gap]:
2167
2252
  path.dashArray = [10, 4];
2168
2253
  </script>
2169
- <div class="canvas"><canvas width="516" height="100" id="canvas-19"></canvas></div>
2254
+ <div class="canvas"><canvas width="516" height="100" id="canvas-20"></canvas></div>
2170
2255
  </div>
2171
2256
 
2172
2257
 
@@ -2272,7 +2357,7 @@ path.dashArray = [10, 4];
2272
2357
  <div class="button run">Run</div>
2273
2358
  </div>
2274
2359
 
2275
- <script type="text/paperscript" canvas="canvas-20">
2360
+ <script type="text/paperscript" canvas="canvas-21">
2276
2361
  // Create a circle shaped path at { x: 80, y: 50 }
2277
2362
  // with a radius of 35:
2278
2363
  var circle = new Path.Circle({
@@ -2283,7 +2368,7 @@ var circle = new Path.Circle({
2283
2368
  // Set the fill color of the circle to RGB red:
2284
2369
  circle.fillColor = new Color(1, 0, 0);
2285
2370
  </script>
2286
- <div class="canvas"><canvas width="516" height="100" id="canvas-20"></canvas></div>
2371
+ <div class="canvas"><canvas width="516" height="100" id="canvas-21"></canvas></div>
2287
2372
  </div>
2288
2373
 
2289
2374
 
@@ -2358,7 +2443,7 @@ circle.fillColor = new Color(1, 0, 0);
2358
2443
  <div class="button run">Run</div>
2359
2444
  </div>
2360
2445
 
2361
- <script type="text/paperscript" canvas="canvas-21">
2446
+ <script type="text/paperscript" canvas="canvas-22">
2362
2447
  var circle = new Path.Circle({
2363
2448
  center: [80, 50],
2364
2449
  radius: 35,
@@ -2371,7 +2456,7 @@ var circle = new Path.Circle({
2371
2456
  shadowOffset: new Point(5, 5)
2372
2457
  });
2373
2458
  </script>
2374
- <div class="canvas"><canvas width="516" height="100" id="canvas-21"></canvas></div>
2459
+ <div class="canvas"><canvas width="516" height="100" id="canvas-22"></canvas></div>
2375
2460
  </div>
2376
2461
 
2377
2462
 
@@ -2512,7 +2597,7 @@ var circle = new Path.Circle({
2512
2597
  <div class="button run">Run</div>
2513
2598
  </div>
2514
2599
 
2515
- <script type="text/paperscript" canvas="canvas-22">
2600
+ <script type="text/paperscript" canvas="canvas-23">
2516
2601
  // Create a rectangle shaped path with its top left point at:
2517
2602
  // {x: 50, y: 25} and a size of {width: 50, height: 50}
2518
2603
  var path = new Path.Rectangle(new Point(50, 25), new Size(50, 50));
@@ -2523,7 +2608,7 @@ path.onFrame = function(event) {
2523
2608
  this.rotate(3);
2524
2609
  }
2525
2610
  </script>
2526
- <div class="canvas"><canvas width="516" height="100" id="canvas-22"></canvas></div>
2611
+ <div class="canvas"><canvas width="516" height="100" id="canvas-23"></canvas></div>
2527
2612
  </div>
2528
2613
 
2529
2614
 
@@ -2567,7 +2652,7 @@ path.onFrame = function(event) {
2567
2652
  <div class="button run">Run</div>
2568
2653
  </div>
2569
2654
 
2570
- <script type="text/paperscript" canvas="canvas-23">
2655
+ <script type="text/paperscript" canvas="canvas-24">
2571
2656
  // Create a circle shaped path at the center of the view:
2572
2657
  var path = new Path.Circle({
2573
2658
  center: view.center,
@@ -2581,7 +2666,7 @@ path.onMouseDown = function(event) {
2581
2666
  this.fillColor = 'red';
2582
2667
  }
2583
2668
  </script>
2584
- <div class="canvas"><canvas width="516" height="100" id="canvas-23"></canvas></div>
2669
+ <div class="canvas"><canvas width="516" height="100" id="canvas-24"></canvas></div>
2585
2670
  </div>
2586
2671
 
2587
2672
 
@@ -2593,7 +2678,7 @@ path.onMouseDown = function(event) {
2593
2678
  <div class="button run">Run</div>
2594
2679
  </div>
2595
2680
 
2596
- <script type="text/paperscript" canvas="canvas-24">
2681
+ <script type="text/paperscript" canvas="canvas-25">
2597
2682
  // Loop 30 times:
2598
2683
  for (var i = 0; i < 30; i++) {
2599
2684
  // Create a circle shaped path at a random position
@@ -2611,7 +2696,7 @@ for (var i = 0; i < 30; i++) {
2611
2696
  }
2612
2697
  }
2613
2698
  </script>
2614
- <div class="canvas"><canvas width="516" height="100" id="canvas-24"></canvas></div>
2699
+ <div class="canvas"><canvas width="516" height="100" id="canvas-25"></canvas></div>
2615
2700
  </div>
2616
2701
 
2617
2702
 
@@ -2655,7 +2740,7 @@ for (var i = 0; i < 30; i++) {
2655
2740
  <div class="button run">Run</div>
2656
2741
  </div>
2657
2742
 
2658
- <script type="text/paperscript" canvas="canvas-25">
2743
+ <script type="text/paperscript" canvas="canvas-26">
2659
2744
  // Create a circle shaped path at the center of the view:
2660
2745
  var path = new Path.Circle({
2661
2746
  center: view.center,
@@ -2668,7 +2753,7 @@ path.onMouseDrag = function(event) {
2668
2753
  path.position += event.delta;
2669
2754
  }
2670
2755
  </script>
2671
- <div class="canvas"><canvas width="516" height="240" id="canvas-25"></canvas></div>
2756
+ <div class="canvas"><canvas width="516" height="240" id="canvas-26"></canvas></div>
2672
2757
  </div>
2673
2758
 
2674
2759
 
@@ -2712,7 +2797,7 @@ path.onMouseDrag = function(event) {
2712
2797
  <div class="button run">Run</div>
2713
2798
  </div>
2714
2799
 
2715
- <script type="text/paperscript" canvas="canvas-26">
2800
+ <script type="text/paperscript" canvas="canvas-27">
2716
2801
  // Create a circle shaped path at the center of the view:
2717
2802
  var path = new Path.Circle({
2718
2803
  center: view.center,
@@ -2726,7 +2811,7 @@ path.onMouseUp = function(event) {
2726
2811
  this.fillColor = 'red';
2727
2812
  }
2728
2813
  </script>
2729
- <div class="canvas"><canvas width="516" height="100" id="canvas-26"></canvas></div>
2814
+ <div class="canvas"><canvas width="516" height="100" id="canvas-27"></canvas></div>
2730
2815
  </div>
2731
2816
 
2732
2817
 
@@ -2770,7 +2855,7 @@ path.onMouseUp = function(event) {
2770
2855
  <div class="button run">Run</div>
2771
2856
  </div>
2772
2857
 
2773
- <script type="text/paperscript" canvas="canvas-27">
2858
+ <script type="text/paperscript" canvas="canvas-28">
2774
2859
  // Create a circle shaped path at the center of the view:
2775
2860
  var path = new Path.Circle({
2776
2861
  center: view.center,
@@ -2784,7 +2869,7 @@ path.onClick = function(event) {
2784
2869
  this.fillColor = 'red';
2785
2870
  }
2786
2871
  </script>
2787
- <div class="canvas"><canvas width="516" height="100" id="canvas-27"></canvas></div>
2872
+ <div class="canvas"><canvas width="516" height="100" id="canvas-28"></canvas></div>
2788
2873
  </div>
2789
2874
 
2790
2875
 
@@ -2796,7 +2881,7 @@ path.onClick = function(event) {
2796
2881
  <div class="button run">Run</div>
2797
2882
  </div>
2798
2883
 
2799
- <script type="text/paperscript" canvas="canvas-28">
2884
+ <script type="text/paperscript" canvas="canvas-29">
2800
2885
  // Loop 30 times:
2801
2886
  for (var i = 0; i < 30; i++) {
2802
2887
  // Create a circle shaped path at a random position
@@ -2814,7 +2899,7 @@ for (var i = 0; i < 30; i++) {
2814
2899
  }
2815
2900
  }
2816
2901
  </script>
2817
- <div class="canvas"><canvas width="516" height="100" id="canvas-28"></canvas></div>
2902
+ <div class="canvas"><canvas width="516" height="100" id="canvas-29"></canvas></div>
2818
2903
  </div>
2819
2904
 
2820
2905
 
@@ -2858,7 +2943,7 @@ for (var i = 0; i < 30; i++) {
2858
2943
  <div class="button run">Run</div>
2859
2944
  </div>
2860
2945
 
2861
- <script type="text/paperscript" canvas="canvas-29">
2946
+ <script type="text/paperscript" canvas="canvas-30">
2862
2947
  // Create a circle shaped path at the center of the view:
2863
2948
  var path = new Path.Circle({
2864
2949
  center: view.center,
@@ -2872,7 +2957,7 @@ path.onDoubleClick = function(event) {
2872
2957
  this.fillColor = 'red';
2873
2958
  }
2874
2959
  </script>
2875
- <div class="canvas"><canvas width="516" height="100" id="canvas-29"></canvas></div>
2960
+ <div class="canvas"><canvas width="516" height="100" id="canvas-30"></canvas></div>
2876
2961
  </div>
2877
2962
 
2878
2963
 
@@ -2884,7 +2969,7 @@ path.onDoubleClick = function(event) {
2884
2969
  <div class="button run">Run</div>
2885
2970
  </div>
2886
2971
 
2887
- <script type="text/paperscript" canvas="canvas-30">
2972
+ <script type="text/paperscript" canvas="canvas-31">
2888
2973
  // Loop 30 times:
2889
2974
  for (var i = 0; i < 30; i++) {
2890
2975
  // Create a circle shaped path at a random position
@@ -2902,7 +2987,7 @@ for (var i = 0; i < 30; i++) {
2902
2987
  }
2903
2988
  }
2904
2989
  </script>
2905
- <div class="canvas"><canvas width="516" height="100" id="canvas-30"></canvas></div>
2990
+ <div class="canvas"><canvas width="516" height="100" id="canvas-31"></canvas></div>
2906
2991
  </div>
2907
2992
 
2908
2993
 
@@ -2946,7 +3031,7 @@ for (var i = 0; i < 30; i++) {
2946
3031
  <div class="button run">Run</div>
2947
3032
  </div>
2948
3033
 
2949
- <script type="text/paperscript" canvas="canvas-31">
3034
+ <script type="text/paperscript" canvas="canvas-32">
2950
3035
  // Create a circle shaped path at the center of the view:
2951
3036
  var path = new Path.Circle({
2952
3037
  center: view.center,
@@ -2954,180 +3039,567 @@ for (var i = 0; i < 30; i++) {
2954
3039
  fillColor: 'black'
2955
3040
  });
2956
3041
 
2957
- // When the mouse moves on top of the item, set its opacity
2958
- // to a random value between 0 and 1:
2959
- path.onMouseMove = function(event) {
2960
- this.opacity = Math.random();
2961
- }
2962
- </script>
2963
- <div class="canvas"><canvas width="516" height="100" id="canvas-31"></canvas></div>
2964
- </div>
3042
+ // When the mouse moves on top of the item, set its opacity
3043
+ // to a random value between 0 and 1:
3044
+ path.onMouseMove = function(event) {
3045
+ this.opacity = Math.random();
3046
+ }
3047
+ </script>
3048
+ <div class="canvas"><canvas width="516" height="100" id="canvas-32"></canvas></div>
3049
+ </div>
3050
+
3051
+
3052
+ </div>
3053
+
3054
+ </div>
3055
+ </div>
3056
+
3057
+
3058
+ <div id="onmouseenter" class="member">
3059
+ <div class="member-link">
3060
+ <a name="onmouseenter" href="#onmouseenter"><tt><b>onMouseEnter</b></tt></a>
3061
+ </div>
3062
+ <div class="member-description hidden">
3063
+
3064
+ <div class="member-text">
3065
+ <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>
3066
+
3067
+
3068
+
3069
+ <ul class="member-list">
3070
+ <h4>Type:</h4>
3071
+ <li>
3072
+ <tt>Function</tt>⟋<tt>null</tt>
3073
+ </li>
3074
+ </ul>
3075
+
3076
+
3077
+ <ul class="member-list">
3078
+ <h4>See also:</h4>
3079
+
3080
+ <li><tt><a href="../classes/View.html#onmouseenter"><tt>view.onMouseEnter</tt></a></tt></li>
3081
+
3082
+ </ul>
3083
+
3084
+ <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>
3085
+
3086
+ <div class="paperscript split">
3087
+
3088
+ <div class="buttons">
3089
+ <div class="button run">Run</div>
3090
+ </div>
3091
+
3092
+ <script type="text/paperscript" canvas="canvas-33">
3093
+ // Create a circle shaped path at the center of the view:
3094
+ var path = new Path.Circle({
3095
+ center: view.center,
3096
+ radius: 25,
3097
+ fillColor: 'black'
3098
+ });
3099
+
3100
+ // When the mouse enters the item, set its fill color to red:
3101
+ path.onMouseEnter = function(event) {
3102
+ this.fillColor = 'red';
3103
+ }
3104
+
3105
+ // When the mouse leaves the item, set its fill color to black:
3106
+ path.onMouseLeave = function(event) {
3107
+ this.fillColor = 'black';
3108
+ }
3109
+ </script>
3110
+ <div class="canvas"><canvas width="516" height="100" id="canvas-33"></canvas></div>
3111
+ </div>
3112
+
3113
+
3114
+ <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>
3115
+
3116
+ <div class="paperscript split">
3117
+
3118
+ <div class="buttons">
3119
+ <div class="button run">Run</div>
3120
+ </div>
3121
+
3122
+ <script type="text/paperscript" canvas="canvas-34">
3123
+ function enter(event) {
3124
+ this.fillColor = 'red';
3125
+ }
3126
+
3127
+ function leave(event) {
3128
+ this.fillColor = 'black';
3129
+ }
3130
+
3131
+ // When the mouse is pressed:
3132
+ function onMouseDown(event) {
3133
+ // Create a circle shaped path at the position of the mouse:
3134
+ var path = new Path.Circle(event.point, 25);
3135
+ path.fillColor = 'black';
3136
+
3137
+ // When the mouse enters the item, set its fill color to red:
3138
+ path.onMouseEnter = enter;
3139
+
3140
+ // When the mouse leaves the item, set its fill color to black:
3141
+ path.onMouseLeave = leave;
3142
+ }
3143
+ </script>
3144
+ <div class="canvas"><canvas width="516" height="100" id="canvas-34"></canvas></div>
3145
+ </div>
3146
+
3147
+
3148
+ </div>
3149
+
3150
+ </div>
3151
+ </div>
3152
+
3153
+
3154
+ <div id="onmouseleave" class="member">
3155
+ <div class="member-link">
3156
+ <a name="onmouseleave" href="#onmouseleave"><tt><b>onMouseLeave</b></tt></a>
3157
+ </div>
3158
+ <div class="member-description hidden">
3159
+
3160
+ <div class="member-text">
3161
+ <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>
3162
+
3163
+
3164
+
3165
+ <ul class="member-list">
3166
+ <h4>Type:</h4>
3167
+ <li>
3168
+ <tt>Function</tt>⟋<tt>null</tt>
3169
+ </li>
3170
+ </ul>
3171
+
3172
+
3173
+ <ul class="member-list">
3174
+ <h4>See also:</h4>
3175
+
3176
+ <li><tt><a href="../classes/View.html#onmouseleave"><tt>view.onMouseLeave</tt></a></tt></li>
3177
+
3178
+ </ul>
3179
+
3180
+ <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>
3181
+
3182
+ <div class="paperscript split">
3183
+
3184
+ <div class="buttons">
3185
+ <div class="button run">Run</div>
3186
+ </div>
3187
+
3188
+ <script type="text/paperscript" canvas="canvas-35">
3189
+ // Create a circle shaped path at the center of the view:
3190
+ var path = new Path.Circle({
3191
+ center: view.center,
3192
+ radius: 25,
3193
+ fillColor: 'black'
3194
+ });
3195
+
3196
+ // When the mouse leaves the item, set its fill color to red:
3197
+ path.onMouseLeave = function(event) {
3198
+ this.fillColor = 'red';
3199
+ }
3200
+ </script>
3201
+ <div class="canvas"><canvas width="516" height="100" id="canvas-35"></canvas></div>
3202
+ </div>
3203
+
3204
+
3205
+ </div>
3206
+
3207
+ </div>
3208
+ </div>
3209
+
3210
+
3211
+ <div id="ondraw" class="member">
3212
+ <div class="member-link">
3213
+ <a name="ondraw" href="#ondraw"><tt><b>onDraw</b></tt></a>
3214
+ </div>
3215
+ <div class="member-description hidden">
3216
+
3217
+ <div class="member-text">
3218
+ <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>
3219
+
3220
+
3221
+
3222
+ <ul class="member-list">
3223
+ <h4>Type:</h4>
3224
+ <li>
3225
+ <tt>Function</tt>⟋<tt>null</tt>
3226
+ </li>
3227
+ </ul>
3228
+ <ul class="member-list">
3229
+ <h4>Options:</h4>
3230
+ <li><tt>event.item: <a href="../classes/Item.html"><tt>Item</tt></a></tt> &mdash; the item that is drawn</li>
3231
+ <li><tt>event.context: <tt>CanvasRenderingContext2D</tt></tt> &mdash; the canvas context, transformed into the item&rsquo;s coordinates</li>
3232
+ <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>
3233
+ <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>
3234
+ <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>()
3235
+ 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>
3236
+ </ul>
3237
+
3238
+ <h4>Example:<span class="description">Draw a hairline cross through the center of a circle, beneath it:</span></h4>
3239
+
3240
+ <div class="paperscript split">
3241
+
3242
+ <div class="buttons">
3243
+ <div class="button run">Run</div>
3244
+ </div>
3245
+
3246
+ <script type="text/paperscript" canvas="canvas-36">
3247
+ var path = new Path.Circle({
3248
+ center: view.center,
3249
+ radius: 25,
3250
+ fillColor: 'rgba(255, 0, 0, 0.5)'
3251
+ });
3252
+
3253
+ path.onDraw = function(event) {
3254
+ var ctx = event.context,
3255
+ center = this.position,
3256
+ scale = event.matrix.scaling.x;
3257
+ ctx.beginPath();
3258
+ ctx.moveTo(center.x - 40, center.y);
3259
+ ctx.lineTo(center.x + 40, center.y);
3260
+ ctx.moveTo(center.x, center.y - 40);
3261
+ ctx.lineTo(center.x, center.y + 40);
3262
+ ctx.lineWidth = 1 / scale;
3263
+ ctx.stroke();
3264
+ }
3265
+ </script>
3266
+ <div class="canvas"><canvas width="516" height="100" id="canvas-36"></canvas></div>
3267
+ </div>
3268
+
3269
+
3270
+ </div>
3271
+
3272
+ </div>
3273
+ </div>
3274
+
3275
+
3276
+ <div id="ondrawselection" class="member">
3277
+ <div class="member-link">
3278
+ <a name="ondrawselection" href="#ondrawselection"><tt><b>onDrawSelection</b></tt></a>
3279
+ </div>
3280
+ <div class="member-description hidden">
3281
+
3282
+ <div class="member-text">
3283
+ <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>
3284
+
3285
+
3286
+
3287
+ <ul class="member-list">
3288
+ <h4>Type:</h4>
3289
+ <li>
3290
+ <tt>Function</tt>⟋<tt>null</tt>
3291
+ </li>
3292
+ </ul>
3293
+ <ul class="member-list">
3294
+ <h4>Options:</h4>
3295
+ <li><tt>event.item: <a href="../classes/Item.html"><tt>Item</tt></a></tt> &mdash; the selected item</li>
3296
+ <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>
3297
+ <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>
3298
+ <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>
3299
+ <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>
3300
+ <li><tt>event.view: <a href="../classes/View.html"><tt>View</tt></a></tt> &mdash; the view drawn into
3301
+ What the handler draws isn&rsquo;t part of the item&rsquo;s hit testing, its bounds or its SVG export.</li>
3302
+ </ul>
3303
+
3304
+ <h4>Example:<span class="description">Draw the selection of a path as a dot at each segment:</span></h4>
3305
+
3306
+ <div class="paperscript split">
3307
+
3308
+ <div class="buttons">
3309
+ <div class="button run">Run</div>
3310
+ </div>
3311
+
3312
+ <script type="text/paperscript" canvas="canvas-37">
3313
+ var path = new Path.Star({
3314
+ center: view.center,
3315
+ points: 5,
3316
+ radius1: 20,
3317
+ radius2: 40,
3318
+ strokeColor: 'black',
3319
+ selected: true
3320
+ });
3321
+
3322
+ path.onDrawSelection = function(event) {
3323
+ var ctx = event.context;
3324
+ this.segments.forEach(function(segment) {
3325
+ var point = event.matrix.transform(segment.point);
3326
+ ctx.beginPath();
3327
+ ctx.arc(point.x, point.y, event.size, 0, Math.PI * 2);
3328
+ ctx.fill();
3329
+ });
3330
+ return false;
3331
+ }
3332
+ </script>
3333
+ <div class="canvas"><canvas width="516" height="100" id="canvas-37"></canvas></div>
3334
+ </div>
3335
+
3336
+
3337
+ </div>
3338
+
3339
+ </div>
3340
+ </div>
3341
+
3342
+ </div>
3343
+
3344
+
3345
+ <!-- =========================== inherited methods ========================= -->
3346
+ <div class="reference-members"><h2>Methods inherited from <a href="../classes/Item.html"><tt>Item</tt></a></h2>
3347
+
3348
+
3349
+ <div id="addeffect-effect" class="member">
3350
+ <div class="member-link">
3351
+ <a name="addeffect-effect" href="#addeffect-effect"><tt><b>addEffect</b>(effect)</tt></a>
3352
+ </div>
3353
+ <div class="member-description hidden">
3354
+ <div class="member-text">
3355
+ <p>Adds an effect at the end of the item&rsquo;s effects.</p>
3356
+
3357
+
3358
+ <ul class="member-list">
3359
+ <h4>Parameters:</h4>
3360
+
3361
+ <li>
3362
+ <tt>effect:</tt>
3363
+ <tt>Object</tt>
3364
+ &mdash;&nbsp;the plain object describing the effect
3365
+
3366
+ </li>
3367
+
3368
+ </ul>
3369
+
3370
+
3371
+ <ul class="member-list">
3372
+ <h4>Returns:</h4>
3373
+
3374
+ <li>
3375
+ <tt><a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a></tt>&nbsp;&mdash;&nbsp;the added instance
3376
+ </li>
3377
+
3378
+
3379
+ </ul>
3380
+
3381
+
3382
+
3383
+
3384
+
3385
+ </div>
3386
+ </div>
3387
+ </div>
3388
+
3389
+
3390
+ <div id="inserteffect-index-effect" class="member">
3391
+ <div class="member-link">
3392
+ <a name="inserteffect-index-effect" href="#inserteffect-index-effect"><tt><b>insertEffect</b>(index, effect)</tt></a>
3393
+ </div>
3394
+ <div class="member-description hidden">
3395
+ <div class="member-text">
3396
+ <p>Inserts an effect into the item&rsquo;s effects at the given index.</p>
3397
+
3398
+
3399
+ <ul class="member-list">
3400
+ <h4>Parameters:</h4>
3401
+
3402
+ <li>
3403
+ <tt>index:</tt>
3404
+ <tt>Number</tt>
3405
+ &mdash;&nbsp;the index at which to insert the effect
3406
+
3407
+ </li>
3408
+
3409
+ <li>
3410
+ <tt>effect:</tt>
3411
+ <tt>Object</tt>
3412
+ &mdash;&nbsp;the plain object describing the effect
3413
+
3414
+ </li>
3415
+
3416
+ </ul>
3417
+
3418
+
3419
+ <ul class="member-list">
3420
+ <h4>Returns:</h4>
3421
+
3422
+ <li>
3423
+ <tt><a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a></tt>&nbsp;&mdash;&nbsp;the inserted instance
3424
+ </li>
3425
+
3426
+
3427
+ </ul>
3428
+
3429
+
3430
+
3431
+
3432
+
3433
+ </div>
3434
+ </div>
3435
+ </div>
3436
+
3437
+
3438
+ <div id="inserteffects-index-effects" class="member">
3439
+ <div class="member-link">
3440
+ <a name="inserteffects-index-effects" href="#inserteffects-index-effects"><tt><b>insertEffects</b>(index, effects)</tt></a>
3441
+ </div>
3442
+ <div class="member-description hidden">
3443
+ <div class="member-text">
3444
+ <p>Inserts effects into the item&rsquo;s effects at the given index.</p>
3445
+
3446
+
3447
+ <ul class="member-list">
3448
+ <h4>Parameters:</h4>
3449
+
3450
+ <li>
3451
+ <tt>index:</tt>
3452
+ <tt>Number</tt>
3453
+ &mdash;&nbsp;the index at which to insert the effects
3454
+
3455
+ </li>
3456
+
3457
+ <li>
3458
+ <tt>effects:</tt>
3459
+ Array of <tt>Object</tt> objects
3460
+ &mdash;&nbsp;the plain objects describing the effects
3461
+
3462
+ </li>
3463
+
3464
+ </ul>
3465
+
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 inserted instances
3472
+ </li>
3473
+
3474
+
3475
+ </ul>
2965
3476
 
2966
3477
 
2967
- </div>
2968
3478
 
3479
+
3480
+
3481
+ </div>
2969
3482
  </div>
2970
3483
  </div>
2971
3484
 
2972
3485
 
2973
- <div id="onmouseenter" class="member">
3486
+ <div id="removeeffect-index" class="member">
2974
3487
  <div class="member-link">
2975
- <a name="onmouseenter" href="#onmouseenter"><tt><b>onMouseEnter</b></tt></a>
3488
+ <a name="removeeffect-index" href="#removeeffect-index"><tt><b>removeEffect</b>(index)</tt></a>
2976
3489
  </div>
2977
3490
  <div class="member-description hidden">
2978
-
2979
3491
  <div class="member-text">
2980
- <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>
3492
+ <p>Removes the effect at the given index from the item&rsquo;s effects.</p>
3493
+
2981
3494
 
3495
+ <ul class="member-list">
3496
+ <h4>Parameters:</h4>
2982
3497
 
3498
+ <li>
3499
+ <tt>index:</tt>
3500
+ <tt>Number</tt>
3501
+ &mdash;&nbsp;the index of the effect to remove
3502
+
3503
+ </li>
2983
3504
 
2984
- <ul class="member-list">
2985
- <h4>Type:</h4>
2986
- <li>
2987
- <tt>Function</tt>⟋<tt>null</tt>
2988
- </li>
2989
- </ul>
2990
-
3505
+ </ul>
3506
+
2991
3507
 
2992
3508
  <ul class="member-list">
2993
- <h4>See also:</h4>
3509
+ <h4>Returns:</h4>
2994
3510
 
2995
- <li><tt><a href="../classes/View.html#onmouseenter"><tt>view.onMouseEnter</tt></a></tt></li>
3511
+ <li>
3512
+ <tt><a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a></tt>&nbsp;&mdash;&nbsp;the removed instance, or <code>null</code>
3513
+ </li>
3514
+
2996
3515
 
2997
3516
  </ul>
2998
3517
 
2999
- <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>
3000
3518
 
3001
- <div class="paperscript split">
3002
3519
 
3003
- <div class="buttons">
3004
- <div class="button run">Run</div>
3520
+
3521
+
3005
3522
  </div>
3006
-
3007
- <script type="text/paperscript" canvas="canvas-32">
3008
- // Create a circle shaped path at the center of the view:
3009
- var path = new Path.Circle({
3010
- center: view.center,
3011
- radius: 25,
3012
- fillColor: 'black'
3013
- });
3014
-
3015
- // When the mouse enters the item, set its fill color to red:
3016
- path.onMouseEnter = function(event) {
3017
- this.fillColor = 'red';
3018
- }
3019
-
3020
- // When the mouse leaves the item, set its fill color to black:
3021
- path.onMouseLeave = function(event) {
3022
- this.fillColor = 'black';
3023
- }
3024
- </script>
3025
- <div class="canvas"><canvas width="516" height="100" id="canvas-32"></canvas></div>
3026
3523
  </div>
3027
-
3028
-
3029
- <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>
3030
-
3031
- <div class="paperscript split">
3032
-
3033
- <div class="buttons">
3034
- <div class="button run">Run</div>
3035
3524
  </div>
3036
3525
 
3037
- <script type="text/paperscript" canvas="canvas-33">
3038
- function enter(event) {
3039
- this.fillColor = 'red';
3040
- }
3041
-
3042
- function leave(event) {
3043
- this.fillColor = 'black';
3044
- }
3526
+
3527
+ <div id="removeeffects" class="member">
3528
+ <div class="member-link">
3529
+ <a name="removeeffects" href="#removeeffects"><tt><b>removeEffects</b>([start[, end]])</tt></a>
3530
+ </div>
3531
+ <div class="member-description hidden">
3532
+ <div class="member-text">
3533
+ <p>Removes the effects from the start index to the end index from the item&rsquo;s effects, or all of them.</p>
3534
+
3535
+
3536
+ <ul class="member-list">
3537
+ <h4>Parameters:</h4>
3538
+
3539
+ <li>
3540
+ <tt>start:</tt>
3541
+ <tt>Number</tt>
3542
+ &mdash;&nbsp;the index of the first effect to remove
3543
+ &mdash;&nbsp;optional, default: <tt>0</tt>
3544
+ </li>
3545
+
3546
+ <li>
3547
+ <tt>end:</tt>
3548
+ <tt>Number</tt>
3549
+ &mdash;&nbsp;the index after the last one
3550
+ &mdash;&nbsp;optional, default: <tt>effects.length</tt>
3551
+ </li>
3552
+
3553
+ </ul>
3045
3554
 
3046
- // When the mouse is pressed:
3047
- function onMouseDown(event) {
3048
- // Create a circle shaped path at the position of the mouse:
3049
- var path = new Path.Circle(event.point, 25);
3050
- path.fillColor = 'black';
3555
+
3556
+ <ul class="member-list">
3557
+ <h4>Returns:</h4>
3558
+
3559
+ <li>
3560
+ <tt>Array of <a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a> objects</tt>&nbsp;&mdash;&nbsp;the removed instances
3561
+ </li>
3051
3562
 
3052
- // When the mouse enters the item, set its fill color to red:
3053
- path.onMouseEnter = enter;
3563
+
3564
+ </ul>
3054
3565
 
3055
- // When the mouse leaves the item, set its fill color to black:
3056
- path.onMouseLeave = leave;
3057
- }
3058
- </script>
3059
- <div class="canvas"><canvas width="516" height="100" id="canvas-33"></canvas></div>
3060
- </div>
3061
3566
 
3062
3567
 
3568
+
3569
+
3063
3570
  </div>
3064
-
3065
3571
  </div>
3066
3572
  </div>
3067
3573
 
3068
3574
 
3069
- <div id="onmouseleave" class="member">
3575
+ <div id="geteffectoutput" class="member">
3070
3576
  <div class="member-link">
3071
- <a name="onmouseleave" href="#onmouseleave"><tt><b>onMouseLeave</b></tt></a>
3577
+ <a name="geteffectoutput" href="#geteffectoutput"><tt><b>getEffectOutput</b>()</tt></a>
3072
3578
  </div>
3073
3579
  <div class="member-description hidden">
3074
-
3075
3580
  <div class="member-text">
3076
- <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>
3077
-
3078
-
3079
-
3080
- <ul class="member-list">
3081
- <h4>Type:</h4>
3082
- <li>
3083
- <tt>Function</tt>⟋<tt>null</tt>
3084
- </li>
3085
- </ul>
3581
+ <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>
3086
3582
 
3087
3583
 
3584
+
3088
3585
  <ul class="member-list">
3089
- <h4>See also:</h4>
3586
+ <h4>Returns:</h4>
3090
3587
 
3091
- <li><tt><a href="../classes/View.html#onmouseleave"><tt>view.onMouseLeave</tt></a></tt></li>
3588
+ <li>
3589
+ <tt><a href="../classes/Item.html"><tt>Item</tt></a>⟋<tt>null</tt></tt>&nbsp;&mdash;&nbsp;the output of the effects
3590
+ </li>
3591
+
3092
3592
 
3093
3593
  </ul>
3094
3594
 
3095
- <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>
3096
-
3097
- <div class="paperscript split">
3098
-
3099
- <div class="buttons">
3100
- <div class="button run">Run</div>
3101
- </div>
3102
-
3103
- <script type="text/paperscript" canvas="canvas-34">
3104
- // Create a circle shaped path at the center of the view:
3105
- var path = new Path.Circle({
3106
- center: view.center,
3107
- radius: 25,
3108
- fillColor: 'black'
3109
- });
3110
-
3111
- // When the mouse leaves the item, set its fill color to red:
3112
- path.onMouseLeave = function(event) {
3113
- this.fillColor = 'red';
3114
- }
3115
- </script>
3116
- <div class="canvas"><canvas width="516" height="100" id="canvas-34"></canvas></div>
3117
- </div>
3118
-
3119
3595
 
3120
- </div>
3121
3596
 
3597
+
3598
+
3122
3599
  </div>
3123
3600
  </div>
3124
-
3125
3601
  </div>
3126
3602
 
3127
-
3128
- <!-- =========================== inherited methods ========================= -->
3129
- <div class="reference-members"><h2>Methods inherited from <a href="../classes/Item.html"><tt>Item</tt></a></h2>
3130
-
3131
3603
 
3132
3604
  <div id="set-props" class="member">
3133
3605
  <div class="member-link">
@@ -3172,7 +3644,7 @@ path.onMouseLeave = function(event) {
3172
3644
  <div class="button run">Run</div>
3173
3645
  </div>
3174
3646
 
3175
- <script type="text/paperscript" canvas="canvas-35">
3647
+ <script type="text/paperscript" canvas="canvas-38">
3176
3648
  var circle = new Path.Circle({
3177
3649
  center: [80, 50],
3178
3650
  radius: 35
@@ -3185,7 +3657,7 @@ circle.set({
3185
3657
  selected: true
3186
3658
  });
3187
3659
  </script>
3188
- <div class="canvas"><canvas width="516" height="100" id="canvas-35"></canvas></div>
3660
+ <div class="canvas"><canvas width="516" height="100" id="canvas-38"></canvas></div>
3189
3661
  </div>
3190
3662
 
3191
3663
 
@@ -3241,7 +3713,7 @@ circle.set({
3241
3713
  <div class="button run">Run</div>
3242
3714
  </div>
3243
3715
 
3244
- <script type="text/paperscript" canvas="canvas-36">
3716
+ <script type="text/paperscript" canvas="canvas-39">
3245
3717
  var circle = new Path.Circle({
3246
3718
  center: [50, 50],
3247
3719
  radius: 10,
@@ -3256,7 +3728,7 @@ for (var i = 0; i < 20; i++) {
3256
3728
  copy.position.x += i * copy.bounds.width;
3257
3729
  }
3258
3730
  </script>
3259
- <div class="canvas"><canvas width="516" height="100" id="canvas-36"></canvas></div>
3731
+ <div class="canvas"><canvas width="516" height="100" id="canvas-39"></canvas></div>
3260
3732
  </div>
3261
3733
 
3262
3734
 
@@ -3382,7 +3854,7 @@ for (var i = 0; i < 20; i++) {
3382
3854
  <div class="button run">Run</div>
3383
3855
  </div>
3384
3856
 
3385
- <script type="text/paperscript" canvas="canvas-37">
3857
+ <script type="text/paperscript" canvas="canvas-40">
3386
3858
  var circle = new Path.Circle({
3387
3859
  center: [50, 50],
3388
3860
  radius: 5,
@@ -3399,7 +3871,7 @@ raster.position.x += 100;
3399
3871
  circle.scale(5);
3400
3872
  raster.scale(5);
3401
3873
  </script>
3402
- <div class="canvas"><canvas width="516" height="100" id="canvas-37"></canvas></div>
3874
+ <div class="canvas"><canvas width="516" height="100" id="canvas-40"></canvas></div>
3403
3875
  </div>
3404
3876
 
3405
3877
 
@@ -3453,7 +3925,7 @@ raster.scale(5);
3453
3925
  <div class="button run">Run</div>
3454
3926
  </div>
3455
3927
 
3456
- <script type="text/paperscript" canvas="canvas-38">
3928
+ <script type="text/paperscript" canvas="canvas-41">
3457
3929
  var path = new Path.Star({
3458
3930
  center: [50, 50],
3459
3931
  points: 12,
@@ -3474,7 +3946,7 @@ function onMouseDown(event) {
3474
3946
  }
3475
3947
  }
3476
3948
  </script>
3477
- <div class="canvas"><canvas width="516" height="100" id="canvas-38"></canvas></div>
3949
+ <div class="canvas"><canvas width="516" height="100" id="canvas-41"></canvas></div>
3478
3950
  </div>
3479
3951
 
3480
3952
 
@@ -3992,11 +4464,17 @@ function onMouseDown(event) {
3992
4464
  </div>
3993
4465
  <div class="member-description hidden">
3994
4466
  <div class="member-text">
3995
- <p>Exports the item with its content and child items as an SVG DOM.</p>
4467
+ <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>
3996
4468
  <ul class="member-list">
3997
4469
  <h4>Options:</h4>
3998
- <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>
3999
- <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>
4470
+ <li>[options.bounds] {String|Rectangle} the bounds of the area to
4471
+ export, either as a string ({@values 'view', content'}), or a
4472
+ {@link Rectangle} object: `'view'` uses the view bounds,
4473
+ `'content'` uses the stroke bounds of the item</li>
4474
+ <li>[options.matrix] {Matrix} the matrix with which to transform the
4475
+ exported content: If `options.bounds` is set to `'view'`,
4476
+ `paper.view.matrix` is used, for all other settings of
4477
+ `options.bounds` the identity matrix is used.</li>
4000
4478
  <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>
4001
4479
  <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>
4002
4480
  <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>
@@ -5350,7 +5828,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
5350
5828
  <div class="button run">Run</div>
5351
5829
  </div>
5352
5830
 
5353
- <script type="text/paperscript" canvas="canvas-39">
5831
+ <script type="text/paperscript" canvas="canvas-42">
5354
5832
  // Create a rectangle shaped path with its top left
5355
5833
  // point at {x: 80, y: 25} and a size of {width: 50, height: 50}:
5356
5834
  var path = new Path.Rectangle(new Point(80, 25), new Size(50, 50));
@@ -5359,7 +5837,7 @@ path.fillColor = 'black';
5359
5837
  // Rotate the path by 30 degrees:
5360
5838
  path.rotate(30);
5361
5839
  </script>
5362
- <div class="canvas"><canvas width="516" height="100" id="canvas-39"></canvas></div>
5840
+ <div class="canvas"><canvas width="516" height="100" id="canvas-42"></canvas></div>
5363
5841
  </div>
5364
5842
 
5365
5843
 
@@ -5371,7 +5849,7 @@ path.rotate(30);
5371
5849
  <div class="button run">Run</div>
5372
5850
  </div>
5373
5851
 
5374
- <script type="text/paperscript" canvas="canvas-40">
5852
+ <script type="text/paperscript" canvas="canvas-43">
5375
5853
  // Create a rectangle shaped path with its top left
5376
5854
  // point at {x: 175, y: 50} and a size of {width: 100, height: 100}:
5377
5855
  var topLeft = new Point(175, 50);
@@ -5393,7 +5871,7 @@ function onFrame(event) {
5393
5871
  path.rotate(3, view.center);
5394
5872
  }
5395
5873
  </script>
5396
- <div class="canvas"><canvas width="516" height="200" id="canvas-40"></canvas></div>
5874
+ <div class="canvas"><canvas width="516" height="200" id="canvas-43"></canvas></div>
5397
5875
  </div>
5398
5876
 
5399
5877
 
@@ -5442,7 +5920,7 @@ function onFrame(event) {
5442
5920
  <div class="button run">Run</div>
5443
5921
  </div>
5444
5922
 
5445
- <script type="text/paperscript" canvas="canvas-41">
5923
+ <script type="text/paperscript" canvas="canvas-44">
5446
5924
  // Create a circle shaped path at { x: 80, y: 50 }
5447
5925
  // with a radius of 20:
5448
5926
  var circle = new Path.Circle({
@@ -5454,7 +5932,7 @@ var circle = new Path.Circle({
5454
5932
  // Scale the path by 150% from its center point
5455
5933
  circle.scale(1.5);
5456
5934
  </script>
5457
- <div class="canvas"><canvas width="516" height="100" id="canvas-41"></canvas></div>
5935
+ <div class="canvas"><canvas width="516" height="100" id="canvas-44"></canvas></div>
5458
5936
  </div>
5459
5937
 
5460
5938
 
@@ -5466,7 +5944,7 @@ circle.scale(1.5);
5466
5944
  <div class="button run">Run</div>
5467
5945
  </div>
5468
5946
 
5469
- <script type="text/paperscript" canvas="canvas-42">
5947
+ <script type="text/paperscript" canvas="canvas-45">
5470
5948
  // Create a circle shaped path at { x: 80, y: 50 }
5471
5949
  // with a radius of 20:
5472
5950
  var circle = new Path.Circle({
@@ -5478,7 +5956,7 @@ var circle = new Path.Circle({
5478
5956
  // Scale the path 150% from its bottom left corner
5479
5957
  circle.scale(1.5, circle.bounds.bottomLeft);
5480
5958
  </script>
5481
- <div class="canvas"><canvas width="516" height="100" id="canvas-42"></canvas></div>
5959
+ <div class="canvas"><canvas width="516" height="100" id="canvas-45"></canvas></div>
5482
5960
  </div>
5483
5961
 
5484
5962
 
@@ -5534,7 +6012,7 @@ circle.scale(1.5, circle.bounds.bottomLeft);
5534
6012
  <div class="button run">Run</div>
5535
6013
  </div>
5536
6014
 
5537
- <script type="text/paperscript" canvas="canvas-43">
6015
+ <script type="text/paperscript" canvas="canvas-46">
5538
6016
  // Create a circle shaped path at { x: 100, y: 50 }
5539
6017
  // with a radius of 20:
5540
6018
  var circle = new Path.Circle({
@@ -5546,7 +6024,7 @@ var circle = new Path.Circle({
5546
6024
  // Scale the path horizontally by 300%
5547
6025
  circle.scale(3, 1);
5548
6026
  </script>
5549
- <div class="canvas"><canvas width="516" height="100" id="canvas-43"></canvas></div>
6027
+ <div class="canvas"><canvas width="516" height="100" id="canvas-46"></canvas></div>
5550
6028
  </div>
5551
6029
 
5552
6030
 
@@ -5984,7 +6462,7 @@ circle.scale(3, 1);
5984
6462
  <div class="button run">Run</div>
5985
6463
  </div>
5986
6464
 
5987
- <script type="text/paperscript" canvas="canvas-44">
6465
+ <script type="text/paperscript" canvas="canvas-47">
5988
6466
  // Create a rectangle shaped path with its top left corner
5989
6467
  // at {x: 80, y: 25} and a size of {width: 75, height: 50}:
5990
6468
  var path = new Path.Rectangle({
@@ -6005,7 +6483,7 @@ var circlePath = new Path.Circle({
6005
6483
  // the rectangular path:
6006
6484
  circlePath.fitBounds(path.bounds);
6007
6485
  </script>
6008
- <div class="canvas"><canvas width="516" height="100" id="canvas-44"></canvas></div>
6486
+ <div class="canvas"><canvas width="516" height="100" id="canvas-47"></canvas></div>
6009
6487
  </div>
6010
6488
 
6011
6489
 
@@ -6017,7 +6495,7 @@ circlePath.fitBounds(path.bounds);
6017
6495
  <div class="button run">Run</div>
6018
6496
  </div>
6019
6497
 
6020
- <script type="text/paperscript" canvas="canvas-45">
6498
+ <script type="text/paperscript" canvas="canvas-48">
6021
6499
  // Create a rectangle shaped path with its top left corner
6022
6500
  // at {x: 80, y: 25} and a size of {width: 75, height: 50}:
6023
6501
  var path = new Path.Rectangle({
@@ -6038,7 +6516,7 @@ var circlePath = new Path.Circle({
6038
6516
  // the rectangular path:
6039
6517
  circlePath.fitBounds(path.bounds, 'cover');
6040
6518
  </script>
6041
- <div class="canvas"><canvas width="516" height="100" id="canvas-45"></canvas></div>
6519
+ <div class="canvas"><canvas width="516" height="100" id="canvas-48"></canvas></div>
6042
6520
  </div>
6043
6521
 
6044
6522
 
@@ -6050,7 +6528,7 @@ circlePath.fitBounds(path.bounds, 'cover');
6050
6528
  <div class="button run">Run</div>
6051
6529
  </div>
6052
6530
 
6053
- <script type="text/paperscript" canvas="canvas-46">
6531
+ <script type="text/paperscript" canvas="canvas-49">
6054
6532
  var path = new Path.Circle({
6055
6533
  center: [80, 50],
6056
6534
  radius: 30,
@@ -6060,7 +6538,7 @@ var path = new Path.Circle({
6060
6538
  // Fit the path to the bounding rectangle of the view:
6061
6539
  path.fitBounds(view.bounds);
6062
6540
  </script>
6063
- <div class="canvas"><canvas width="516" height="200" id="canvas-46"></canvas></div>
6541
+ <div class="canvas"><canvas width="516" height="200" id="canvas-49"></canvas></div>
6064
6542
  </div>
6065
6543
 
6066
6544
 
@@ -6086,7 +6564,7 @@ path.fitBounds(view.bounds);
6086
6564
  <li>
6087
6565
  <tt>type:</tt>
6088
6566
  <tt>String</tt>
6089
- &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>
6567
+ &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>
6090
6568
 
6091
6569
  </li>
6092
6570
 
@@ -6121,7 +6599,7 @@ path.fitBounds(view.bounds);
6121
6599
  <div class="button run">Run</div>
6122
6600
  </div>
6123
6601
 
6124
- <script type="text/paperscript" canvas="canvas-47">
6602
+ <script type="text/paperscript" canvas="canvas-50">
6125
6603
  // Create a circle shaped path at the center of the view:
6126
6604
  var path = new Path.Circle({
6127
6605
  center: view.center,
@@ -6139,7 +6617,7 @@ path.on('mouseleave', function() {
6139
6617
  this.fillColor = 'black';
6140
6618
  });
6141
6619
  </script>
6142
- <div class="canvas"><canvas width="516" height="100" id="canvas-47"></canvas></div>
6620
+ <div class="canvas"><canvas width="516" height="100" id="canvas-50"></canvas></div>
6143
6621
  </div>
6144
6622
 
6145
6623
 
@@ -6163,7 +6641,7 @@ path.on('mouseleave', function() {
6163
6641
  <li>
6164
6642
  <tt>object:</tt>
6165
6643
  <tt>Object</tt>
6166
- &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>
6644
+ &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>
6167
6645
 
6168
6646
  </li>
6169
6647
 
@@ -6191,7 +6669,7 @@ path.on('mouseleave', function() {
6191
6669
  <div class="button run">Run</div>
6192
6670
  </div>
6193
6671
 
6194
- <script type="text/paperscript" canvas="canvas-48">
6672
+ <script type="text/paperscript" canvas="canvas-51">
6195
6673
  // Create a circle shaped path at the center of the view:
6196
6674
  var path = new Path.Circle({
6197
6675
  center: view.center,
@@ -6209,7 +6687,7 @@ path.on({
6209
6687
  }
6210
6688
  });
6211
6689
  </script>
6212
- <div class="canvas"><canvas width="516" height="100" id="canvas-48"></canvas></div>
6690
+ <div class="canvas"><canvas width="516" height="100" id="canvas-51"></canvas></div>
6213
6691
  </div>
6214
6692
 
6215
6693
 
@@ -6221,7 +6699,7 @@ path.on({
6221
6699
  <div class="button run">Run</div>
6222
6700
  </div>
6223
6701
 
6224
- <script type="text/paperscript" canvas="canvas-49">
6702
+ <script type="text/paperscript" canvas="canvas-52">
6225
6703
  var pathHandlers = {
6226
6704
  mouseenter: function(event) {
6227
6705
  this.fillColor = 'red';
@@ -6244,7 +6722,7 @@ function onMouseDown(event) {
6244
6722
  path.on(pathHandlers);
6245
6723
  }
6246
6724
  </script>
6247
- <div class="canvas"><canvas width="516" height="100" id="canvas-49"></canvas></div>
6725
+ <div class="canvas"><canvas width="516" height="100" id="canvas-52"></canvas></div>
6248
6726
  </div>
6249
6727
 
6250
6728
 
@@ -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>object:</tt>
6318
6796
  <tt>Object</tt>
6319
- &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>
6797
+ &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>
6320
6798
 
6321
6799
  </li>
6322
6800
 
@@ -6357,7 +6835,7 @@ function onMouseDown(event) {
6357
6835
  <li>
6358
6836
  <tt>type:</tt>
6359
6837
  <tt>String</tt>
6360
- &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>
6838
+ &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>
6361
6839
 
6362
6840
  </li>
6363
6841
 
@@ -6405,7 +6883,7 @@ function onMouseDown(event) {
6405
6883
  <li>
6406
6884
  <tt>type:</tt>
6407
6885
  <tt>String</tt>
6408
- &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>
6886
+ &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>
6409
6887
 
6410
6888
  </li>
6411
6889
 
@@ -6472,7 +6950,7 @@ function onMouseDown(event) {
6472
6950
  <div class="button run">Run</div>
6473
6951
  </div>
6474
6952
 
6475
- <script type="text/paperscript" canvas="canvas-50">
6953
+ <script type="text/paperscript" canvas="canvas-53">
6476
6954
  function onMouseDrag(event) {
6477
6955
  // Create a circle shaped path at the mouse position,
6478
6956
  // with a radius of 10:
@@ -6489,7 +6967,7 @@ function onMouseDrag(event) {
6489
6967
  });
6490
6968
  }
6491
6969
  </script>
6492
- <div class="canvas"><canvas width="516" height="200" id="canvas-50"></canvas></div>
6970
+ <div class="canvas"><canvas width="516" height="200" id="canvas-53"></canvas></div>
6493
6971
  </div>
6494
6972
 
6495
6973
 
@@ -6519,7 +6997,7 @@ function onMouseDrag(event) {
6519
6997
  <div class="button run">Run</div>
6520
6998
  </div>
6521
6999
 
6522
- <script type="text/paperscript" canvas="canvas-51">
7000
+ <script type="text/paperscript" canvas="canvas-54">
6523
7001
  function onMouseMove(event) {
6524
7002
  // Create a circle shaped path at the mouse position,
6525
7003
  // with a radius of 10:
@@ -6533,7 +7011,7 @@ function onMouseMove(event) {
6533
7011
  path.removeOnMove();
6534
7012
  }
6535
7013
  </script>
6536
- <div class="canvas"><canvas width="516" height="200" id="canvas-51"></canvas></div>
7014
+ <div class="canvas"><canvas width="516" height="200" id="canvas-54"></canvas></div>
6537
7015
  </div>
6538
7016
 
6539
7017
 
@@ -6563,7 +7041,7 @@ function onMouseMove(event) {
6563
7041
  <div class="button run">Run</div>
6564
7042
  </div>
6565
7043
 
6566
- <script type="text/paperscript" canvas="canvas-52">
7044
+ <script type="text/paperscript" canvas="canvas-55">
6567
7045
  function onMouseDown(event) {
6568
7046
  // Create a circle shaped path at the mouse position,
6569
7047
  // with a radius of 10:
@@ -6577,7 +7055,7 @@ function onMouseDown(event) {
6577
7055
  path.removeOnDown();
6578
7056
  }
6579
7057
  </script>
6580
- <div class="canvas"><canvas width="516" height="200" id="canvas-52"></canvas></div>
7058
+ <div class="canvas"><canvas width="516" height="200" id="canvas-55"></canvas></div>
6581
7059
  </div>
6582
7060
 
6583
7061
 
@@ -6607,7 +7085,7 @@ function onMouseDown(event) {
6607
7085
  <div class="button run">Run</div>
6608
7086
  </div>
6609
7087
 
6610
- <script type="text/paperscript" canvas="canvas-53">
7088
+ <script type="text/paperscript" canvas="canvas-56">
6611
7089
  function onMouseDrag(event) {
6612
7090
  // Create a circle shaped path at the mouse position,
6613
7091
  // with a radius of 10:
@@ -6621,7 +7099,7 @@ function onMouseDrag(event) {
6621
7099
  path.removeOnDrag();
6622
7100
  }
6623
7101
  </script>
6624
- <div class="canvas"><canvas width="516" height="200" id="canvas-53"></canvas></div>
7102
+ <div class="canvas"><canvas width="516" height="200" id="canvas-56"></canvas></div>
6625
7103
  </div>
6626
7104
 
6627
7105
 
@@ -6651,7 +7129,7 @@ function onMouseDrag(event) {
6651
7129
  <div class="button run">Run</div>
6652
7130
  </div>
6653
7131
 
6654
- <script type="text/paperscript" canvas="canvas-54">
7132
+ <script type="text/paperscript" canvas="canvas-57">
6655
7133
  function onMouseDown(event) {
6656
7134
  // Create a circle shaped path at the mouse position,
6657
7135
  // with a radius of 10:
@@ -6665,7 +7143,7 @@ function onMouseDown(event) {
6665
7143
  path.removeOnUp();
6666
7144
  }
6667
7145
  </script>
6668
- <div class="canvas"><canvas width="516" height="200" id="canvas-54"></canvas></div>
7146
+ <div class="canvas"><canvas width="516" height="200" id="canvas-57"></canvas></div>
6669
7147
  </div>
6670
7148
 
6671
7149
 
@@ -6738,7 +7216,7 @@ function onMouseDown(event) {
6738
7216
  <div class="button run">Run</div>
6739
7217
  </div>
6740
7218
 
6741
- <script type="text/paperscript" canvas="canvas-55">
7219
+ <script type="text/paperscript" canvas="canvas-58">
6742
7220
  var path = new Path.Circle({
6743
7221
  radius: view.bounds.height * 0.4,
6744
7222
  center: view.center
@@ -6749,7 +7227,7 @@ path.tween(
6749
7227
  3000
6750
7228
  );
6751
7229
  </script>
6752
- <div class="canvas"><canvas width="516" height="100" id="canvas-55"></canvas></div>
7230
+ <div class="canvas"><canvas width="516" height="100" id="canvas-58"></canvas></div>
6753
7231
  </div>
6754
7232
 
6755
7233
 
@@ -6761,7 +7239,7 @@ path.tween(
6761
7239
  <div class="button run">Run</div>
6762
7240
  </div>
6763
7241
 
6764
- <script type="text/paperscript" canvas="canvas-56">
7242
+ <script type="text/paperscript" canvas="canvas-59">
6765
7243
  var path = new Shape.Rectangle({
6766
7244
  fillColor: 'red',
6767
7245
  center: [50, view.center.y],
@@ -6776,7 +7254,7 @@ path.tween({
6776
7254
  duration: 2000
6777
7255
  });
6778
7256
  </script>
6779
- <div class="canvas"><canvas width="516" height="100" id="canvas-56"></canvas></div>
7257
+ <div class="canvas"><canvas width="516" height="100" id="canvas-59"></canvas></div>
6780
7258
  </div>
6781
7259
 
6782
7260
 
@@ -6842,7 +7320,7 @@ path.tween({
6842
7320
  <div class="button run">Run</div>
6843
7321
  </div>
6844
7322
 
6845
- <script type="text/paperscript" canvas="canvas-57">
7323
+ <script type="text/paperscript" canvas="canvas-60">
6846
7324
  var path = new Path.Rectangle({
6847
7325
  size: [100, 100],
6848
7326
  position: view.center,
@@ -6856,7 +7334,7 @@ path.tween({
6856
7334
  'segments[2].point.x': '-= 50'
6857
7335
  }, 3000);
6858
7336
  </script>
6859
- <div class="canvas"><canvas width="516" height="200" id="canvas-57"></canvas></div>
7337
+ <div class="canvas"><canvas width="516" height="200" id="canvas-60"></canvas></div>
6860
7338
  </div>
6861
7339
 
6862
7340
 
@@ -6915,7 +7393,7 @@ path.tween({
6915
7393
  <div class="button run">Run</div>
6916
7394
  </div>
6917
7395
 
6918
- <script type="text/paperscript" canvas="canvas-58">
7396
+ <script type="text/paperscript" canvas="canvas-61">
6919
7397
  var path = new Path.Circle({
6920
7398
  fillColor: 'blue',
6921
7399
  radius: view.bounds.height * 0.4,
@@ -6931,7 +7409,7 @@ path.tween(2000).onUpdate = function(event) {
6931
7409
  path.interpolate(pathFrom, pathTo, event.factor)
6932
7410
  };
6933
7411
  </script>
6934
- <div class="canvas"><canvas width="516" height="100" id="canvas-58"></canvas></div>
7412
+ <div class="canvas"><canvas width="516" height="100" id="canvas-61"></canvas></div>
6935
7413
  </div>
6936
7414
 
6937
7415
 
@@ -7052,7 +7530,7 @@ path.tween(2000).onUpdate = function(event) {
7052
7530
  <div class="button run">Run</div>
7053
7531
  </div>
7054
7532
 
7055
- <script type="text/paperscript" canvas="canvas-59">
7533
+ <script type="text/paperscript" canvas="canvas-62">
7056
7534
  var path = new Path.Circle({
7057
7535
  fillColor: 'blue',
7058
7536
  radius: view.bounds.height * 0.4,
@@ -7060,7 +7538,7 @@ var path = new Path.Circle({
7060
7538
  });
7061
7539
  path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
7062
7540
  </script>
7063
- <div class="canvas"><canvas width="516" height="100" id="canvas-59"></canvas></div>
7541
+ <div class="canvas"><canvas width="516" height="100" id="canvas-62"></canvas></div>
7064
7542
  </div>
7065
7543
 
7066
7544
 
@@ -8569,7 +9047,7 @@ wordsLongerThan, afterFirst, beforeLast, limit, zone, capitalized }</code>. Kept
8569
9047
 
8570
9048
  <!-- =========================== copyright notice ========================== -->
8571
9049
  <p class="footer">
8572
- Paper.js v0.16.0<br>
9050
+ Paper.js v0.17.0<br>
8573
9051
  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>
8574
9052
  <div class="content-end"></div>
8575
9053