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
@@ -200,6 +200,91 @@ for (var i = 0; i < 100; i++) {
200
200
  <div class="reference-members"><h2>Properties inherited from <a href="../classes/Item.html"><tt>Item</tt></a></h2>
201
201
 
202
202
 
203
+ <div id="effects" class="member">
204
+ <div class="member-link">
205
+ <a name="effects" href="#effects"><tt><b>effects</b></tt></a>
206
+ </div>
207
+ <div class="member-description hidden">
208
+
209
+ <div class="member-text">
210
+ <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,
211
+ 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>
212
+ <p>Paper.js has these effects, and <a href="../classes/Effect.html"><tt>Effect</tt></a> creates more:</p>
213
+ <ul>
214
+ <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>
215
+ <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>
216
+ </ul>
217
+
218
+
219
+
220
+ <ul class="member-list">
221
+ <h4>Type:</h4>
222
+ <li>
223
+ Array of <a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a> objects
224
+ </li>
225
+ </ul>
226
+
227
+
228
+ <h4>Example:</h4>
229
+
230
+ <div class="paperscript split">
231
+
232
+ <div class="buttons">
233
+ <div class="button run">Run</div>
234
+ </div>
235
+
236
+ <script type="text/paperscript" canvas="canvas-1">
237
+ var path = new Path.Star({
238
+ center: view.center,
239
+ points: 5,
240
+ radius1: 20,
241
+ radius2: 40,
242
+ strokeColor: 'black',
243
+ strokeWidth: 8
244
+ });
245
+ path.effects = [
246
+ { type: 'offset', parameters: { distance: 10, join: 'round' } },
247
+ { type: 'outline' }
248
+ ];
249
+ </script>
250
+ <div class="canvas"><canvas width="516" height="100" id="canvas-1"></canvas></div>
251
+ </div>
252
+
253
+
254
+ </div>
255
+
256
+ </div>
257
+ </div>
258
+
259
+
260
+ <div id="previewbounds-matrix" class="member">
261
+ <div class="member-link">
262
+ <a name="previewbounds-matrix" href="#previewbounds-matrix"><tt><b>previewBounds</b></tt></a>
263
+ </div>
264
+ <div class="member-description hidden">
265
+
266
+ <div class="member-text">
267
+ <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>
268
+
269
+ <p>Read only.</p>
270
+
271
+
272
+
273
+ <ul class="member-list">
274
+ <h4>Type:</h4>
275
+ <li>
276
+ <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
277
+ </li>
278
+ </ul>
279
+
280
+
281
+
282
+ </div>
283
+
284
+ </div>
285
+ </div>
286
+
287
+
203
288
  <div id="key" class="member">
204
289
  <div class="member-link">
205
290
  <a name="key" href="#key"><tt><b>key</b></tt></a>
@@ -312,7 +397,7 @@ for (var i = 0; i < 100; i++) {
312
397
  <div class="button run">Run</div>
313
398
  </div>
314
399
 
315
- <script type="text/paperscript" canvas="canvas-1">
400
+ <script type="text/paperscript" canvas="canvas-2">
316
401
  var path = new Path.Circle({
317
402
  center: [80, 50],
318
403
  radius: 35
@@ -327,7 +412,7 @@ group.addChild(path);
327
412
  // The path can be accessed by name:
328
413
  group.children['example'].fillColor = 'red';
329
414
  </script>
330
- <div class="canvas"><canvas width="516" height="100" id="canvas-1"></canvas></div>
415
+ <div class="canvas"><canvas width="516" height="100" id="canvas-2"></canvas></div>
331
416
  </div>
332
417
 
333
418
 
@@ -365,7 +450,7 @@ group.children['example'].fillColor = 'red';
365
450
  <div class="button run">Run</div>
366
451
  </div>
367
452
 
368
- <script type="text/paperscript" canvas="canvas-2">
453
+ <script type="text/paperscript" canvas="canvas-3">
369
454
  var circle = new Path.Circle({
370
455
  center: [80, 50],
371
456
  radius: 30
@@ -376,7 +461,7 @@ circle.style = {
376
461
  strokeWidth: 5
377
462
  };
378
463
  </script>
379
- <div class="canvas"><canvas width="516" height="100" id="canvas-2"></canvas></div>
464
+ <div class="canvas"><canvas width="516" height="100" id="canvas-3"></canvas></div>
380
465
  </div>
381
466
 
382
467
 
@@ -388,7 +473,7 @@ circle.style = {
388
473
  <div class="button run">Run</div>
389
474
  </div>
390
475
 
391
- <script type="text/paperscript" canvas="canvas-3">
476
+ <script type="text/paperscript" canvas="canvas-4">
392
477
  var path = new Path.Circle({
393
478
  center: [50, 50],
394
479
  radius: 30,
@@ -403,7 +488,7 @@ var path2 = new Path.Circle({
403
488
  // Copy the path style of path:
404
489
  path2.style = path.style;
405
490
  </script>
406
- <div class="canvas"><canvas width="516" height="100" id="canvas-3"></canvas></div>
491
+ <div class="canvas"><canvas width="516" height="100" id="canvas-4"></canvas></div>
407
492
  </div>
408
493
 
409
494
 
@@ -415,7 +500,7 @@ path2.style = path.style;
415
500
  <div class="button run">Run</div>
416
501
  </div>
417
502
 
418
- <script type="text/paperscript" canvas="canvas-4">
503
+ <script type="text/paperscript" canvas="canvas-5">
419
504
  var myStyle = {
420
505
  fillColor: 'red',
421
506
  strokeColor: 'blue',
@@ -434,7 +519,7 @@ var path2 = new Path.Circle({
434
519
  });
435
520
  path2.style = myStyle;
436
521
  </script>
437
- <div class="canvas"><canvas width="516" height="100" id="canvas-4"></canvas></div>
522
+ <div class="canvas"><canvas width="516" height="100" id="canvas-5"></canvas></div>
438
523
  </div>
439
524
 
440
525
 
@@ -476,7 +561,7 @@ path2.style = myStyle;
476
561
  <div class="button run">Run</div>
477
562
  </div>
478
563
 
479
- <script type="text/paperscript" canvas="canvas-5">
564
+ <script type="text/paperscript" canvas="canvas-6">
480
565
  var unlockedItem = new Path.Circle({
481
566
  center: view.center - [35, 0],
482
567
  radius: 30,
@@ -503,7 +588,7 @@ new PointText({
503
588
  justification: 'center'
504
589
  });
505
590
  </script>
506
- <div class="canvas"><canvas width="516" height="100" id="canvas-5"></canvas></div>
591
+ <div class="canvas"><canvas width="516" height="100" id="canvas-6"></canvas></div>
507
592
  </div>
508
593
 
509
594
 
@@ -545,7 +630,7 @@ new PointText({
545
630
  <div class="button run">Run</div>
546
631
  </div>
547
632
 
548
- <script type="text/paperscript" canvas="canvas-6">
633
+ <script type="text/paperscript" canvas="canvas-7">
549
634
  var path = new Path.Circle({
550
635
  center: [50, 50],
551
636
  radius: 20,
@@ -555,7 +640,7 @@ var path = new Path.Circle({
555
640
  // Hide the path:
556
641
  path.visible = false;
557
642
  </script>
558
- <div class="canvas"><canvas width="516" height="100" id="canvas-6"></canvas></div>
643
+ <div class="canvas"><canvas width="516" height="100" id="canvas-7"></canvas></div>
559
644
  </div>
560
645
 
561
646
 
@@ -603,7 +688,7 @@ path.visible = false;
603
688
  <div class="button run">Run</div>
604
689
  </div>
605
690
 
606
- <script type="text/paperscript" canvas="canvas-7">
691
+ <script type="text/paperscript" canvas="canvas-8">
607
692
  // Create a white rectangle in the background
608
693
  // with the same dimensions as the view:
609
694
  var background = new Path.Rectangle(view.bounds);
@@ -624,7 +709,7 @@ var circle2 = new Path.Circle({
624
709
  // Set the blend mode of circle2:
625
710
  circle2.blendMode = 'multiply';
626
711
  </script>
627
- <div class="canvas"><canvas width="516" height="100" id="canvas-7"></canvas></div>
712
+ <div class="canvas"><canvas width="516" height="100" id="canvas-8"></canvas></div>
628
713
  </div>
629
714
 
630
715
 
@@ -666,7 +751,7 @@ circle2.blendMode = 'multiply';
666
751
  <div class="button run">Run</div>
667
752
  </div>
668
753
 
669
- <script type="text/paperscript" canvas="canvas-8">
754
+ <script type="text/paperscript" canvas="canvas-9">
670
755
  var circle = new Path.Circle({
671
756
  center: [80, 50],
672
757
  radius: 35,
@@ -684,7 +769,7 @@ var circle2 = new Path.Circle({
684
769
  // Make circle2 50% transparent:
685
770
  circle2.opacity = 0.5;
686
771
  </script>
687
- <div class="canvas"><canvas width="516" height="100" id="canvas-8"></canvas></div>
772
+ <div class="canvas"><canvas width="516" height="100" id="canvas-9"></canvas></div>
688
773
  </div>
689
774
 
690
775
 
@@ -807,14 +892,14 @@ circle.textWrap = { offset: 10 };</code></pre>
807
892
  <div class="button run">Run</div>
808
893
  </div>
809
894
 
810
- <script type="text/paperscript" canvas="canvas-9">
895
+ <script type="text/paperscript" canvas="canvas-10">
811
896
  var path = new Path.Circle({
812
897
  center: [80, 50],
813
898
  radius: 35
814
899
  });
815
900
  path.selected = true; // Select the path
816
901
  </script>
817
- <div class="canvas"><canvas width="516" height="100" id="canvas-9"></canvas></div>
902
+ <div class="canvas"><canvas width="516" height="100" id="canvas-10"></canvas></div>
818
903
  </div>
819
904
 
820
905
 
@@ -971,7 +1056,7 @@ console.log(path.data.pets.length); // 1</code></pre>
971
1056
  <div class="button run">Run</div>
972
1057
  </div>
973
1058
 
974
- <script type="text/paperscript" canvas="canvas-10">
1059
+ <script type="text/paperscript" canvas="canvas-11">
975
1060
  // Create a circle at position { x: 10, y: 10 }
976
1061
  var circle = new Path.Circle({
977
1062
  center: new Point(10, 10),
@@ -985,7 +1070,7 @@ circle.position = new Point(20, 20);
985
1070
  // Move the circle 100 points to the right and 50 points down
986
1071
  circle.position += new Point(100, 50);
987
1072
  </script>
988
- <div class="canvas"><canvas width="516" height="100" id="canvas-10"></canvas></div>
1073
+ <div class="canvas"><canvas width="516" height="100" id="canvas-11"></canvas></div>
989
1074
  </div>
990
1075
 
991
1076
 
@@ -997,7 +1082,7 @@ circle.position += new Point(100, 50);
997
1082
  <div class="button run">Run</div>
998
1083
  </div>
999
1084
 
1000
- <script type="text/paperscript" canvas="canvas-11">
1085
+ <script type="text/paperscript" canvas="canvas-12">
1001
1086
  // Create a circle at position { x: 20, y: 20 }
1002
1087
  var circle = new Path.Circle({
1003
1088
  center: new Point(20, 20),
@@ -1008,7 +1093,7 @@ var circle = new Path.Circle({
1008
1093
  // Move the circle 100 points to the right
1009
1094
  circle.position.x += 100;
1010
1095
  </script>
1011
- <div class="canvas"><canvas width="516" height="100" id="canvas-11"></canvas></div>
1096
+ <div class="canvas"><canvas width="516" height="100" id="canvas-12"></canvas></div>
1012
1097
  </div>
1013
1098
 
1014
1099
 
@@ -1534,7 +1619,7 @@ console.log(group.children[0] == path); // true</code></pre>
1534
1619
  <div class="button run">Run</div>
1535
1620
  </div>
1536
1621
 
1537
- <script type="text/paperscript" canvas="canvas-12">
1622
+ <script type="text/paperscript" canvas="canvas-13">
1538
1623
  var path = new Path.Circle({
1539
1624
  center: [80, 50],
1540
1625
  radius: 35
@@ -1547,7 +1632,7 @@ group.addChild(path);
1547
1632
  // Access the path through the group's children array:
1548
1633
  group.children[0].fillColor = 'red';
1549
1634
  </script>
1550
- <div class="canvas"><canvas width="516" height="100" id="canvas-12"></canvas></div>
1635
+ <div class="canvas"><canvas width="516" height="100" id="canvas-13"></canvas></div>
1551
1636
  </div>
1552
1637
 
1553
1638
 
@@ -1559,7 +1644,7 @@ group.children[0].fillColor = 'red';
1559
1644
  <div class="button run">Run</div>
1560
1645
  </div>
1561
1646
 
1562
- <script type="text/paperscript" canvas="canvas-13">
1647
+ <script type="text/paperscript" canvas="canvas-14">
1563
1648
  var path = new Path.Circle({
1564
1649
  center: [80, 50],
1565
1650
  radius: 35
@@ -1574,7 +1659,7 @@ group.addChild(path);
1574
1659
  // The path can be accessed by name:
1575
1660
  group.children['example'].fillColor = 'orange';
1576
1661
  </script>
1577
- <div class="canvas"><canvas width="516" height="100" id="canvas-13"></canvas></div>
1662
+ <div class="canvas"><canvas width="516" height="100" id="canvas-14"></canvas></div>
1578
1663
  </div>
1579
1664
 
1580
1665
 
@@ -1586,7 +1671,7 @@ group.children['example'].fillColor = 'orange';
1586
1671
  <div class="button run">Run</div>
1587
1672
  </div>
1588
1673
 
1589
- <script type="text/paperscript" canvas="canvas-14">
1674
+ <script type="text/paperscript" canvas="canvas-15">
1590
1675
  var path = new Path.Circle({
1591
1676
  center: [80, 50],
1592
1677
  radius: 35
@@ -1598,7 +1683,7 @@ group.children = [path];
1598
1683
  // The path is the first child of the group:
1599
1684
  group.firstChild.fillColor = 'green';
1600
1685
  </script>
1601
- <div class="canvas"><canvas width="516" height="100" id="canvas-14"></canvas></div>
1686
+ <div class="canvas"><canvas width="516" height="100" id="canvas-15"></canvas></div>
1602
1687
  </div>
1603
1688
 
1604
1689
 
@@ -1775,7 +1860,7 @@ group.firstChild.fillColor = 'green';
1775
1860
  <div class="button run">Run</div>
1776
1861
  </div>
1777
1862
 
1778
- <script type="text/paperscript" canvas="canvas-15">
1863
+ <script type="text/paperscript" canvas="canvas-16">
1779
1864
  // Create a circle shaped path at { x: 80, y: 50 }
1780
1865
  // with a radius of 35:
1781
1866
  var circle = new Path.Circle({
@@ -1786,7 +1871,7 @@ var circle = new Path.Circle({
1786
1871
  // Set its stroke color to RGB red:
1787
1872
  circle.strokeColor = new Color(1, 0, 0);
1788
1873
  </script>
1789
- <div class="canvas"><canvas width="516" height="100" id="canvas-15"></canvas></div>
1874
+ <div class="canvas"><canvas width="516" height="100" id="canvas-16"></canvas></div>
1790
1875
  </div>
1791
1876
 
1792
1877
 
@@ -1823,7 +1908,7 @@ circle.strokeColor = new Color(1, 0, 0);
1823
1908
  <div class="button run">Run</div>
1824
1909
  </div>
1825
1910
 
1826
- <script type="text/paperscript" canvas="canvas-16">
1911
+ <script type="text/paperscript" canvas="canvas-17">
1827
1912
  // Create a circle shaped path at { x: 80, y: 50 }
1828
1913
  // with a radius of 35:
1829
1914
  var circle = new Path.Circle({
@@ -1835,7 +1920,7 @@ var circle = new Path.Circle({
1835
1920
  // Set its stroke width to 10:
1836
1921
  circle.strokeWidth = 10;
1837
1922
  </script>
1838
- <div class="canvas"><canvas width="516" height="100" id="canvas-16"></canvas></div>
1923
+ <div class="canvas"><canvas width="516" height="100" id="canvas-17"></canvas></div>
1839
1924
  </div>
1840
1925
 
1841
1926
 
@@ -1882,7 +1967,7 @@ circle.strokeWidth = 10;
1882
1967
  <div class="button run">Run</div>
1883
1968
  </div>
1884
1969
 
1885
- <script type="text/paperscript" canvas="canvas-17">
1970
+ <script type="text/paperscript" canvas="canvas-18">
1886
1971
  var line = new Path({
1887
1972
  segments: [[80, 50], [420, 50]],
1888
1973
  strokeColor: 'black',
@@ -1903,7 +1988,7 @@ var line2 = line.clone();
1903
1988
  line2.position.y += 100;
1904
1989
  line2.strokeCap = 'butt';
1905
1990
  </script>
1906
- <div class="canvas"><canvas width="516" height="200" id="canvas-17"></canvas></div>
1991
+ <div class="canvas"><canvas width="516" height="200" id="canvas-18"></canvas></div>
1907
1992
  </div>
1908
1993
 
1909
1994
 
@@ -1950,7 +2035,7 @@ line2.strokeCap = 'butt';
1950
2035
  <div class="button run">Run</div>
1951
2036
  </div>
1952
2037
 
1953
- <script type="text/paperscript" canvas="canvas-18">
2038
+ <script type="text/paperscript" canvas="canvas-19">
1954
2039
  var path = new Path({
1955
2040
  segments: [[80, 100], [120, 40], [160, 100]],
1956
2041
  strokeColor: 'black',
@@ -1967,7 +2052,7 @@ var path3 = path2.clone();
1967
2052
  path3.position.x += path3.bounds.width * 1.5;
1968
2053
  path3.strokeJoin = 'bevel';
1969
2054
  </script>
1970
- <div class="canvas"><canvas width="516" height="120" id="canvas-18"></canvas></div>
2055
+ <div class="canvas"><canvas width="516" height="120" id="canvas-19"></canvas></div>
1971
2056
  </div>
1972
2057
 
1973
2058
 
@@ -2071,7 +2156,7 @@ path3.strokeJoin = 'bevel';
2071
2156
  <div class="button run">Run</div>
2072
2157
  </div>
2073
2158
 
2074
- <script type="text/paperscript" canvas="canvas-19">
2159
+ <script type="text/paperscript" canvas="canvas-20">
2075
2160
  var path = new Path.Circle({
2076
2161
  center: [80, 50],
2077
2162
  radius: 40,
@@ -2082,7 +2167,7 @@ var path = new Path.Circle({
2082
2167
  // Set the dashed stroke to [10pt dash, 4pt gap]:
2083
2168
  path.dashArray = [10, 4];
2084
2169
  </script>
2085
- <div class="canvas"><canvas width="516" height="100" id="canvas-19"></canvas></div>
2170
+ <div class="canvas"><canvas width="516" height="100" id="canvas-20"></canvas></div>
2086
2171
  </div>
2087
2172
 
2088
2173
 
@@ -2188,7 +2273,7 @@ path.dashArray = [10, 4];
2188
2273
  <div class="button run">Run</div>
2189
2274
  </div>
2190
2275
 
2191
- <script type="text/paperscript" canvas="canvas-20">
2276
+ <script type="text/paperscript" canvas="canvas-21">
2192
2277
  // Create a circle shaped path at { x: 80, y: 50 }
2193
2278
  // with a radius of 35:
2194
2279
  var circle = new Path.Circle({
@@ -2199,7 +2284,7 @@ var circle = new Path.Circle({
2199
2284
  // Set the fill color of the circle to RGB red:
2200
2285
  circle.fillColor = new Color(1, 0, 0);
2201
2286
  </script>
2202
- <div class="canvas"><canvas width="516" height="100" id="canvas-20"></canvas></div>
2287
+ <div class="canvas"><canvas width="516" height="100" id="canvas-21"></canvas></div>
2203
2288
  </div>
2204
2289
 
2205
2290
 
@@ -2274,7 +2359,7 @@ circle.fillColor = new Color(1, 0, 0);
2274
2359
  <div class="button run">Run</div>
2275
2360
  </div>
2276
2361
 
2277
- <script type="text/paperscript" canvas="canvas-21">
2362
+ <script type="text/paperscript" canvas="canvas-22">
2278
2363
  var circle = new Path.Circle({
2279
2364
  center: [80, 50],
2280
2365
  radius: 35,
@@ -2287,7 +2372,7 @@ var circle = new Path.Circle({
2287
2372
  shadowOffset: new Point(5, 5)
2288
2373
  });
2289
2374
  </script>
2290
- <div class="canvas"><canvas width="516" height="100" id="canvas-21"></canvas></div>
2375
+ <div class="canvas"><canvas width="516" height="100" id="canvas-22"></canvas></div>
2291
2376
  </div>
2292
2377
 
2293
2378
 
@@ -2428,7 +2513,7 @@ var circle = new Path.Circle({
2428
2513
  <div class="button run">Run</div>
2429
2514
  </div>
2430
2515
 
2431
- <script type="text/paperscript" canvas="canvas-22">
2516
+ <script type="text/paperscript" canvas="canvas-23">
2432
2517
  // Create a rectangle shaped path with its top left point at:
2433
2518
  // {x: 50, y: 25} and a size of {width: 50, height: 50}
2434
2519
  var path = new Path.Rectangle(new Point(50, 25), new Size(50, 50));
@@ -2439,7 +2524,7 @@ path.onFrame = function(event) {
2439
2524
  this.rotate(3);
2440
2525
  }
2441
2526
  </script>
2442
- <div class="canvas"><canvas width="516" height="100" id="canvas-22"></canvas></div>
2527
+ <div class="canvas"><canvas width="516" height="100" id="canvas-23"></canvas></div>
2443
2528
  </div>
2444
2529
 
2445
2530
 
@@ -2483,7 +2568,7 @@ path.onFrame = function(event) {
2483
2568
  <div class="button run">Run</div>
2484
2569
  </div>
2485
2570
 
2486
- <script type="text/paperscript" canvas="canvas-23">
2571
+ <script type="text/paperscript" canvas="canvas-24">
2487
2572
  // Create a circle shaped path at the center of the view:
2488
2573
  var path = new Path.Circle({
2489
2574
  center: view.center,
@@ -2497,7 +2582,7 @@ path.onMouseDown = function(event) {
2497
2582
  this.fillColor = 'red';
2498
2583
  }
2499
2584
  </script>
2500
- <div class="canvas"><canvas width="516" height="100" id="canvas-23"></canvas></div>
2585
+ <div class="canvas"><canvas width="516" height="100" id="canvas-24"></canvas></div>
2501
2586
  </div>
2502
2587
 
2503
2588
 
@@ -2509,7 +2594,7 @@ path.onMouseDown = function(event) {
2509
2594
  <div class="button run">Run</div>
2510
2595
  </div>
2511
2596
 
2512
- <script type="text/paperscript" canvas="canvas-24">
2597
+ <script type="text/paperscript" canvas="canvas-25">
2513
2598
  // Loop 30 times:
2514
2599
  for (var i = 0; i < 30; i++) {
2515
2600
  // Create a circle shaped path at a random position
@@ -2527,7 +2612,7 @@ for (var i = 0; i < 30; i++) {
2527
2612
  }
2528
2613
  }
2529
2614
  </script>
2530
- <div class="canvas"><canvas width="516" height="100" id="canvas-24"></canvas></div>
2615
+ <div class="canvas"><canvas width="516" height="100" id="canvas-25"></canvas></div>
2531
2616
  </div>
2532
2617
 
2533
2618
 
@@ -2571,7 +2656,7 @@ for (var i = 0; i < 30; i++) {
2571
2656
  <div class="button run">Run</div>
2572
2657
  </div>
2573
2658
 
2574
- <script type="text/paperscript" canvas="canvas-25">
2659
+ <script type="text/paperscript" canvas="canvas-26">
2575
2660
  // Create a circle shaped path at the center of the view:
2576
2661
  var path = new Path.Circle({
2577
2662
  center: view.center,
@@ -2584,7 +2669,7 @@ path.onMouseDrag = function(event) {
2584
2669
  path.position += event.delta;
2585
2670
  }
2586
2671
  </script>
2587
- <div class="canvas"><canvas width="516" height="240" id="canvas-25"></canvas></div>
2672
+ <div class="canvas"><canvas width="516" height="240" id="canvas-26"></canvas></div>
2588
2673
  </div>
2589
2674
 
2590
2675
 
@@ -2628,7 +2713,7 @@ path.onMouseDrag = function(event) {
2628
2713
  <div class="button run">Run</div>
2629
2714
  </div>
2630
2715
 
2631
- <script type="text/paperscript" canvas="canvas-26">
2716
+ <script type="text/paperscript" canvas="canvas-27">
2632
2717
  // Create a circle shaped path at the center of the view:
2633
2718
  var path = new Path.Circle({
2634
2719
  center: view.center,
@@ -2642,7 +2727,7 @@ path.onMouseUp = function(event) {
2642
2727
  this.fillColor = 'red';
2643
2728
  }
2644
2729
  </script>
2645
- <div class="canvas"><canvas width="516" height="100" id="canvas-26"></canvas></div>
2730
+ <div class="canvas"><canvas width="516" height="100" id="canvas-27"></canvas></div>
2646
2731
  </div>
2647
2732
 
2648
2733
 
@@ -2686,7 +2771,7 @@ path.onMouseUp = function(event) {
2686
2771
  <div class="button run">Run</div>
2687
2772
  </div>
2688
2773
 
2689
- <script type="text/paperscript" canvas="canvas-27">
2774
+ <script type="text/paperscript" canvas="canvas-28">
2690
2775
  // Create a circle shaped path at the center of the view:
2691
2776
  var path = new Path.Circle({
2692
2777
  center: view.center,
@@ -2700,7 +2785,7 @@ path.onClick = function(event) {
2700
2785
  this.fillColor = 'red';
2701
2786
  }
2702
2787
  </script>
2703
- <div class="canvas"><canvas width="516" height="100" id="canvas-27"></canvas></div>
2788
+ <div class="canvas"><canvas width="516" height="100" id="canvas-28"></canvas></div>
2704
2789
  </div>
2705
2790
 
2706
2791
 
@@ -2712,7 +2797,7 @@ path.onClick = function(event) {
2712
2797
  <div class="button run">Run</div>
2713
2798
  </div>
2714
2799
 
2715
- <script type="text/paperscript" canvas="canvas-28">
2800
+ <script type="text/paperscript" canvas="canvas-29">
2716
2801
  // Loop 30 times:
2717
2802
  for (var i = 0; i < 30; i++) {
2718
2803
  // Create a circle shaped path at a random position
@@ -2730,7 +2815,7 @@ for (var i = 0; i < 30; i++) {
2730
2815
  }
2731
2816
  }
2732
2817
  </script>
2733
- <div class="canvas"><canvas width="516" height="100" id="canvas-28"></canvas></div>
2818
+ <div class="canvas"><canvas width="516" height="100" id="canvas-29"></canvas></div>
2734
2819
  </div>
2735
2820
 
2736
2821
 
@@ -2774,7 +2859,7 @@ for (var i = 0; i < 30; i++) {
2774
2859
  <div class="button run">Run</div>
2775
2860
  </div>
2776
2861
 
2777
- <script type="text/paperscript" canvas="canvas-29">
2862
+ <script type="text/paperscript" canvas="canvas-30">
2778
2863
  // Create a circle shaped path at the center of the view:
2779
2864
  var path = new Path.Circle({
2780
2865
  center: view.center,
@@ -2788,7 +2873,7 @@ path.onDoubleClick = function(event) {
2788
2873
  this.fillColor = 'red';
2789
2874
  }
2790
2875
  </script>
2791
- <div class="canvas"><canvas width="516" height="100" id="canvas-29"></canvas></div>
2876
+ <div class="canvas"><canvas width="516" height="100" id="canvas-30"></canvas></div>
2792
2877
  </div>
2793
2878
 
2794
2879
 
@@ -2800,7 +2885,7 @@ path.onDoubleClick = function(event) {
2800
2885
  <div class="button run">Run</div>
2801
2886
  </div>
2802
2887
 
2803
- <script type="text/paperscript" canvas="canvas-30">
2888
+ <script type="text/paperscript" canvas="canvas-31">
2804
2889
  // Loop 30 times:
2805
2890
  for (var i = 0; i < 30; i++) {
2806
2891
  // Create a circle shaped path at a random position
@@ -2818,7 +2903,7 @@ for (var i = 0; i < 30; i++) {
2818
2903
  }
2819
2904
  }
2820
2905
  </script>
2821
- <div class="canvas"><canvas width="516" height="100" id="canvas-30"></canvas></div>
2906
+ <div class="canvas"><canvas width="516" height="100" id="canvas-31"></canvas></div>
2822
2907
  </div>
2823
2908
 
2824
2909
 
@@ -2862,7 +2947,7 @@ for (var i = 0; i < 30; i++) {
2862
2947
  <div class="button run">Run</div>
2863
2948
  </div>
2864
2949
 
2865
- <script type="text/paperscript" canvas="canvas-31">
2950
+ <script type="text/paperscript" canvas="canvas-32">
2866
2951
  // Create a circle shaped path at the center of the view:
2867
2952
  var path = new Path.Circle({
2868
2953
  center: view.center,
@@ -2870,180 +2955,567 @@ for (var i = 0; i < 30; i++) {
2870
2955
  fillColor: 'black'
2871
2956
  });
2872
2957
 
2873
- // When the mouse moves on top of the item, set its opacity
2874
- // to a random value between 0 and 1:
2875
- path.onMouseMove = function(event) {
2876
- this.opacity = Math.random();
2877
- }
2878
- </script>
2879
- <div class="canvas"><canvas width="516" height="100" id="canvas-31"></canvas></div>
2880
- </div>
2958
+ // When the mouse moves on top of the item, set its opacity
2959
+ // to a random value between 0 and 1:
2960
+ path.onMouseMove = function(event) {
2961
+ this.opacity = Math.random();
2962
+ }
2963
+ </script>
2964
+ <div class="canvas"><canvas width="516" height="100" id="canvas-32"></canvas></div>
2965
+ </div>
2966
+
2967
+
2968
+ </div>
2969
+
2970
+ </div>
2971
+ </div>
2972
+
2973
+
2974
+ <div id="onmouseenter" class="member">
2975
+ <div class="member-link">
2976
+ <a name="onmouseenter" href="#onmouseenter"><tt><b>onMouseEnter</b></tt></a>
2977
+ </div>
2978
+ <div class="member-description hidden">
2979
+
2980
+ <div class="member-text">
2981
+ <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>
2982
+
2983
+
2984
+
2985
+ <ul class="member-list">
2986
+ <h4>Type:</h4>
2987
+ <li>
2988
+ <tt>Function</tt>⟋<tt>null</tt>
2989
+ </li>
2990
+ </ul>
2991
+
2992
+
2993
+ <ul class="member-list">
2994
+ <h4>See also:</h4>
2995
+
2996
+ <li><tt><a href="../classes/View.html#onmouseenter"><tt>view.onMouseEnter</tt></a></tt></li>
2997
+
2998
+ </ul>
2999
+
3000
+ <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>
3001
+
3002
+ <div class="paperscript split">
3003
+
3004
+ <div class="buttons">
3005
+ <div class="button run">Run</div>
3006
+ </div>
3007
+
3008
+ <script type="text/paperscript" canvas="canvas-33">
3009
+ // Create a circle shaped path at the center of the view:
3010
+ var path = new Path.Circle({
3011
+ center: view.center,
3012
+ radius: 25,
3013
+ fillColor: 'black'
3014
+ });
3015
+
3016
+ // When the mouse enters the item, set its fill color to red:
3017
+ path.onMouseEnter = function(event) {
3018
+ this.fillColor = 'red';
3019
+ }
3020
+
3021
+ // When the mouse leaves the item, set its fill color to black:
3022
+ path.onMouseLeave = function(event) {
3023
+ this.fillColor = 'black';
3024
+ }
3025
+ </script>
3026
+ <div class="canvas"><canvas width="516" height="100" id="canvas-33"></canvas></div>
3027
+ </div>
3028
+
3029
+
3030
+ <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>
3031
+
3032
+ <div class="paperscript split">
3033
+
3034
+ <div class="buttons">
3035
+ <div class="button run">Run</div>
3036
+ </div>
3037
+
3038
+ <script type="text/paperscript" canvas="canvas-34">
3039
+ function enter(event) {
3040
+ this.fillColor = 'red';
3041
+ }
3042
+
3043
+ function leave(event) {
3044
+ this.fillColor = 'black';
3045
+ }
3046
+
3047
+ // When the mouse is pressed:
3048
+ function onMouseDown(event) {
3049
+ // Create a circle shaped path at the position of the mouse:
3050
+ var path = new Path.Circle(event.point, 25);
3051
+ path.fillColor = 'black';
3052
+
3053
+ // When the mouse enters the item, set its fill color to red:
3054
+ path.onMouseEnter = enter;
3055
+
3056
+ // When the mouse leaves the item, set its fill color to black:
3057
+ path.onMouseLeave = leave;
3058
+ }
3059
+ </script>
3060
+ <div class="canvas"><canvas width="516" height="100" id="canvas-34"></canvas></div>
3061
+ </div>
3062
+
3063
+
3064
+ </div>
3065
+
3066
+ </div>
3067
+ </div>
3068
+
3069
+
3070
+ <div id="onmouseleave" class="member">
3071
+ <div class="member-link">
3072
+ <a name="onmouseleave" href="#onmouseleave"><tt><b>onMouseLeave</b></tt></a>
3073
+ </div>
3074
+ <div class="member-description hidden">
3075
+
3076
+ <div class="member-text">
3077
+ <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>
3078
+
3079
+
3080
+
3081
+ <ul class="member-list">
3082
+ <h4>Type:</h4>
3083
+ <li>
3084
+ <tt>Function</tt>⟋<tt>null</tt>
3085
+ </li>
3086
+ </ul>
3087
+
3088
+
3089
+ <ul class="member-list">
3090
+ <h4>See also:</h4>
3091
+
3092
+ <li><tt><a href="../classes/View.html#onmouseleave"><tt>view.onMouseLeave</tt></a></tt></li>
3093
+
3094
+ </ul>
3095
+
3096
+ <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>
3097
+
3098
+ <div class="paperscript split">
3099
+
3100
+ <div class="buttons">
3101
+ <div class="button run">Run</div>
3102
+ </div>
3103
+
3104
+ <script type="text/paperscript" canvas="canvas-35">
3105
+ // Create a circle shaped path at the center of the view:
3106
+ var path = new Path.Circle({
3107
+ center: view.center,
3108
+ radius: 25,
3109
+ fillColor: 'black'
3110
+ });
3111
+
3112
+ // When the mouse leaves the item, set its fill color to red:
3113
+ path.onMouseLeave = function(event) {
3114
+ this.fillColor = 'red';
3115
+ }
3116
+ </script>
3117
+ <div class="canvas"><canvas width="516" height="100" id="canvas-35"></canvas></div>
3118
+ </div>
3119
+
3120
+
3121
+ </div>
3122
+
3123
+ </div>
3124
+ </div>
3125
+
3126
+
3127
+ <div id="ondraw" class="member">
3128
+ <div class="member-link">
3129
+ <a name="ondraw" href="#ondraw"><tt><b>onDraw</b></tt></a>
3130
+ </div>
3131
+ <div class="member-description hidden">
3132
+
3133
+ <div class="member-text">
3134
+ <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>
3135
+
3136
+
3137
+
3138
+ <ul class="member-list">
3139
+ <h4>Type:</h4>
3140
+ <li>
3141
+ <tt>Function</tt>⟋<tt>null</tt>
3142
+ </li>
3143
+ </ul>
3144
+ <ul class="member-list">
3145
+ <h4>Options:</h4>
3146
+ <li><tt>event.item: <a href="../classes/Item.html"><tt>Item</tt></a></tt> &mdash; the item that is drawn</li>
3147
+ <li><tt>event.context: <tt>CanvasRenderingContext2D</tt></tt> &mdash; the canvas context, transformed into the item&rsquo;s coordinates</li>
3148
+ <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>
3149
+ <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>
3150
+ <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>()
3151
+ 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>
3152
+ </ul>
3153
+
3154
+ <h4>Example:<span class="description">Draw a hairline cross through the center of a circle, beneath it:</span></h4>
3155
+
3156
+ <div class="paperscript split">
3157
+
3158
+ <div class="buttons">
3159
+ <div class="button run">Run</div>
3160
+ </div>
3161
+
3162
+ <script type="text/paperscript" canvas="canvas-36">
3163
+ var path = new Path.Circle({
3164
+ center: view.center,
3165
+ radius: 25,
3166
+ fillColor: 'rgba(255, 0, 0, 0.5)'
3167
+ });
3168
+
3169
+ path.onDraw = function(event) {
3170
+ var ctx = event.context,
3171
+ center = this.position,
3172
+ scale = event.matrix.scaling.x;
3173
+ ctx.beginPath();
3174
+ ctx.moveTo(center.x - 40, center.y);
3175
+ ctx.lineTo(center.x + 40, center.y);
3176
+ ctx.moveTo(center.x, center.y - 40);
3177
+ ctx.lineTo(center.x, center.y + 40);
3178
+ ctx.lineWidth = 1 / scale;
3179
+ ctx.stroke();
3180
+ }
3181
+ </script>
3182
+ <div class="canvas"><canvas width="516" height="100" id="canvas-36"></canvas></div>
3183
+ </div>
3184
+
3185
+
3186
+ </div>
3187
+
3188
+ </div>
3189
+ </div>
3190
+
3191
+
3192
+ <div id="ondrawselection" class="member">
3193
+ <div class="member-link">
3194
+ <a name="ondrawselection" href="#ondrawselection"><tt><b>onDrawSelection</b></tt></a>
3195
+ </div>
3196
+ <div class="member-description hidden">
3197
+
3198
+ <div class="member-text">
3199
+ <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>
3200
+
3201
+
3202
+
3203
+ <ul class="member-list">
3204
+ <h4>Type:</h4>
3205
+ <li>
3206
+ <tt>Function</tt>⟋<tt>null</tt>
3207
+ </li>
3208
+ </ul>
3209
+ <ul class="member-list">
3210
+ <h4>Options:</h4>
3211
+ <li><tt>event.item: <a href="../classes/Item.html"><tt>Item</tt></a></tt> &mdash; the selected item</li>
3212
+ <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>
3213
+ <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>
3214
+ <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>
3215
+ <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>
3216
+ <li><tt>event.view: <a href="../classes/View.html"><tt>View</tt></a></tt> &mdash; the view drawn into
3217
+ What the handler draws isn&rsquo;t part of the item&rsquo;s hit testing, its bounds or its SVG export.</li>
3218
+ </ul>
3219
+
3220
+ <h4>Example:<span class="description">Draw the selection of a path as a dot at each segment:</span></h4>
3221
+
3222
+ <div class="paperscript split">
3223
+
3224
+ <div class="buttons">
3225
+ <div class="button run">Run</div>
3226
+ </div>
3227
+
3228
+ <script type="text/paperscript" canvas="canvas-37">
3229
+ var path = new Path.Star({
3230
+ center: view.center,
3231
+ points: 5,
3232
+ radius1: 20,
3233
+ radius2: 40,
3234
+ strokeColor: 'black',
3235
+ selected: true
3236
+ });
3237
+
3238
+ path.onDrawSelection = function(event) {
3239
+ var ctx = event.context;
3240
+ this.segments.forEach(function(segment) {
3241
+ var point = event.matrix.transform(segment.point);
3242
+ ctx.beginPath();
3243
+ ctx.arc(point.x, point.y, event.size, 0, Math.PI * 2);
3244
+ ctx.fill();
3245
+ });
3246
+ return false;
3247
+ }
3248
+ </script>
3249
+ <div class="canvas"><canvas width="516" height="100" id="canvas-37"></canvas></div>
3250
+ </div>
3251
+
3252
+
3253
+ </div>
3254
+
3255
+ </div>
3256
+ </div>
3257
+
3258
+ </div>
3259
+
3260
+
3261
+ <!-- =========================== inherited methods ========================= -->
3262
+ <div class="reference-members"><h2>Methods inherited from <a href="../classes/Item.html"><tt>Item</tt></a></h2>
3263
+
3264
+
3265
+ <div id="addeffect-effect" class="member">
3266
+ <div class="member-link">
3267
+ <a name="addeffect-effect" href="#addeffect-effect"><tt><b>addEffect</b>(effect)</tt></a>
3268
+ </div>
3269
+ <div class="member-description hidden">
3270
+ <div class="member-text">
3271
+ <p>Adds an effect at the end of the item&rsquo;s effects.</p>
3272
+
3273
+
3274
+ <ul class="member-list">
3275
+ <h4>Parameters:</h4>
3276
+
3277
+ <li>
3278
+ <tt>effect:</tt>
3279
+ <tt>Object</tt>
3280
+ &mdash;&nbsp;the plain object describing the effect
3281
+
3282
+ </li>
3283
+
3284
+ </ul>
3285
+
3286
+
3287
+ <ul class="member-list">
3288
+ <h4>Returns:</h4>
3289
+
3290
+ <li>
3291
+ <tt><a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a></tt>&nbsp;&mdash;&nbsp;the added instance
3292
+ </li>
3293
+
3294
+
3295
+ </ul>
3296
+
3297
+
3298
+
3299
+
3300
+
3301
+ </div>
3302
+ </div>
3303
+ </div>
3304
+
3305
+
3306
+ <div id="inserteffect-index-effect" class="member">
3307
+ <div class="member-link">
3308
+ <a name="inserteffect-index-effect" href="#inserteffect-index-effect"><tt><b>insertEffect</b>(index, effect)</tt></a>
3309
+ </div>
3310
+ <div class="member-description hidden">
3311
+ <div class="member-text">
3312
+ <p>Inserts an effect into the item&rsquo;s effects at the given index.</p>
3313
+
3314
+
3315
+ <ul class="member-list">
3316
+ <h4>Parameters:</h4>
3317
+
3318
+ <li>
3319
+ <tt>index:</tt>
3320
+ <tt>Number</tt>
3321
+ &mdash;&nbsp;the index at which to insert the effect
3322
+
3323
+ </li>
3324
+
3325
+ <li>
3326
+ <tt>effect:</tt>
3327
+ <tt>Object</tt>
3328
+ &mdash;&nbsp;the plain object describing the effect
3329
+
3330
+ </li>
3331
+
3332
+ </ul>
3333
+
3334
+
3335
+ <ul class="member-list">
3336
+ <h4>Returns:</h4>
3337
+
3338
+ <li>
3339
+ <tt><a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a></tt>&nbsp;&mdash;&nbsp;the inserted instance
3340
+ </li>
3341
+
3342
+
3343
+ </ul>
3344
+
3345
+
3346
+
3347
+
3348
+
3349
+ </div>
3350
+ </div>
3351
+ </div>
3352
+
3353
+
3354
+ <div id="inserteffects-index-effects" class="member">
3355
+ <div class="member-link">
3356
+ <a name="inserteffects-index-effects" href="#inserteffects-index-effects"><tt><b>insertEffects</b>(index, effects)</tt></a>
3357
+ </div>
3358
+ <div class="member-description hidden">
3359
+ <div class="member-text">
3360
+ <p>Inserts effects into the item&rsquo;s effects at the given index.</p>
3361
+
3362
+
3363
+ <ul class="member-list">
3364
+ <h4>Parameters:</h4>
3365
+
3366
+ <li>
3367
+ <tt>index:</tt>
3368
+ <tt>Number</tt>
3369
+ &mdash;&nbsp;the index at which to insert the effects
3370
+
3371
+ </li>
3372
+
3373
+ <li>
3374
+ <tt>effects:</tt>
3375
+ Array of <tt>Object</tt> objects
3376
+ &mdash;&nbsp;the plain objects describing the effects
3377
+
3378
+ </li>
3379
+
3380
+ </ul>
3381
+
3382
+
3383
+ <ul class="member-list">
3384
+ <h4>Returns:</h4>
3385
+
3386
+ <li>
3387
+ <tt>Array of <a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a> objects</tt>&nbsp;&mdash;&nbsp;the inserted instances
3388
+ </li>
3389
+
3390
+
3391
+ </ul>
2881
3392
 
2882
3393
 
2883
- </div>
2884
3394
 
3395
+
3396
+
3397
+ </div>
2885
3398
  </div>
2886
3399
  </div>
2887
3400
 
2888
3401
 
2889
- <div id="onmouseenter" class="member">
3402
+ <div id="removeeffect-index" class="member">
2890
3403
  <div class="member-link">
2891
- <a name="onmouseenter" href="#onmouseenter"><tt><b>onMouseEnter</b></tt></a>
3404
+ <a name="removeeffect-index" href="#removeeffect-index"><tt><b>removeEffect</b>(index)</tt></a>
2892
3405
  </div>
2893
3406
  <div class="member-description hidden">
2894
-
2895
3407
  <div class="member-text">
2896
- <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>
3408
+ <p>Removes the effect at the given index from the item&rsquo;s effects.</p>
3409
+
2897
3410
 
3411
+ <ul class="member-list">
3412
+ <h4>Parameters:</h4>
2898
3413
 
3414
+ <li>
3415
+ <tt>index:</tt>
3416
+ <tt>Number</tt>
3417
+ &mdash;&nbsp;the index of the effect to remove
3418
+
3419
+ </li>
2899
3420
 
2900
- <ul class="member-list">
2901
- <h4>Type:</h4>
2902
- <li>
2903
- <tt>Function</tt>⟋<tt>null</tt>
2904
- </li>
2905
- </ul>
2906
-
3421
+ </ul>
3422
+
2907
3423
 
2908
3424
  <ul class="member-list">
2909
- <h4>See also:</h4>
3425
+ <h4>Returns:</h4>
2910
3426
 
2911
- <li><tt><a href="../classes/View.html#onmouseenter"><tt>view.onMouseEnter</tt></a></tt></li>
3427
+ <li>
3428
+ <tt><a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a></tt>&nbsp;&mdash;&nbsp;the removed instance, or <code>null</code>
3429
+ </li>
3430
+
2912
3431
 
2913
3432
  </ul>
2914
3433
 
2915
- <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>
2916
3434
 
2917
- <div class="paperscript split">
2918
3435
 
2919
- <div class="buttons">
2920
- <div class="button run">Run</div>
3436
+
3437
+
2921
3438
  </div>
2922
-
2923
- <script type="text/paperscript" canvas="canvas-32">
2924
- // Create a circle shaped path at the center of the view:
2925
- var path = new Path.Circle({
2926
- center: view.center,
2927
- radius: 25,
2928
- fillColor: 'black'
2929
- });
2930
-
2931
- // When the mouse enters the item, set its fill color to red:
2932
- path.onMouseEnter = function(event) {
2933
- this.fillColor = 'red';
2934
- }
2935
-
2936
- // When the mouse leaves the item, set its fill color to black:
2937
- path.onMouseLeave = function(event) {
2938
- this.fillColor = 'black';
2939
- }
2940
- </script>
2941
- <div class="canvas"><canvas width="516" height="100" id="canvas-32"></canvas></div>
2942
3439
  </div>
2943
-
2944
-
2945
- <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>
2946
-
2947
- <div class="paperscript split">
2948
-
2949
- <div class="buttons">
2950
- <div class="button run">Run</div>
2951
3440
  </div>
2952
3441
 
2953
- <script type="text/paperscript" canvas="canvas-33">
2954
- function enter(event) {
2955
- this.fillColor = 'red';
2956
- }
2957
-
2958
- function leave(event) {
2959
- this.fillColor = 'black';
2960
- }
3442
+
3443
+ <div id="removeeffects" class="member">
3444
+ <div class="member-link">
3445
+ <a name="removeeffects" href="#removeeffects"><tt><b>removeEffects</b>([start[, end]])</tt></a>
3446
+ </div>
3447
+ <div class="member-description hidden">
3448
+ <div class="member-text">
3449
+ <p>Removes the effects from the start index to the end index from the item&rsquo;s effects, or all of them.</p>
3450
+
3451
+
3452
+ <ul class="member-list">
3453
+ <h4>Parameters:</h4>
3454
+
3455
+ <li>
3456
+ <tt>start:</tt>
3457
+ <tt>Number</tt>
3458
+ &mdash;&nbsp;the index of the first effect to remove
3459
+ &mdash;&nbsp;optional, default: <tt>0</tt>
3460
+ </li>
3461
+
3462
+ <li>
3463
+ <tt>end:</tt>
3464
+ <tt>Number</tt>
3465
+ &mdash;&nbsp;the index after the last one
3466
+ &mdash;&nbsp;optional, default: <tt>effects.length</tt>
3467
+ </li>
3468
+
3469
+ </ul>
2961
3470
 
2962
- // When the mouse is pressed:
2963
- function onMouseDown(event) {
2964
- // Create a circle shaped path at the position of the mouse:
2965
- var path = new Path.Circle(event.point, 25);
2966
- path.fillColor = 'black';
3471
+
3472
+ <ul class="member-list">
3473
+ <h4>Returns:</h4>
3474
+
3475
+ <li>
3476
+ <tt>Array of <a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a> objects</tt>&nbsp;&mdash;&nbsp;the removed instances
3477
+ </li>
2967
3478
 
2968
- // When the mouse enters the item, set its fill color to red:
2969
- path.onMouseEnter = enter;
3479
+
3480
+ </ul>
2970
3481
 
2971
- // When the mouse leaves the item, set its fill color to black:
2972
- path.onMouseLeave = leave;
2973
- }
2974
- </script>
2975
- <div class="canvas"><canvas width="516" height="100" id="canvas-33"></canvas></div>
2976
- </div>
2977
3482
 
2978
3483
 
3484
+
3485
+
2979
3486
  </div>
2980
-
2981
3487
  </div>
2982
3488
  </div>
2983
3489
 
2984
3490
 
2985
- <div id="onmouseleave" class="member">
3491
+ <div id="geteffectoutput" class="member">
2986
3492
  <div class="member-link">
2987
- <a name="onmouseleave" href="#onmouseleave"><tt><b>onMouseLeave</b></tt></a>
3493
+ <a name="geteffectoutput" href="#geteffectoutput"><tt><b>getEffectOutput</b>()</tt></a>
2988
3494
  </div>
2989
3495
  <div class="member-description hidden">
2990
-
2991
3496
  <div class="member-text">
2992
- <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>
2993
-
2994
-
2995
-
2996
- <ul class="member-list">
2997
- <h4>Type:</h4>
2998
- <li>
2999
- <tt>Function</tt>⟋<tt>null</tt>
3000
- </li>
3001
- </ul>
3497
+ <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>
3002
3498
 
3003
3499
 
3500
+
3004
3501
  <ul class="member-list">
3005
- <h4>See also:</h4>
3502
+ <h4>Returns:</h4>
3006
3503
 
3007
- <li><tt><a href="../classes/View.html#onmouseleave"><tt>view.onMouseLeave</tt></a></tt></li>
3504
+ <li>
3505
+ <tt><a href="../classes/Item.html"><tt>Item</tt></a>⟋<tt>null</tt></tt>&nbsp;&mdash;&nbsp;the output of the effects
3506
+ </li>
3507
+
3008
3508
 
3009
3509
  </ul>
3010
3510
 
3011
- <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>
3012
-
3013
- <div class="paperscript split">
3014
-
3015
- <div class="buttons">
3016
- <div class="button run">Run</div>
3017
- </div>
3018
-
3019
- <script type="text/paperscript" canvas="canvas-34">
3020
- // Create a circle shaped path at the center of the view:
3021
- var path = new Path.Circle({
3022
- center: view.center,
3023
- radius: 25,
3024
- fillColor: 'black'
3025
- });
3026
-
3027
- // When the mouse leaves the item, set its fill color to red:
3028
- path.onMouseLeave = function(event) {
3029
- this.fillColor = 'red';
3030
- }
3031
- </script>
3032
- <div class="canvas"><canvas width="516" height="100" id="canvas-34"></canvas></div>
3033
- </div>
3034
-
3035
3511
 
3036
- </div>
3037
3512
 
3513
+
3514
+
3038
3515
  </div>
3039
3516
  </div>
3040
-
3041
3517
  </div>
3042
3518
 
3043
-
3044
- <!-- =========================== inherited methods ========================= -->
3045
- <div class="reference-members"><h2>Methods inherited from <a href="../classes/Item.html"><tt>Item</tt></a></h2>
3046
-
3047
3519
 
3048
3520
  <div id="set-props" class="member">
3049
3521
  <div class="member-link">
@@ -3088,7 +3560,7 @@ path.onMouseLeave = function(event) {
3088
3560
  <div class="button run">Run</div>
3089
3561
  </div>
3090
3562
 
3091
- <script type="text/paperscript" canvas="canvas-35">
3563
+ <script type="text/paperscript" canvas="canvas-38">
3092
3564
  var circle = new Path.Circle({
3093
3565
  center: [80, 50],
3094
3566
  radius: 35
@@ -3101,7 +3573,7 @@ circle.set({
3101
3573
  selected: true
3102
3574
  });
3103
3575
  </script>
3104
- <div class="canvas"><canvas width="516" height="100" id="canvas-35"></canvas></div>
3576
+ <div class="canvas"><canvas width="516" height="100" id="canvas-38"></canvas></div>
3105
3577
  </div>
3106
3578
 
3107
3579
 
@@ -3157,7 +3629,7 @@ circle.set({
3157
3629
  <div class="button run">Run</div>
3158
3630
  </div>
3159
3631
 
3160
- <script type="text/paperscript" canvas="canvas-36">
3632
+ <script type="text/paperscript" canvas="canvas-39">
3161
3633
  var circle = new Path.Circle({
3162
3634
  center: [50, 50],
3163
3635
  radius: 10,
@@ -3172,7 +3644,7 @@ for (var i = 0; i < 20; i++) {
3172
3644
  copy.position.x += i * copy.bounds.width;
3173
3645
  }
3174
3646
  </script>
3175
- <div class="canvas"><canvas width="516" height="100" id="canvas-36"></canvas></div>
3647
+ <div class="canvas"><canvas width="516" height="100" id="canvas-39"></canvas></div>
3176
3648
  </div>
3177
3649
 
3178
3650
 
@@ -3298,7 +3770,7 @@ for (var i = 0; i < 20; i++) {
3298
3770
  <div class="button run">Run</div>
3299
3771
  </div>
3300
3772
 
3301
- <script type="text/paperscript" canvas="canvas-37">
3773
+ <script type="text/paperscript" canvas="canvas-40">
3302
3774
  var circle = new Path.Circle({
3303
3775
  center: [50, 50],
3304
3776
  radius: 5,
@@ -3315,7 +3787,7 @@ raster.position.x += 100;
3315
3787
  circle.scale(5);
3316
3788
  raster.scale(5);
3317
3789
  </script>
3318
- <div class="canvas"><canvas width="516" height="100" id="canvas-37"></canvas></div>
3790
+ <div class="canvas"><canvas width="516" height="100" id="canvas-40"></canvas></div>
3319
3791
  </div>
3320
3792
 
3321
3793
 
@@ -3369,7 +3841,7 @@ raster.scale(5);
3369
3841
  <div class="button run">Run</div>
3370
3842
  </div>
3371
3843
 
3372
- <script type="text/paperscript" canvas="canvas-38">
3844
+ <script type="text/paperscript" canvas="canvas-41">
3373
3845
  var path = new Path.Star({
3374
3846
  center: [50, 50],
3375
3847
  points: 12,
@@ -3390,7 +3862,7 @@ function onMouseDown(event) {
3390
3862
  }
3391
3863
  }
3392
3864
  </script>
3393
- <div class="canvas"><canvas width="516" height="100" id="canvas-38"></canvas></div>
3865
+ <div class="canvas"><canvas width="516" height="100" id="canvas-41"></canvas></div>
3394
3866
  </div>
3395
3867
 
3396
3868
 
@@ -3908,11 +4380,17 @@ function onMouseDown(event) {
3908
4380
  </div>
3909
4381
  <div class="member-description hidden">
3910
4382
  <div class="member-text">
3911
- <p>Exports the item with its content and child items as an SVG DOM.</p>
4383
+ <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>
3912
4384
  <ul class="member-list">
3913
4385
  <h4>Options:</h4>
3914
- <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>
3915
- <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>
4386
+ <li>[options.bounds] {String|Rectangle} the bounds of the area to
4387
+ export, either as a string ({@values 'view', content'}), or a
4388
+ {@link Rectangle} object: `'view'` uses the view bounds,
4389
+ `'content'` uses the stroke bounds of the item</li>
4390
+ <li>[options.matrix] {Matrix} the matrix with which to transform the
4391
+ exported content: If `options.bounds` is set to `'view'`,
4392
+ `paper.view.matrix` is used, for all other settings of
4393
+ `options.bounds` the identity matrix is used.</li>
3916
4394
  <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>
3917
4395
  <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>
3918
4396
  <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>
@@ -5266,7 +5744,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
5266
5744
  <div class="button run">Run</div>
5267
5745
  </div>
5268
5746
 
5269
- <script type="text/paperscript" canvas="canvas-39">
5747
+ <script type="text/paperscript" canvas="canvas-42">
5270
5748
  // Create a rectangle shaped path with its top left
5271
5749
  // point at {x: 80, y: 25} and a size of {width: 50, height: 50}:
5272
5750
  var path = new Path.Rectangle(new Point(80, 25), new Size(50, 50));
@@ -5275,7 +5753,7 @@ path.fillColor = 'black';
5275
5753
  // Rotate the path by 30 degrees:
5276
5754
  path.rotate(30);
5277
5755
  </script>
5278
- <div class="canvas"><canvas width="516" height="100" id="canvas-39"></canvas></div>
5756
+ <div class="canvas"><canvas width="516" height="100" id="canvas-42"></canvas></div>
5279
5757
  </div>
5280
5758
 
5281
5759
 
@@ -5287,7 +5765,7 @@ path.rotate(30);
5287
5765
  <div class="button run">Run</div>
5288
5766
  </div>
5289
5767
 
5290
- <script type="text/paperscript" canvas="canvas-40">
5768
+ <script type="text/paperscript" canvas="canvas-43">
5291
5769
  // Create a rectangle shaped path with its top left
5292
5770
  // point at {x: 175, y: 50} and a size of {width: 100, height: 100}:
5293
5771
  var topLeft = new Point(175, 50);
@@ -5309,7 +5787,7 @@ function onFrame(event) {
5309
5787
  path.rotate(3, view.center);
5310
5788
  }
5311
5789
  </script>
5312
- <div class="canvas"><canvas width="516" height="200" id="canvas-40"></canvas></div>
5790
+ <div class="canvas"><canvas width="516" height="200" id="canvas-43"></canvas></div>
5313
5791
  </div>
5314
5792
 
5315
5793
 
@@ -5358,7 +5836,7 @@ function onFrame(event) {
5358
5836
  <div class="button run">Run</div>
5359
5837
  </div>
5360
5838
 
5361
- <script type="text/paperscript" canvas="canvas-41">
5839
+ <script type="text/paperscript" canvas="canvas-44">
5362
5840
  // Create a circle shaped path at { x: 80, y: 50 }
5363
5841
  // with a radius of 20:
5364
5842
  var circle = new Path.Circle({
@@ -5370,7 +5848,7 @@ var circle = new Path.Circle({
5370
5848
  // Scale the path by 150% from its center point
5371
5849
  circle.scale(1.5);
5372
5850
  </script>
5373
- <div class="canvas"><canvas width="516" height="100" id="canvas-41"></canvas></div>
5851
+ <div class="canvas"><canvas width="516" height="100" id="canvas-44"></canvas></div>
5374
5852
  </div>
5375
5853
 
5376
5854
 
@@ -5382,7 +5860,7 @@ circle.scale(1.5);
5382
5860
  <div class="button run">Run</div>
5383
5861
  </div>
5384
5862
 
5385
- <script type="text/paperscript" canvas="canvas-42">
5863
+ <script type="text/paperscript" canvas="canvas-45">
5386
5864
  // Create a circle shaped path at { x: 80, y: 50 }
5387
5865
  // with a radius of 20:
5388
5866
  var circle = new Path.Circle({
@@ -5394,7 +5872,7 @@ var circle = new Path.Circle({
5394
5872
  // Scale the path 150% from its bottom left corner
5395
5873
  circle.scale(1.5, circle.bounds.bottomLeft);
5396
5874
  </script>
5397
- <div class="canvas"><canvas width="516" height="100" id="canvas-42"></canvas></div>
5875
+ <div class="canvas"><canvas width="516" height="100" id="canvas-45"></canvas></div>
5398
5876
  </div>
5399
5877
 
5400
5878
 
@@ -5450,7 +5928,7 @@ circle.scale(1.5, circle.bounds.bottomLeft);
5450
5928
  <div class="button run">Run</div>
5451
5929
  </div>
5452
5930
 
5453
- <script type="text/paperscript" canvas="canvas-43">
5931
+ <script type="text/paperscript" canvas="canvas-46">
5454
5932
  // Create a circle shaped path at { x: 100, y: 50 }
5455
5933
  // with a radius of 20:
5456
5934
  var circle = new Path.Circle({
@@ -5462,7 +5940,7 @@ var circle = new Path.Circle({
5462
5940
  // Scale the path horizontally by 300%
5463
5941
  circle.scale(3, 1);
5464
5942
  </script>
5465
- <div class="canvas"><canvas width="516" height="100" id="canvas-43"></canvas></div>
5943
+ <div class="canvas"><canvas width="516" height="100" id="canvas-46"></canvas></div>
5466
5944
  </div>
5467
5945
 
5468
5946
 
@@ -5900,7 +6378,7 @@ circle.scale(3, 1);
5900
6378
  <div class="button run">Run</div>
5901
6379
  </div>
5902
6380
 
5903
- <script type="text/paperscript" canvas="canvas-44">
6381
+ <script type="text/paperscript" canvas="canvas-47">
5904
6382
  // Create a rectangle shaped path with its top left corner
5905
6383
  // at {x: 80, y: 25} and a size of {width: 75, height: 50}:
5906
6384
  var path = new Path.Rectangle({
@@ -5921,7 +6399,7 @@ var circlePath = new Path.Circle({
5921
6399
  // the rectangular path:
5922
6400
  circlePath.fitBounds(path.bounds);
5923
6401
  </script>
5924
- <div class="canvas"><canvas width="516" height="100" id="canvas-44"></canvas></div>
6402
+ <div class="canvas"><canvas width="516" height="100" id="canvas-47"></canvas></div>
5925
6403
  </div>
5926
6404
 
5927
6405
 
@@ -5933,7 +6411,7 @@ circlePath.fitBounds(path.bounds);
5933
6411
  <div class="button run">Run</div>
5934
6412
  </div>
5935
6413
 
5936
- <script type="text/paperscript" canvas="canvas-45">
6414
+ <script type="text/paperscript" canvas="canvas-48">
5937
6415
  // Create a rectangle shaped path with its top left corner
5938
6416
  // at {x: 80, y: 25} and a size of {width: 75, height: 50}:
5939
6417
  var path = new Path.Rectangle({
@@ -5954,7 +6432,7 @@ var circlePath = new Path.Circle({
5954
6432
  // the rectangular path:
5955
6433
  circlePath.fitBounds(path.bounds, 'cover');
5956
6434
  </script>
5957
- <div class="canvas"><canvas width="516" height="100" id="canvas-45"></canvas></div>
6435
+ <div class="canvas"><canvas width="516" height="100" id="canvas-48"></canvas></div>
5958
6436
  </div>
5959
6437
 
5960
6438
 
@@ -5966,7 +6444,7 @@ circlePath.fitBounds(path.bounds, 'cover');
5966
6444
  <div class="button run">Run</div>
5967
6445
  </div>
5968
6446
 
5969
- <script type="text/paperscript" canvas="canvas-46">
6447
+ <script type="text/paperscript" canvas="canvas-49">
5970
6448
  var path = new Path.Circle({
5971
6449
  center: [80, 50],
5972
6450
  radius: 30,
@@ -5976,7 +6454,7 @@ var path = new Path.Circle({
5976
6454
  // Fit the path to the bounding rectangle of the view:
5977
6455
  path.fitBounds(view.bounds);
5978
6456
  </script>
5979
- <div class="canvas"><canvas width="516" height="200" id="canvas-46"></canvas></div>
6457
+ <div class="canvas"><canvas width="516" height="200" id="canvas-49"></canvas></div>
5980
6458
  </div>
5981
6459
 
5982
6460
 
@@ -6002,7 +6480,7 @@ path.fitBounds(view.bounds);
6002
6480
  <li>
6003
6481
  <tt>type:</tt>
6004
6482
  <tt>String</tt>
6005
- &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>
6483
+ &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>
6006
6484
 
6007
6485
  </li>
6008
6486
 
@@ -6037,7 +6515,7 @@ path.fitBounds(view.bounds);
6037
6515
  <div class="button run">Run</div>
6038
6516
  </div>
6039
6517
 
6040
- <script type="text/paperscript" canvas="canvas-47">
6518
+ <script type="text/paperscript" canvas="canvas-50">
6041
6519
  // Create a circle shaped path at the center of the view:
6042
6520
  var path = new Path.Circle({
6043
6521
  center: view.center,
@@ -6055,7 +6533,7 @@ path.on('mouseleave', function() {
6055
6533
  this.fillColor = 'black';
6056
6534
  });
6057
6535
  </script>
6058
- <div class="canvas"><canvas width="516" height="100" id="canvas-47"></canvas></div>
6536
+ <div class="canvas"><canvas width="516" height="100" id="canvas-50"></canvas></div>
6059
6537
  </div>
6060
6538
 
6061
6539
 
@@ -6079,7 +6557,7 @@ path.on('mouseleave', function() {
6079
6557
  <li>
6080
6558
  <tt>object:</tt>
6081
6559
  <tt>Object</tt>
6082
- &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>
6560
+ &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>
6083
6561
 
6084
6562
  </li>
6085
6563
 
@@ -6107,7 +6585,7 @@ path.on('mouseleave', function() {
6107
6585
  <div class="button run">Run</div>
6108
6586
  </div>
6109
6587
 
6110
- <script type="text/paperscript" canvas="canvas-48">
6588
+ <script type="text/paperscript" canvas="canvas-51">
6111
6589
  // Create a circle shaped path at the center of the view:
6112
6590
  var path = new Path.Circle({
6113
6591
  center: view.center,
@@ -6125,7 +6603,7 @@ path.on({
6125
6603
  }
6126
6604
  });
6127
6605
  </script>
6128
- <div class="canvas"><canvas width="516" height="100" id="canvas-48"></canvas></div>
6606
+ <div class="canvas"><canvas width="516" height="100" id="canvas-51"></canvas></div>
6129
6607
  </div>
6130
6608
 
6131
6609
 
@@ -6137,7 +6615,7 @@ path.on({
6137
6615
  <div class="button run">Run</div>
6138
6616
  </div>
6139
6617
 
6140
- <script type="text/paperscript" canvas="canvas-49">
6618
+ <script type="text/paperscript" canvas="canvas-52">
6141
6619
  var pathHandlers = {
6142
6620
  mouseenter: function(event) {
6143
6621
  this.fillColor = 'red';
@@ -6160,7 +6638,7 @@ function onMouseDown(event) {
6160
6638
  path.on(pathHandlers);
6161
6639
  }
6162
6640
  </script>
6163
- <div class="canvas"><canvas width="516" height="100" id="canvas-49"></canvas></div>
6641
+ <div class="canvas"><canvas width="516" height="100" id="canvas-52"></canvas></div>
6164
6642
  </div>
6165
6643
 
6166
6644
 
@@ -6184,7 +6662,7 @@ function onMouseDown(event) {
6184
6662
  <li>
6185
6663
  <tt>type:</tt>
6186
6664
  <tt>String</tt>
6187
- &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>
6665
+ &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>
6188
6666
 
6189
6667
  </li>
6190
6668
 
@@ -6232,7 +6710,7 @@ function onMouseDown(event) {
6232
6710
  <li>
6233
6711
  <tt>object:</tt>
6234
6712
  <tt>Object</tt>
6235
- &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>
6713
+ &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>
6236
6714
 
6237
6715
  </li>
6238
6716
 
@@ -6273,7 +6751,7 @@ function onMouseDown(event) {
6273
6751
  <li>
6274
6752
  <tt>type:</tt>
6275
6753
  <tt>String</tt>
6276
- &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>
6754
+ &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>
6277
6755
 
6278
6756
  </li>
6279
6757
 
@@ -6321,7 +6799,7 @@ function onMouseDown(event) {
6321
6799
  <li>
6322
6800
  <tt>type:</tt>
6323
6801
  <tt>String</tt>
6324
- &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>
6802
+ &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>
6325
6803
 
6326
6804
  </li>
6327
6805
 
@@ -6388,7 +6866,7 @@ function onMouseDown(event) {
6388
6866
  <div class="button run">Run</div>
6389
6867
  </div>
6390
6868
 
6391
- <script type="text/paperscript" canvas="canvas-50">
6869
+ <script type="text/paperscript" canvas="canvas-53">
6392
6870
  function onMouseDrag(event) {
6393
6871
  // Create a circle shaped path at the mouse position,
6394
6872
  // with a radius of 10:
@@ -6405,7 +6883,7 @@ function onMouseDrag(event) {
6405
6883
  });
6406
6884
  }
6407
6885
  </script>
6408
- <div class="canvas"><canvas width="516" height="200" id="canvas-50"></canvas></div>
6886
+ <div class="canvas"><canvas width="516" height="200" id="canvas-53"></canvas></div>
6409
6887
  </div>
6410
6888
 
6411
6889
 
@@ -6435,7 +6913,7 @@ function onMouseDrag(event) {
6435
6913
  <div class="button run">Run</div>
6436
6914
  </div>
6437
6915
 
6438
- <script type="text/paperscript" canvas="canvas-51">
6916
+ <script type="text/paperscript" canvas="canvas-54">
6439
6917
  function onMouseMove(event) {
6440
6918
  // Create a circle shaped path at the mouse position,
6441
6919
  // with a radius of 10:
@@ -6449,7 +6927,7 @@ function onMouseMove(event) {
6449
6927
  path.removeOnMove();
6450
6928
  }
6451
6929
  </script>
6452
- <div class="canvas"><canvas width="516" height="200" id="canvas-51"></canvas></div>
6930
+ <div class="canvas"><canvas width="516" height="200" id="canvas-54"></canvas></div>
6453
6931
  </div>
6454
6932
 
6455
6933
 
@@ -6479,7 +6957,7 @@ function onMouseMove(event) {
6479
6957
  <div class="button run">Run</div>
6480
6958
  </div>
6481
6959
 
6482
- <script type="text/paperscript" canvas="canvas-52">
6960
+ <script type="text/paperscript" canvas="canvas-55">
6483
6961
  function onMouseDown(event) {
6484
6962
  // Create a circle shaped path at the mouse position,
6485
6963
  // with a radius of 10:
@@ -6493,7 +6971,7 @@ function onMouseDown(event) {
6493
6971
  path.removeOnDown();
6494
6972
  }
6495
6973
  </script>
6496
- <div class="canvas"><canvas width="516" height="200" id="canvas-52"></canvas></div>
6974
+ <div class="canvas"><canvas width="516" height="200" id="canvas-55"></canvas></div>
6497
6975
  </div>
6498
6976
 
6499
6977
 
@@ -6523,7 +7001,7 @@ function onMouseDown(event) {
6523
7001
  <div class="button run">Run</div>
6524
7002
  </div>
6525
7003
 
6526
- <script type="text/paperscript" canvas="canvas-53">
7004
+ <script type="text/paperscript" canvas="canvas-56">
6527
7005
  function onMouseDrag(event) {
6528
7006
  // Create a circle shaped path at the mouse position,
6529
7007
  // with a radius of 10:
@@ -6537,7 +7015,7 @@ function onMouseDrag(event) {
6537
7015
  path.removeOnDrag();
6538
7016
  }
6539
7017
  </script>
6540
- <div class="canvas"><canvas width="516" height="200" id="canvas-53"></canvas></div>
7018
+ <div class="canvas"><canvas width="516" height="200" id="canvas-56"></canvas></div>
6541
7019
  </div>
6542
7020
 
6543
7021
 
@@ -6567,7 +7045,7 @@ function onMouseDrag(event) {
6567
7045
  <div class="button run">Run</div>
6568
7046
  </div>
6569
7047
 
6570
- <script type="text/paperscript" canvas="canvas-54">
7048
+ <script type="text/paperscript" canvas="canvas-57">
6571
7049
  function onMouseDown(event) {
6572
7050
  // Create a circle shaped path at the mouse position,
6573
7051
  // with a radius of 10:
@@ -6581,7 +7059,7 @@ function onMouseDown(event) {
6581
7059
  path.removeOnUp();
6582
7060
  }
6583
7061
  </script>
6584
- <div class="canvas"><canvas width="516" height="200" id="canvas-54"></canvas></div>
7062
+ <div class="canvas"><canvas width="516" height="200" id="canvas-57"></canvas></div>
6585
7063
  </div>
6586
7064
 
6587
7065
 
@@ -6654,7 +7132,7 @@ function onMouseDown(event) {
6654
7132
  <div class="button run">Run</div>
6655
7133
  </div>
6656
7134
 
6657
- <script type="text/paperscript" canvas="canvas-55">
7135
+ <script type="text/paperscript" canvas="canvas-58">
6658
7136
  var path = new Path.Circle({
6659
7137
  radius: view.bounds.height * 0.4,
6660
7138
  center: view.center
@@ -6665,7 +7143,7 @@ path.tween(
6665
7143
  3000
6666
7144
  );
6667
7145
  </script>
6668
- <div class="canvas"><canvas width="516" height="100" id="canvas-55"></canvas></div>
7146
+ <div class="canvas"><canvas width="516" height="100" id="canvas-58"></canvas></div>
6669
7147
  </div>
6670
7148
 
6671
7149
 
@@ -6677,7 +7155,7 @@ path.tween(
6677
7155
  <div class="button run">Run</div>
6678
7156
  </div>
6679
7157
 
6680
- <script type="text/paperscript" canvas="canvas-56">
7158
+ <script type="text/paperscript" canvas="canvas-59">
6681
7159
  var path = new Shape.Rectangle({
6682
7160
  fillColor: 'red',
6683
7161
  center: [50, view.center.y],
@@ -6692,7 +7170,7 @@ path.tween({
6692
7170
  duration: 2000
6693
7171
  });
6694
7172
  </script>
6695
- <div class="canvas"><canvas width="516" height="100" id="canvas-56"></canvas></div>
7173
+ <div class="canvas"><canvas width="516" height="100" id="canvas-59"></canvas></div>
6696
7174
  </div>
6697
7175
 
6698
7176
 
@@ -6758,7 +7236,7 @@ path.tween({
6758
7236
  <div class="button run">Run</div>
6759
7237
  </div>
6760
7238
 
6761
- <script type="text/paperscript" canvas="canvas-57">
7239
+ <script type="text/paperscript" canvas="canvas-60">
6762
7240
  var path = new Path.Rectangle({
6763
7241
  size: [100, 100],
6764
7242
  position: view.center,
@@ -6772,7 +7250,7 @@ path.tween({
6772
7250
  'segments[2].point.x': '-= 50'
6773
7251
  }, 3000);
6774
7252
  </script>
6775
- <div class="canvas"><canvas width="516" height="200" id="canvas-57"></canvas></div>
7253
+ <div class="canvas"><canvas width="516" height="200" id="canvas-60"></canvas></div>
6776
7254
  </div>
6777
7255
 
6778
7256
 
@@ -6831,7 +7309,7 @@ path.tween({
6831
7309
  <div class="button run">Run</div>
6832
7310
  </div>
6833
7311
 
6834
- <script type="text/paperscript" canvas="canvas-58">
7312
+ <script type="text/paperscript" canvas="canvas-61">
6835
7313
  var path = new Path.Circle({
6836
7314
  fillColor: 'blue',
6837
7315
  radius: view.bounds.height * 0.4,
@@ -6847,7 +7325,7 @@ path.tween(2000).onUpdate = function(event) {
6847
7325
  path.interpolate(pathFrom, pathTo, event.factor)
6848
7326
  };
6849
7327
  </script>
6850
- <div class="canvas"><canvas width="516" height="100" id="canvas-58"></canvas></div>
7328
+ <div class="canvas"><canvas width="516" height="100" id="canvas-61"></canvas></div>
6851
7329
  </div>
6852
7330
 
6853
7331
 
@@ -6968,7 +7446,7 @@ path.tween(2000).onUpdate = function(event) {
6968
7446
  <div class="button run">Run</div>
6969
7447
  </div>
6970
7448
 
6971
- <script type="text/paperscript" canvas="canvas-59">
7449
+ <script type="text/paperscript" canvas="canvas-62">
6972
7450
  var path = new Path.Circle({
6973
7451
  fillColor: 'blue',
6974
7452
  radius: view.bounds.height * 0.4,
@@ -6976,7 +7454,7 @@ var path = new Path.Circle({
6976
7454
  });
6977
7455
  path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
6978
7456
  </script>
6979
- <div class="canvas"><canvas width="516" height="100" id="canvas-59"></canvas></div>
7457
+ <div class="canvas"><canvas width="516" height="100" id="canvas-62"></canvas></div>
6980
7458
  </div>
6981
7459
 
6982
7460
 
@@ -6990,7 +7468,7 @@ path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
6990
7468
 
6991
7469
  <!-- =========================== copyright notice ========================== -->
6992
7470
  <p class="footer">
6993
- Paper.js v0.16.0<br>
7471
+ Paper.js v0.17.0<br>
6994
7472
  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>
6995
7473
  <div class="content-end"></div>
6996
7474