paper 0.14.0 → 0.15.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 (57) hide show
  1. package/CHANGELOG.md +252 -0
  2. package/README.md +3 -1
  3. package/dist/docs/assets/js/paper.js +6997 -1658
  4. package/dist/docs/classes/AreaText.html +8658 -0
  5. package/dist/docs/classes/ChangeFlag.html +2 -1
  6. package/dist/docs/classes/Color.html +2 -1
  7. package/dist/docs/classes/CompoundPath.html +152 -67
  8. package/dist/docs/classes/Curve.html +2 -1
  9. package/dist/docs/classes/CurveLocation.html +2 -1
  10. package/dist/docs/classes/Event.html +5 -4
  11. package/dist/docs/classes/Gradient.html +2 -1
  12. package/dist/docs/classes/GradientStop.html +2 -1
  13. package/dist/docs/classes/Group.html +117 -15
  14. package/dist/docs/classes/HitResult.html +2 -1
  15. package/dist/docs/classes/HostItem.html +80 -15
  16. package/dist/docs/classes/Item.html +137 -15
  17. package/dist/docs/classes/Key.html +2 -1
  18. package/dist/docs/classes/KeyEvent.html +5 -4
  19. package/dist/docs/classes/Layer.html +114 -15
  20. package/dist/docs/classes/Matrix.html +2 -1
  21. package/dist/docs/classes/MouseEvent.html +5 -4
  22. package/dist/docs/classes/PaperScope.html +4 -2
  23. package/dist/docs/classes/PaperScript.html +5 -2
  24. package/dist/docs/classes/Path.html +126 -67
  25. package/dist/docs/classes/PathItem.html +270 -185
  26. package/dist/docs/classes/PathText.html +8528 -0
  27. package/dist/docs/classes/Point.html +13 -2
  28. package/dist/docs/classes/PointText.html +1346 -59
  29. package/dist/docs/classes/Project.html +40 -7
  30. package/dist/docs/classes/Raster.html +80 -15
  31. package/dist/docs/classes/Rectangle.html +3 -2
  32. package/dist/docs/classes/Segment.html +2 -1
  33. package/dist/docs/classes/Shape.html +80 -15
  34. package/dist/docs/classes/Size.html +4 -2
  35. package/dist/docs/classes/Style.html +767 -14
  36. package/dist/docs/classes/SymbolDefinition.html +2 -1
  37. package/dist/docs/classes/SymbolItem.html +80 -15
  38. package/dist/docs/classes/TextItem.html +1469 -179
  39. package/dist/docs/classes/TextRange.html +186 -0
  40. package/dist/docs/classes/TextStory.html +355 -0
  41. package/dist/docs/classes/Tool.html +2 -1
  42. package/dist/docs/classes/ToolEvent.html +57 -4
  43. package/dist/docs/classes/Tween.html +17 -1
  44. package/dist/docs/classes/View.html +9 -8
  45. package/dist/docs/classes/global.html +2 -1
  46. package/dist/docs/classes/index.html +2 -2
  47. package/dist/docs/index.html +1 -1
  48. package/dist/paper-core.js +6832 -1637
  49. package/dist/paper-core.min.js +3 -3
  50. package/dist/paper-full.js +6997 -1658
  51. package/dist/paper-full.min.js +3 -3
  52. package/dist/{paper-sourced.js → paper-hosted.js} +7109 -1682
  53. package/dist/paper.d.ts +1727 -163
  54. package/examples/Scripts/AreaText.html +65 -0
  55. package/examples/Scripts/PathText.html +48 -0
  56. package/examples/Scripts/TextRanges.html +51 -0
  57. package/package.json +3 -2
@@ -19,6 +19,7 @@
19
19
 
20
20
  <p>The PathItem class is the base for any items that describe paths and offer standardised methods for drawing and path manipulation, such as <a href="../classes/Path.html"><tt>Path</tt></a> and <a href="../classes/CompoundPath.html"><tt>CompoundPath</tt></a>.</p>
21
21
 
22
+
22
23
  </div>
23
24
 
24
25
 
@@ -137,10 +138,10 @@
137
138
  </div>
138
139
  <div class="member-description hidden">
139
140
  <div class="member-text">
140
- <p>Unites the geometry of the specified path with this path&rsquo;s geometry and returns the result as a new path item.</p>
141
+ <p>Unites the geometry of the specified path with this path&rsquo;s geometry and returns the result as a new path item. With an array of paths, the result covers the areas inside any of them or this path. Each path keeps its own fill rule.</p>
141
142
  <ul class="member-list">
142
143
  <h4>Options:</h4>
143
- <li><tt>options.insert: <tt>Boolean</tt></tt> &mdash; whether the resulting item should be inserted back into the scene graph, above both paths involved in the operation &mdash;&nbsp;default: <tt>true</tt></li>
144
+ <li><tt>options.insert: <tt>Boolean</tt></tt> &mdash; whether the resulting item should be inserted back into the scene graph, above all paths involved in the operation &mdash;&nbsp;default: <tt>true</tt></li>
144
145
  </ul>
145
146
 
146
147
  <ul class="member-list">
@@ -148,8 +149,8 @@
148
149
 
149
150
  <li>
150
151
  <tt>path:</tt>
151
- <a href="../classes/PathItem.html"><tt>PathItem</tt></a>
152
- &mdash;&nbsp;the path to unite with
152
+ <a href="../classes/PathItem.html"><tt>PathItem</tt></a>⟋Array of <a href="../classes/PathItem.html"><tt>PathItem</tt></a> objects
153
+ &mdash;&nbsp;the path or paths to unite with
153
154
 
154
155
  </li>
155
156
 
@@ -193,6 +194,26 @@ result.fillColor = 'red';
193
194
  </div>
194
195
 
195
196
 
197
+ <h4>Example:<span class="description">Uniting many paths at once:</span></h4>
198
+
199
+ <div class="paperscript split">
200
+
201
+ <div class="buttons">
202
+ <div class="button run">Run</div>
203
+ </div>
204
+
205
+ <script type="text/paperscript" canvas="canvas-1">
206
+ var circles = [];
207
+ for (var i = 0; i < 6; i++) {
208
+ circles.push(new Path.Circle([30 + i * 20, 50], 20));
209
+ }
210
+ var result = circles[0].unite(circles.slice(1));
211
+ result.fillColor = 'red';
212
+ </script>
213
+ <div class="canvas"><canvas width="516" height="100" id="canvas-1"></canvas></div>
214
+ </div>
215
+
216
+
196
217
  </div>
197
218
  </div>
198
219
  </div>
@@ -204,11 +225,11 @@ result.fillColor = 'red';
204
225
  </div>
205
226
  <div class="member-description hidden">
206
227
  <div class="member-text">
207
- <p>Intersects the geometry of the specified path with this path&rsquo;s geometry and returns the result as a new path item.</p>
228
+ <p>Intersects the geometry of the specified path with this path&rsquo;s geometry and returns the result as a new path item. With an array of paths, the result covers the areas inside all of them and this path. Each path keeps its own fill rule.</p>
208
229
  <ul class="member-list">
209
230
  <h4>Options:</h4>
210
- <li><tt>options.insert: <tt>Boolean</tt></tt> &mdash; whether the resulting item should be inserted back into the scene graph, above both paths involved in the operation &mdash;&nbsp;default: <tt>true</tt></li>
211
- <li><tt>options.trace: <tt>Boolean</tt></tt> &mdash; whether the tracing method is used, treating both paths as areas when determining which parts of the paths are to be kept in the result, or whether the first path is only to be split at intersections, keeping the parts of the curves that intersect with the area of the second path. &mdash;&nbsp;default: <tt>true</tt></li>
231
+ <li><tt>options.insert: <tt>Boolean</tt></tt> &mdash; whether the resulting item should be inserted back into the scene graph, above all paths involved in the operation &mdash;&nbsp;default: <tt>true</tt></li>
232
+ <li><tt>options.trace: <tt>Boolean</tt></tt> &mdash; whether the tracing method is used, treating all paths as areas when determining which parts of the paths are to be kept in the result, or whether the first path is only to be split at intersections, keeping the parts of the curves that intersect with the areas of all other paths. &mdash;&nbsp;default: <tt>true</tt></li>
212
233
  </ul>
213
234
 
214
235
  <ul class="member-list">
@@ -216,8 +237,8 @@ result.fillColor = 'red';
216
237
 
217
238
  <li>
218
239
  <tt>path:</tt>
219
- <a href="../classes/PathItem.html"><tt>PathItem</tt></a>
220
- &mdash;&nbsp;the path to intersect with
240
+ <a href="../classes/PathItem.html"><tt>PathItem</tt></a>⟋Array of <a href="../classes/PathItem.html"><tt>PathItem</tt></a> objects
241
+ &mdash;&nbsp;the path or paths to intersect with
221
242
 
222
243
  </li>
223
244
 
@@ -252,12 +273,12 @@ result.fillColor = 'red';
252
273
  <div class="button run">Run</div>
253
274
  </div>
254
275
 
255
- <script type="text/paperscript" canvas="canvas-1">
276
+ <script type="text/paperscript" canvas="canvas-2">
256
277
  var result = new Path.RegularPolygon([50, 50], 3, 40)
257
278
  .intersect(new Path.Circle([50, 50], 25));
258
279
  result.fillColor = 'red';
259
280
  </script>
260
- <div class="canvas"><canvas width="516" height="100" id="canvas-1"></canvas></div>
281
+ <div class="canvas"><canvas width="516" height="100" id="canvas-2"></canvas></div>
261
282
  </div>
262
283
 
263
284
 
@@ -272,11 +293,11 @@ result.fillColor = 'red';
272
293
  </div>
273
294
  <div class="member-description hidden">
274
295
  <div class="member-text">
275
- <p>Subtracts the geometry of the specified path from this path&rsquo;s geometry and returns the result as a new path item.</p>
296
+ <p>Subtracts the geometry of the specified path from this path&rsquo;s geometry and returns the result as a new path item. With an array of paths, the result covers the areas inside this path and outside all of them. Each path keeps its own fill rule.</p>
276
297
  <ul class="member-list">
277
298
  <h4>Options:</h4>
278
- <li><tt>options.insert: <tt>Boolean</tt></tt> &mdash; whether the resulting item should be inserted back into the scene graph, above both paths involved in the operation &mdash;&nbsp;default: <tt>true</tt></li>
279
- <li><tt>options.trace: <tt>Boolean</tt></tt> &mdash; whether the tracing method is used, treating both paths as areas when determining which parts of the paths are to be kept in the result, or whether the first path is only to be split at intersections, removing the parts of the curves that intersect with the area of the second path. &mdash;&nbsp;default: <tt>true</tt></li>
299
+ <li><tt>options.insert: <tt>Boolean</tt></tt> &mdash; whether the resulting item should be inserted back into the scene graph, above all paths involved in the operation &mdash;&nbsp;default: <tt>true</tt></li>
300
+ <li><tt>options.trace: <tt>Boolean</tt></tt> &mdash; whether the tracing method is used, treating all paths as areas when determining which parts of the paths are to be kept in the result, or whether the first path is only to be split at intersections, removing the parts of the curves that intersect with the area of any other path. &mdash;&nbsp;default: <tt>true</tt></li>
280
301
  </ul>
281
302
 
282
303
  <ul class="member-list">
@@ -284,8 +305,8 @@ result.fillColor = 'red';
284
305
 
285
306
  <li>
286
307
  <tt>path:</tt>
287
- <a href="../classes/PathItem.html"><tt>PathItem</tt></a>
288
- &mdash;&nbsp;the path to subtract
308
+ <a href="../classes/PathItem.html"><tt>PathItem</tt></a>⟋Array of <a href="../classes/PathItem.html"><tt>PathItem</tt></a> objects
309
+ &mdash;&nbsp;the path or paths to subtract
289
310
 
290
311
  </li>
291
312
 
@@ -320,12 +341,12 @@ result.fillColor = 'red';
320
341
  <div class="button run">Run</div>
321
342
  </div>
322
343
 
323
- <script type="text/paperscript" canvas="canvas-2">
344
+ <script type="text/paperscript" canvas="canvas-3">
324
345
  var result = new Path.RegularPolygon([50, 50], 3, 40)
325
346
  .subtract(new Path.Circle([50, 50], 25));
326
347
  result.fillColor = 'red';
327
348
  </script>
328
- <div class="canvas"><canvas width="516" height="100" id="canvas-2"></canvas></div>
349
+ <div class="canvas"><canvas width="516" height="100" id="canvas-3"></canvas></div>
329
350
  </div>
330
351
 
331
352
 
@@ -340,10 +361,10 @@ result.fillColor = 'red';
340
361
  </div>
341
362
  <div class="member-description hidden">
342
363
  <div class="member-text">
343
- <p>Excludes the intersection of the geometry of the specified path with this path&rsquo;s geometry and returns the result as a new path item.</p>
364
+ <p>Excludes the intersection of the geometry of the specified path with this path&rsquo;s geometry and returns the result as a new path item. With an array of paths, the result covers the areas inside an odd number of the paths, this one included. Each path keeps its own fill rule.</p>
344
365
  <ul class="member-list">
345
366
  <h4>Options:</h4>
346
- <li><tt>options.insert: <tt>Boolean</tt></tt> &mdash; whether the resulting item should be inserted back into the scene graph, above both paths involved in the operation &mdash;&nbsp;default: <tt>true</tt></li>
367
+ <li><tt>options.insert: <tt>Boolean</tt></tt> &mdash; whether the resulting item should be inserted back into the scene graph, above all paths involved in the operation &mdash;&nbsp;default: <tt>true</tt></li>
347
368
  </ul>
348
369
 
349
370
  <ul class="member-list">
@@ -351,8 +372,8 @@ result.fillColor = 'red';
351
372
 
352
373
  <li>
353
374
  <tt>path:</tt>
354
- <a href="../classes/PathItem.html"><tt>PathItem</tt></a>
355
- &mdash;&nbsp;the path to exclude the intersection of
375
+ <a href="../classes/PathItem.html"><tt>PathItem</tt></a>⟋Array of <a href="../classes/PathItem.html"><tt>PathItem</tt></a> objects
376
+ &mdash;&nbsp;the path or paths to exclude the intersection of
356
377
 
357
378
  </li>
358
379
 
@@ -387,12 +408,12 @@ result.fillColor = 'red';
387
408
  <div class="button run">Run</div>
388
409
  </div>
389
410
 
390
- <script type="text/paperscript" canvas="canvas-3">
411
+ <script type="text/paperscript" canvas="canvas-4">
391
412
  var result = new Path.RegularPolygon([50, 50], 3, 40)
392
413
  .exclude(new Path.Circle([50, 50], 25));
393
414
  result.fillColor = 'red';
394
415
  </script>
395
- <div class="canvas"><canvas width="516" height="100" id="canvas-3"></canvas></div>
416
+ <div class="canvas"><canvas width="516" height="100" id="canvas-4"></canvas></div>
396
417
  </div>
397
418
 
398
419
 
@@ -560,7 +581,7 @@ result.fillColor = 'red';
560
581
  <div class="button run">Run</div>
561
582
  </div>
562
583
 
563
- <script type="text/paperscript" canvas="canvas-4">
584
+ <script type="text/paperscript" canvas="canvas-5">
564
585
  var path = new Path.Rectangle(new Point(30, 25), new Size(50, 50));
565
586
  path.strokeColor = 'black';
566
587
 
@@ -583,7 +604,7 @@ function onFrame(event) {
583
604
  }
584
605
  }
585
606
  </script>
586
- <div class="canvas"><canvas width="516" height="100" id="canvas-4"></canvas></div>
607
+ <div class="canvas"><canvas width="516" height="100" id="canvas-5"></canvas></div>
587
608
  </div>
588
609
 
589
610
 
@@ -724,7 +745,7 @@ function onFrame(event) {
724
745
  <div class="button run">Run</div>
725
746
  </div>
726
747
 
727
- <script type="text/paperscript" canvas="canvas-5">
748
+ <script type="text/paperscript" canvas="canvas-6">
728
749
  var star = new Path.Star({
729
750
  center: view.center,
730
751
  points: 10,
@@ -748,7 +769,7 @@ function onMouseMove(event) {
748
769
  circle.position = nearestPoint;
749
770
  }
750
771
  </script>
751
- <div class="canvas"><canvas width="516" height="200" id="canvas-5"></canvas></div>
772
+ <div class="canvas"><canvas width="516" height="200" id="canvas-6"></canvas></div>
752
773
  </div>
753
774
 
754
775
 
@@ -811,7 +832,7 @@ function onMouseMove(event) {
811
832
  <div class="button run">Run</div>
812
833
  </div>
813
834
 
814
- <script type="text/paperscript" canvas="canvas-6">
835
+ <script type="text/paperscript" canvas="canvas-7">
815
836
  // Create a circle shaped path at { x: 80, y: 50 }
816
837
  // with a radius of 35:
817
838
  var path = new Path.Circle({
@@ -829,7 +850,7 @@ copy.position.x += 150;
829
850
  // Flatten the copied path, with a maximum error of 4 points:
830
851
  copy.flatten(4);
831
852
  </script>
832
- <div class="canvas"><canvas width="516" height="100" id="canvas-6"></canvas></div>
853
+ <div class="canvas"><canvas width="516" height="100" id="canvas-7"></canvas></div>
833
854
  </div>
834
855
 
835
856
 
@@ -907,7 +928,7 @@ copy.flatten(4);
907
928
  <div class="button run">Run</div>
908
929
  </div>
909
930
 
910
- <script type="text/paperscript" canvas="canvas-7">
931
+ <script type="text/paperscript" canvas="canvas-8">
911
932
  // Create a rectangular path with its top-left point at
912
933
  // {x: 30, y: 25} and a size of {width: 50, height: 50}:
913
934
  var path = new Path.Rectangle({
@@ -926,7 +947,7 @@ copy.position.x += 100;
926
947
  // Smooth the segments of the copy:
927
948
  copy.smooth({ type: 'continuous' });
928
949
  </script>
929
- <div class="canvas"><canvas width="516" height="100" id="canvas-7"></canvas></div>
950
+ <div class="canvas"><canvas width="516" height="100" id="canvas-8"></canvas></div>
930
951
  </div>
931
952
 
932
953
 
@@ -938,7 +959,7 @@ copy.smooth({ type: 'continuous' });
938
959
  <div class="button run">Run</div>
939
960
  </div>
940
961
 
941
- <script type="text/paperscript" canvas="canvas-8">
962
+ <script type="text/paperscript" canvas="canvas-9">
942
963
  var path = new Path();
943
964
  path.strokeColor = 'black';
944
965
 
@@ -963,7 +984,7 @@ copy.fullySelected = true;
963
984
  // Smooth the path using centripetal Catmull-Rom splines:
964
985
  copy.smooth({ type: 'catmull-rom', factor: 0.5 });
965
986
  </script>
966
- <div class="canvas"><canvas width="516" height="220" id="canvas-8"></canvas></div>
987
+ <div class="canvas"><canvas width="516" height="220" id="canvas-9"></canvas></div>
967
988
  </div>
968
989
 
969
990
 
@@ -975,7 +996,7 @@ copy.smooth({ type: 'catmull-rom', factor: 0.5 });
975
996
  <div class="button run">Run</div>
976
997
  </div>
977
998
 
978
- <script type="text/paperscript" canvas="canvas-9">
999
+ <script type="text/paperscript" canvas="canvas-10">
979
1000
  // Create 5 rectangles, next to each other:
980
1001
  var paths = [];
981
1002
  for (var i = 0; i < 5; i++) {
@@ -1005,7 +1026,7 @@ paths[3].smooth({ type: 'continuous', from: 0, to: 2 });
1005
1026
  // Smooth a range, using negative indices:
1006
1027
  paths[4].smooth({ type: 'continuous', from: -1, to: 1 });
1007
1028
  </script>
1008
- <div class="canvas"><canvas width="516" height="110" id="canvas-9"></canvas></div>
1029
+ <div class="canvas"><canvas width="516" height="110" id="canvas-10"></canvas></div>
1009
1030
  </div>
1010
1031
 
1011
1032
 
@@ -1058,7 +1079,7 @@ paths[4].smooth({ type: 'continuous', from: -1, to: 1 });
1058
1079
  <div class="button run">Run</div>
1059
1080
  </div>
1060
1081
 
1061
- <script type="text/paperscript" canvas="canvas-10">
1082
+ <script type="text/paperscript" canvas="canvas-11">
1062
1083
  var path;
1063
1084
  function onMouseDown(event) {
1064
1085
  // If we already made a path before, deselect it:
@@ -1088,7 +1109,7 @@ function onMouseUp(event) {
1088
1109
  path.selected = true;
1089
1110
  }
1090
1111
  </script>
1091
- <div class="canvas"><canvas width="516" height="300" id="canvas-10"></canvas></div>
1112
+ <div class="canvas"><canvas width="516" height="300" id="canvas-11"></canvas></div>
1092
1113
  </div>
1093
1114
 
1094
1115
 
@@ -1287,7 +1308,7 @@ function onMouseUp(event) {
1287
1308
  <div class="button run">Run</div>
1288
1309
  </div>
1289
1310
 
1290
- <script type="text/paperscript" canvas="canvas-11">
1311
+ <script type="text/paperscript" canvas="canvas-12">
1291
1312
  var path = new Path();
1292
1313
  path.strokeColor = 'black';
1293
1314
 
@@ -1307,7 +1328,7 @@ path.arcTo(throughPoint, toPoint);
1307
1328
  var circle = new Path.Circle(throughPoint, 3);
1308
1329
  circle.fillColor = 'red';
1309
1330
  </script>
1310
- <div class="canvas"><canvas width="516" height="100" id="canvas-11"></canvas></div>
1331
+ <div class="canvas"><canvas width="516" height="100" id="canvas-12"></canvas></div>
1311
1332
  </div>
1312
1333
 
1313
1334
 
@@ -1319,7 +1340,7 @@ circle.fillColor = 'red';
1319
1340
  <div class="button run">Run</div>
1320
1341
  </div>
1321
1342
 
1322
- <script type="text/paperscript" canvas="canvas-12">
1343
+ <script type="text/paperscript" canvas="canvas-13">
1323
1344
  var myPath;
1324
1345
  function onMouseDrag(event) {
1325
1346
  // If we created a path before, remove it:
@@ -1347,7 +1368,7 @@ function onMouseUp(event) {
1347
1368
  myPath.fillColor = 'black';
1348
1369
  }
1349
1370
  </script>
1350
- <div class="canvas"><canvas width="516" height="300" id="canvas-12"></canvas></div>
1371
+ <div class="canvas"><canvas width="516" height="300" id="canvas-13"></canvas></div>
1351
1372
  </div>
1352
1373
 
1353
1374
 
@@ -1396,7 +1417,7 @@ function onMouseUp(event) {
1396
1417
  <div class="button run">Run</div>
1397
1418
  </div>
1398
1419
 
1399
- <script type="text/paperscript" canvas="canvas-13">
1420
+ <script type="text/paperscript" canvas="canvas-14">
1400
1421
  var path = new Path();
1401
1422
  path.strokeColor = 'black';
1402
1423
 
@@ -1411,7 +1432,7 @@ path2.add(new Point(180, 25));
1411
1432
  // we pass `false` as the second argument to arcTo:
1412
1433
  path2.arcTo(new Point(280, 25), false);
1413
1434
  </script>
1414
- <div class="canvas"><canvas width="516" height="100" id="canvas-13"></canvas></div>
1435
+ <div class="canvas"><canvas width="516" height="100" id="canvas-14"></canvas></div>
1415
1436
  </div>
1416
1437
 
1417
1438
 
@@ -1423,7 +1444,7 @@ path2.arcTo(new Point(280, 25), false);
1423
1444
  <div class="button run">Run</div>
1424
1445
  </div>
1425
1446
 
1426
- <script type="text/paperscript" canvas="canvas-14">
1447
+ <script type="text/paperscript" canvas="canvas-15">
1427
1448
  var myPath;
1428
1449
 
1429
1450
  // The mouse has to move at least 20 points before
@@ -1444,7 +1465,7 @@ function onMouseDrag(event) {
1444
1465
  myPath.arcTo(event.point);
1445
1466
  }
1446
1467
  </script>
1447
- <div class="canvas"><canvas width="516" height="300" id="canvas-14"></canvas></div>
1468
+ <div class="canvas"><canvas width="516" height="300" id="canvas-15"></canvas></div>
1448
1469
  </div>
1449
1470
 
1450
1471
 
@@ -1500,7 +1521,7 @@ function onMouseDrag(event) {
1500
1521
  <div class="button run">Run</div>
1501
1522
  </div>
1502
1523
 
1503
- <script type="text/paperscript" canvas="canvas-15">
1524
+ <script type="text/paperscript" canvas="canvas-16">
1504
1525
  var myPath;
1505
1526
  function onMouseMove(event) {
1506
1527
  // If we created a path before, remove it:
@@ -1521,7 +1542,7 @@ function onMouseMove(event) {
1521
1542
  myPath.selected = true;
1522
1543
  }
1523
1544
  </script>
1524
- <div class="canvas"><canvas width="516" height="300" id="canvas-15"></canvas></div>
1545
+ <div class="canvas"><canvas width="516" height="300" id="canvas-16"></canvas></div>
1525
1546
  </div>
1526
1547
 
1527
1548
 
@@ -1706,7 +1727,7 @@ function onMouseMove(event) {
1706
1727
  <div class="button run">Run</div>
1707
1728
  </div>
1708
1729
 
1709
- <script type="text/paperscript" canvas="canvas-16">
1730
+ <script type="text/paperscript" canvas="canvas-17">
1710
1731
  var path = new Path();
1711
1732
  path.strokeColor = 'black';
1712
1733
 
@@ -1720,7 +1741,7 @@ path.lineBy(50, 0);
1720
1741
  // 0 in x direction and 50 in y direction, becomes {x: 75, y: 75}
1721
1742
  path.lineBy(0, 50);
1722
1743
  </script>
1723
- <div class="canvas"><canvas width="516" height="100" id="canvas-16"></canvas></div>
1744
+ <div class="canvas"><canvas width="516" height="100" id="canvas-17"></canvas></div>
1724
1745
  </div>
1725
1746
 
1726
1747
 
@@ -1732,7 +1753,7 @@ path.lineBy(0, 50);
1732
1753
  <div class="button run">Run</div>
1733
1754
  </div>
1734
1755
 
1735
- <script type="text/paperscript" canvas="canvas-17">
1756
+ <script type="text/paperscript" canvas="canvas-18">
1736
1757
  var path = new Path();
1737
1758
  path.strokeColor = 'black';
1738
1759
 
@@ -1758,7 +1779,7 @@ path.smooth();
1758
1779
  // the construction of the path:
1759
1780
  // path.selected = true;
1760
1781
  </script>
1761
- <div class="canvas"><canvas width="516" height="300" id="canvas-17"></canvas></div>
1782
+ <div class="canvas"><canvas width="516" height="300" id="canvas-18"></canvas></div>
1762
1783
  </div>
1763
1784
 
1764
1785
 
@@ -2117,7 +2138,7 @@ Array of <tt>Number[]</tt> objects[]
2117
2138
  <div class="member-description hidden">
2118
2139
 
2119
2140
  <div class="member-text">
2120
- <p>The key of the host&rsquo;s node that the item represents, in a project backed by a host document, see <a href="../classes/Project.html#source"><tt>project.source</tt></a>. It can only be set once, on an item created by a script, to register the key that the host gave its new node.</p>
2141
+ <p>The key of the host&rsquo;s node that the item represents, in a project backed by a host document, see <a href="../classes/Project.html#host"><tt>project.host</tt></a>. It can only be set once, on an item created by a script, to register the key that the host gave its new node.</p>
2121
2142
 
2122
2143
 
2123
2144
 
@@ -2222,7 +2243,7 @@ Array of <tt>Number[]</tt> objects[]
2222
2243
  <div class="button run">Run</div>
2223
2244
  </div>
2224
2245
 
2225
- <script type="text/paperscript" canvas="canvas-18">
2246
+ <script type="text/paperscript" canvas="canvas-19">
2226
2247
  var path = new Path.Circle({
2227
2248
  center: [80, 50],
2228
2249
  radius: 35
@@ -2237,7 +2258,7 @@ group.addChild(path);
2237
2258
  // The path can be accessed by name:
2238
2259
  group.children['example'].fillColor = 'red';
2239
2260
  </script>
2240
- <div class="canvas"><canvas width="516" height="100" id="canvas-18"></canvas></div>
2261
+ <div class="canvas"><canvas width="516" height="100" id="canvas-19"></canvas></div>
2241
2262
  </div>
2242
2263
 
2243
2264
 
@@ -2275,7 +2296,7 @@ group.children['example'].fillColor = 'red';
2275
2296
  <div class="button run">Run</div>
2276
2297
  </div>
2277
2298
 
2278
- <script type="text/paperscript" canvas="canvas-19">
2299
+ <script type="text/paperscript" canvas="canvas-20">
2279
2300
  var circle = new Path.Circle({
2280
2301
  center: [80, 50],
2281
2302
  radius: 30
@@ -2286,7 +2307,7 @@ circle.style = {
2286
2307
  strokeWidth: 5
2287
2308
  };
2288
2309
  </script>
2289
- <div class="canvas"><canvas width="516" height="100" id="canvas-19"></canvas></div>
2310
+ <div class="canvas"><canvas width="516" height="100" id="canvas-20"></canvas></div>
2290
2311
  </div>
2291
2312
 
2292
2313
 
@@ -2298,7 +2319,7 @@ circle.style = {
2298
2319
  <div class="button run">Run</div>
2299
2320
  </div>
2300
2321
 
2301
- <script type="text/paperscript" canvas="canvas-20">
2322
+ <script type="text/paperscript" canvas="canvas-21">
2302
2323
  var path = new Path.Circle({
2303
2324
  center: [50, 50],
2304
2325
  radius: 30,
@@ -2313,7 +2334,7 @@ var path2 = new Path.Circle({
2313
2334
  // Copy the path style of path:
2314
2335
  path2.style = path.style;
2315
2336
  </script>
2316
- <div class="canvas"><canvas width="516" height="100" id="canvas-20"></canvas></div>
2337
+ <div class="canvas"><canvas width="516" height="100" id="canvas-21"></canvas></div>
2317
2338
  </div>
2318
2339
 
2319
2340
 
@@ -2325,7 +2346,7 @@ path2.style = path.style;
2325
2346
  <div class="button run">Run</div>
2326
2347
  </div>
2327
2348
 
2328
- <script type="text/paperscript" canvas="canvas-21">
2349
+ <script type="text/paperscript" canvas="canvas-22">
2329
2350
  var myStyle = {
2330
2351
  fillColor: 'red',
2331
2352
  strokeColor: 'blue',
@@ -2344,7 +2365,7 @@ var path2 = new Path.Circle({
2344
2365
  });
2345
2366
  path2.style = myStyle;
2346
2367
  </script>
2347
- <div class="canvas"><canvas width="516" height="100" id="canvas-21"></canvas></div>
2368
+ <div class="canvas"><canvas width="516" height="100" id="canvas-22"></canvas></div>
2348
2369
  </div>
2349
2370
 
2350
2371
 
@@ -2386,7 +2407,7 @@ path2.style = myStyle;
2386
2407
  <div class="button run">Run</div>
2387
2408
  </div>
2388
2409
 
2389
- <script type="text/paperscript" canvas="canvas-22">
2410
+ <script type="text/paperscript" canvas="canvas-23">
2390
2411
  var unlockedItem = new Path.Circle({
2391
2412
  center: view.center - [35, 0],
2392
2413
  radius: 30,
@@ -2413,7 +2434,7 @@ new PointText({
2413
2434
  justification: 'center'
2414
2435
  });
2415
2436
  </script>
2416
- <div class="canvas"><canvas width="516" height="100" id="canvas-22"></canvas></div>
2437
+ <div class="canvas"><canvas width="516" height="100" id="canvas-23"></canvas></div>
2417
2438
  </div>
2418
2439
 
2419
2440
 
@@ -2455,7 +2476,7 @@ new PointText({
2455
2476
  <div class="button run">Run</div>
2456
2477
  </div>
2457
2478
 
2458
- <script type="text/paperscript" canvas="canvas-23">
2479
+ <script type="text/paperscript" canvas="canvas-24">
2459
2480
  var path = new Path.Circle({
2460
2481
  center: [50, 50],
2461
2482
  radius: 20,
@@ -2465,7 +2486,7 @@ var path = new Path.Circle({
2465
2486
  // Hide the path:
2466
2487
  path.visible = false;
2467
2488
  </script>
2468
- <div class="canvas"><canvas width="516" height="100" id="canvas-23"></canvas></div>
2489
+ <div class="canvas"><canvas width="516" height="100" id="canvas-24"></canvas></div>
2469
2490
  </div>
2470
2491
 
2471
2492
 
@@ -2482,7 +2503,7 @@ path.visible = false;
2482
2503
  <div class="member-description hidden">
2483
2504
 
2484
2505
  <div class="member-text">
2485
- <p>The blend mode with which the item is composited onto the canvas. Both the standard canvas compositing modes, as well as the new CSS blend modes are supported. If blend-modes cannot be rendered natively, they are emulated. Be aware that emulation can have an impact on performance.</p>
2506
+ <p>The blend mode with which the item is composited onto the canvas. Both the standard canvas compositing modes, as well as the new CSS blend modes are supported. Where the canvas doesn&rsquo;t support a CSS blend mode natively, it draws as <code>&#39;normal&#39;</code>. Paper.js&rsquo;s own modes <code>&#39;add&#39;</code>, <code>&#39;subtract&#39;</code>, <code>&#39;average&#39;</code>, <code>&#39;pin-light&#39;</code> and <code>&#39;negation&#39;</code> are emulated, which can have an impact on performance.</p>
2486
2507
 
2487
2508
 
2488
2509
  <ul class="member-list">
@@ -2513,7 +2534,7 @@ path.visible = false;
2513
2534
  <div class="button run">Run</div>
2514
2535
  </div>
2515
2536
 
2516
- <script type="text/paperscript" canvas="canvas-24">
2537
+ <script type="text/paperscript" canvas="canvas-25">
2517
2538
  // Create a white rectangle in the background
2518
2539
  // with the same dimensions as the view:
2519
2540
  var background = new Path.Rectangle(view.bounds);
@@ -2534,7 +2555,7 @@ var circle2 = new Path.Circle({
2534
2555
  // Set the blend mode of circle2:
2535
2556
  circle2.blendMode = 'multiply';
2536
2557
  </script>
2537
- <div class="canvas"><canvas width="516" height="100" id="canvas-24"></canvas></div>
2558
+ <div class="canvas"><canvas width="516" height="100" id="canvas-25"></canvas></div>
2538
2559
  </div>
2539
2560
 
2540
2561
 
@@ -2576,7 +2597,7 @@ circle2.blendMode = 'multiply';
2576
2597
  <div class="button run">Run</div>
2577
2598
  </div>
2578
2599
 
2579
- <script type="text/paperscript" canvas="canvas-25">
2600
+ <script type="text/paperscript" canvas="canvas-26">
2580
2601
  var circle = new Path.Circle({
2581
2602
  center: [80, 50],
2582
2603
  radius: 35,
@@ -2594,7 +2615,7 @@ var circle2 = new Path.Circle({
2594
2615
  // Make circle2 50% transparent:
2595
2616
  circle2.opacity = 0.5;
2596
2617
  </script>
2597
- <div class="canvas"><canvas width="516" height="100" id="canvas-25"></canvas></div>
2618
+ <div class="canvas"><canvas width="516" height="100" id="canvas-26"></canvas></div>
2598
2619
  </div>
2599
2620
 
2600
2621
 
@@ -2635,6 +2656,42 @@ circle2.opacity = 0.5;
2635
2656
  </div>
2636
2657
 
2637
2658
 
2659
+ <div id="textwrap" class="member">
2660
+ <div class="member-link">
2661
+ <a name="textwrap" href="#textwrap"><tt><b>textWrap</b></tt></a>
2662
+ </div>
2663
+ <div class="member-description hidden">
2664
+
2665
+ <div class="member-text">
2666
+ <p>Specifies whether, and how, the item pushes aside the text of the <a href="../classes/AreaText.html"><tt>AreaText</tt></a> items below it in its layer: <code>null</code>, or an object with <code>offset</code>, the space kept between them, and <code>invert</code>, to let the text flow inside it instead. <code>true</code> sets the defaults.</p>
2667
+
2668
+
2669
+
2670
+ <ul class="member-list">
2671
+ <h4>Default:</h4>
2672
+ <li><tt>null</tt></li>
2673
+ </ul>
2674
+
2675
+ <ul class="member-list">
2676
+ <h4>Type:</h4>
2677
+ <li>
2678
+ <tt>Object</tt>
2679
+ </li>
2680
+ </ul>
2681
+
2682
+
2683
+ <h4>Example:</h4>
2684
+
2685
+
2686
+ <pre><code>var circle = new Path.Circle({ center: [100, 100], radius: 40 });
2687
+ circle.textWrap = { offset: 10 };</code></pre>
2688
+
2689
+ </div>
2690
+
2691
+ </div>
2692
+ </div>
2693
+
2694
+
2638
2695
  <div id="selected" class="member">
2639
2696
  <div class="member-link">
2640
2697
  <a name="selected" href="#selected"><tt><b>selected</b></tt></a>
@@ -2681,17 +2738,43 @@ circle2.opacity = 0.5;
2681
2738
  <div class="button run">Run</div>
2682
2739
  </div>
2683
2740
 
2684
- <script type="text/paperscript" canvas="canvas-26">
2741
+ <script type="text/paperscript" canvas="canvas-27">
2685
2742
  var path = new Path.Circle({
2686
2743
  center: [80, 50],
2687
2744
  radius: 35
2688
2745
  });
2689
2746
  path.selected = true; // Select the path
2690
2747
  </script>
2691
- <div class="canvas"><canvas width="516" height="100" id="canvas-26"></canvas></div>
2748
+ <div class="canvas"><canvas width="516" height="100" id="canvas-27"></canvas></div>
2692
2749
  </div>
2693
2750
 
2694
2751
 
2752
+ </div>
2753
+
2754
+ </div>
2755
+ </div>
2756
+
2757
+
2758
+ <div id="fullyselected" class="member">
2759
+ <div class="member-link">
2760
+ <a name="fullyselected" href="#fullyselected"><tt><b>fullySelected</b></tt></a>
2761
+ </div>
2762
+ <div class="member-description hidden">
2763
+
2764
+ <div class="member-text">
2765
+ <p>Specifies whether the item and all its descendants are selected. Setting it selects or deselects them all.</p>
2766
+
2767
+
2768
+
2769
+ <ul class="member-list">
2770
+ <h4>Type:</h4>
2771
+ <li>
2772
+ <tt>Boolean</tt>
2773
+ </li>
2774
+ </ul>
2775
+
2776
+
2777
+
2695
2778
  </div>
2696
2779
 
2697
2780
  </div>
@@ -2819,7 +2902,7 @@ console.log(path.data.pets.length); // 1</code></pre>
2819
2902
  <div class="button run">Run</div>
2820
2903
  </div>
2821
2904
 
2822
- <script type="text/paperscript" canvas="canvas-27">
2905
+ <script type="text/paperscript" canvas="canvas-28">
2823
2906
  // Create a circle at position { x: 10, y: 10 }
2824
2907
  var circle = new Path.Circle({
2825
2908
  center: new Point(10, 10),
@@ -2833,7 +2916,7 @@ circle.position = new Point(20, 20);
2833
2916
  // Move the circle 100 points to the right and 50 points down
2834
2917
  circle.position += new Point(100, 50);
2835
2918
  </script>
2836
- <div class="canvas"><canvas width="516" height="100" id="canvas-27"></canvas></div>
2919
+ <div class="canvas"><canvas width="516" height="100" id="canvas-28"></canvas></div>
2837
2920
  </div>
2838
2921
 
2839
2922
 
@@ -2845,7 +2928,7 @@ circle.position += new Point(100, 50);
2845
2928
  <div class="button run">Run</div>
2846
2929
  </div>
2847
2930
 
2848
- <script type="text/paperscript" canvas="canvas-28">
2931
+ <script type="text/paperscript" canvas="canvas-29">
2849
2932
  // Create a circle at position { x: 20, y: 20 }
2850
2933
  var circle = new Path.Circle({
2851
2934
  center: new Point(20, 20),
@@ -2856,7 +2939,7 @@ var circle = new Path.Circle({
2856
2939
  // Move the circle 100 points to the right
2857
2940
  circle.position.x += 100;
2858
2941
  </script>
2859
- <div class="canvas"><canvas width="516" height="100" id="canvas-28"></canvas></div>
2942
+ <div class="canvas"><canvas width="516" height="100" id="canvas-29"></canvas></div>
2860
2943
  </div>
2861
2944
 
2862
2945
 
@@ -2931,6 +3014,7 @@ circle.position.x += 100;
2931
3014
 
2932
3015
  <div class="member-text">
2933
3016
  <p>The bounding rectangle of the item including stroke width.</p>
3017
+ <p>Setting it fits the item&rsquo;s <a href="../classes/Item.html#bounds"><tt>bounds</tt></a> into the given rectangle minus the extent of the stroke on each side, also where this extent changes with the item&rsquo;s proportions, as with miters. A rectangle smaller than the stroke itself shrinks the bounds to its center.</p>
2934
3018
 
2935
3019
 
2936
3020
 
@@ -3381,7 +3465,7 @@ console.log(group.children[0] == path); // true</code></pre>
3381
3465
  <div class="button run">Run</div>
3382
3466
  </div>
3383
3467
 
3384
- <script type="text/paperscript" canvas="canvas-29">
3468
+ <script type="text/paperscript" canvas="canvas-30">
3385
3469
  var path = new Path.Circle({
3386
3470
  center: [80, 50],
3387
3471
  radius: 35
@@ -3394,7 +3478,7 @@ group.addChild(path);
3394
3478
  // Access the path through the group's children array:
3395
3479
  group.children[0].fillColor = 'red';
3396
3480
  </script>
3397
- <div class="canvas"><canvas width="516" height="100" id="canvas-29"></canvas></div>
3481
+ <div class="canvas"><canvas width="516" height="100" id="canvas-30"></canvas></div>
3398
3482
  </div>
3399
3483
 
3400
3484
 
@@ -3406,7 +3490,7 @@ group.children[0].fillColor = 'red';
3406
3490
  <div class="button run">Run</div>
3407
3491
  </div>
3408
3492
 
3409
- <script type="text/paperscript" canvas="canvas-30">
3493
+ <script type="text/paperscript" canvas="canvas-31">
3410
3494
  var path = new Path.Circle({
3411
3495
  center: [80, 50],
3412
3496
  radius: 35
@@ -3421,7 +3505,7 @@ group.addChild(path);
3421
3505
  // The path can be accessed by name:
3422
3506
  group.children['example'].fillColor = 'orange';
3423
3507
  </script>
3424
- <div class="canvas"><canvas width="516" height="100" id="canvas-30"></canvas></div>
3508
+ <div class="canvas"><canvas width="516" height="100" id="canvas-31"></canvas></div>
3425
3509
  </div>
3426
3510
 
3427
3511
 
@@ -3433,7 +3517,7 @@ group.children['example'].fillColor = 'orange';
3433
3517
  <div class="button run">Run</div>
3434
3518
  </div>
3435
3519
 
3436
- <script type="text/paperscript" canvas="canvas-31">
3520
+ <script type="text/paperscript" canvas="canvas-32">
3437
3521
  var path = new Path.Circle({
3438
3522
  center: [80, 50],
3439
3523
  radius: 35
@@ -3445,7 +3529,7 @@ group.children = [path];
3445
3529
  // The path is the first child of the group:
3446
3530
  group.firstChild.fillColor = 'green';
3447
3531
  </script>
3448
- <div class="canvas"><canvas width="516" height="100" id="canvas-31"></canvas></div>
3532
+ <div class="canvas"><canvas width="516" height="100" id="canvas-32"></canvas></div>
3449
3533
  </div>
3450
3534
 
3451
3535
 
@@ -3622,7 +3706,7 @@ group.firstChild.fillColor = 'green';
3622
3706
  <div class="button run">Run</div>
3623
3707
  </div>
3624
3708
 
3625
- <script type="text/paperscript" canvas="canvas-32">
3709
+ <script type="text/paperscript" canvas="canvas-33">
3626
3710
  // Create a circle shaped path at { x: 80, y: 50 }
3627
3711
  // with a radius of 35:
3628
3712
  var circle = new Path.Circle({
@@ -3633,7 +3717,7 @@ var circle = new Path.Circle({
3633
3717
  // Set its stroke color to RGB red:
3634
3718
  circle.strokeColor = new Color(1, 0, 0);
3635
3719
  </script>
3636
- <div class="canvas"><canvas width="516" height="100" id="canvas-32"></canvas></div>
3720
+ <div class="canvas"><canvas width="516" height="100" id="canvas-33"></canvas></div>
3637
3721
  </div>
3638
3722
 
3639
3723
 
@@ -3670,7 +3754,7 @@ circle.strokeColor = new Color(1, 0, 0);
3670
3754
  <div class="button run">Run</div>
3671
3755
  </div>
3672
3756
 
3673
- <script type="text/paperscript" canvas="canvas-33">
3757
+ <script type="text/paperscript" canvas="canvas-34">
3674
3758
  // Create a circle shaped path at { x: 80, y: 50 }
3675
3759
  // with a radius of 35:
3676
3760
  var circle = new Path.Circle({
@@ -3682,7 +3766,7 @@ var circle = new Path.Circle({
3682
3766
  // Set its stroke width to 10:
3683
3767
  circle.strokeWidth = 10;
3684
3768
  </script>
3685
- <div class="canvas"><canvas width="516" height="100" id="canvas-33"></canvas></div>
3769
+ <div class="canvas"><canvas width="516" height="100" id="canvas-34"></canvas></div>
3686
3770
  </div>
3687
3771
 
3688
3772
 
@@ -3729,7 +3813,7 @@ circle.strokeWidth = 10;
3729
3813
  <div class="button run">Run</div>
3730
3814
  </div>
3731
3815
 
3732
- <script type="text/paperscript" canvas="canvas-34">
3816
+ <script type="text/paperscript" canvas="canvas-35">
3733
3817
  var line = new Path({
3734
3818
  segments: [[80, 50], [420, 50]],
3735
3819
  strokeColor: 'black',
@@ -3750,7 +3834,7 @@ var line2 = line.clone();
3750
3834
  line2.position.y += 100;
3751
3835
  line2.strokeCap = 'butt';
3752
3836
  </script>
3753
- <div class="canvas"><canvas width="516" height="200" id="canvas-34"></canvas></div>
3837
+ <div class="canvas"><canvas width="516" height="200" id="canvas-35"></canvas></div>
3754
3838
  </div>
3755
3839
 
3756
3840
 
@@ -3797,7 +3881,7 @@ line2.strokeCap = 'butt';
3797
3881
  <div class="button run">Run</div>
3798
3882
  </div>
3799
3883
 
3800
- <script type="text/paperscript" canvas="canvas-35">
3884
+ <script type="text/paperscript" canvas="canvas-36">
3801
3885
  var path = new Path({
3802
3886
  segments: [[80, 100], [120, 40], [160, 100]],
3803
3887
  strokeColor: 'black',
@@ -3814,7 +3898,7 @@ var path3 = path2.clone();
3814
3898
  path3.position.x += path3.bounds.width * 1.5;
3815
3899
  path3.strokeJoin = 'bevel';
3816
3900
  </script>
3817
- <div class="canvas"><canvas width="516" height="120" id="canvas-35"></canvas></div>
3901
+ <div class="canvas"><canvas width="516" height="120" id="canvas-36"></canvas></div>
3818
3902
  </div>
3819
3903
 
3820
3904
 
@@ -3918,7 +4002,7 @@ path3.strokeJoin = 'bevel';
3918
4002
  <div class="button run">Run</div>
3919
4003
  </div>
3920
4004
 
3921
- <script type="text/paperscript" canvas="canvas-36">
4005
+ <script type="text/paperscript" canvas="canvas-37">
3922
4006
  var path = new Path.Circle({
3923
4007
  center: [80, 50],
3924
4008
  radius: 40,
@@ -3929,7 +4013,7 @@ var path = new Path.Circle({
3929
4013
  // Set the dashed stroke to [10pt dash, 4pt gap]:
3930
4014
  path.dashArray = [10, 4];
3931
4015
  </script>
3932
- <div class="canvas"><canvas width="516" height="100" id="canvas-36"></canvas></div>
4016
+ <div class="canvas"><canvas width="516" height="100" id="canvas-37"></canvas></div>
3933
4017
  </div>
3934
4018
 
3935
4019
 
@@ -3999,7 +4083,7 @@ path.dashArray = [10, 4];
3999
4083
  <div class="button run">Run</div>
4000
4084
  </div>
4001
4085
 
4002
- <script type="text/paperscript" canvas="canvas-37">
4086
+ <script type="text/paperscript" canvas="canvas-38">
4003
4087
  // Create a circle shaped path at { x: 80, y: 50 }
4004
4088
  // with a radius of 35:
4005
4089
  var circle = new Path.Circle({
@@ -4010,7 +4094,7 @@ var circle = new Path.Circle({
4010
4094
  // Set the fill color of the circle to RGB red:
4011
4095
  circle.fillColor = new Color(1, 0, 0);
4012
4096
  </script>
4013
- <div class="canvas"><canvas width="516" height="100" id="canvas-37"></canvas></div>
4097
+ <div class="canvas"><canvas width="516" height="100" id="canvas-38"></canvas></div>
4014
4098
  </div>
4015
4099
 
4016
4100
 
@@ -4085,7 +4169,7 @@ circle.fillColor = new Color(1, 0, 0);
4085
4169
  <div class="button run">Run</div>
4086
4170
  </div>
4087
4171
 
4088
- <script type="text/paperscript" canvas="canvas-38">
4172
+ <script type="text/paperscript" canvas="canvas-39">
4089
4173
  var circle = new Path.Circle({
4090
4174
  center: [80, 50],
4091
4175
  radius: 35,
@@ -4098,7 +4182,7 @@ var circle = new Path.Circle({
4098
4182
  shadowOffset: new Point(5, 5)
4099
4183
  });
4100
4184
  </script>
4101
- <div class="canvas"><canvas width="516" height="100" id="canvas-38"></canvas></div>
4185
+ <div class="canvas"><canvas width="516" height="100" id="canvas-39"></canvas></div>
4102
4186
  </div>
4103
4187
 
4104
4188
 
@@ -4239,7 +4323,7 @@ var circle = new Path.Circle({
4239
4323
  <div class="button run">Run</div>
4240
4324
  </div>
4241
4325
 
4242
- <script type="text/paperscript" canvas="canvas-39">
4326
+ <script type="text/paperscript" canvas="canvas-40">
4243
4327
  // Create a rectangle shaped path with its top left point at:
4244
4328
  // {x: 50, y: 25} and a size of {width: 50, height: 50}
4245
4329
  var path = new Path.Rectangle(new Point(50, 25), new Size(50, 50));
@@ -4250,7 +4334,7 @@ path.onFrame = function(event) {
4250
4334
  this.rotate(3);
4251
4335
  }
4252
4336
  </script>
4253
- <div class="canvas"><canvas width="516" height="100" id="canvas-39"></canvas></div>
4337
+ <div class="canvas"><canvas width="516" height="100" id="canvas-40"></canvas></div>
4254
4338
  </div>
4255
4339
 
4256
4340
 
@@ -4294,7 +4378,7 @@ path.onFrame = function(event) {
4294
4378
  <div class="button run">Run</div>
4295
4379
  </div>
4296
4380
 
4297
- <script type="text/paperscript" canvas="canvas-40">
4381
+ <script type="text/paperscript" canvas="canvas-41">
4298
4382
  // Create a circle shaped path at the center of the view:
4299
4383
  var path = new Path.Circle({
4300
4384
  center: view.center,
@@ -4308,7 +4392,7 @@ path.onMouseDown = function(event) {
4308
4392
  this.fillColor = 'red';
4309
4393
  }
4310
4394
  </script>
4311
- <div class="canvas"><canvas width="516" height="100" id="canvas-40"></canvas></div>
4395
+ <div class="canvas"><canvas width="516" height="100" id="canvas-41"></canvas></div>
4312
4396
  </div>
4313
4397
 
4314
4398
 
@@ -4320,7 +4404,7 @@ path.onMouseDown = function(event) {
4320
4404
  <div class="button run">Run</div>
4321
4405
  </div>
4322
4406
 
4323
- <script type="text/paperscript" canvas="canvas-41">
4407
+ <script type="text/paperscript" canvas="canvas-42">
4324
4408
  // Loop 30 times:
4325
4409
  for (var i = 0; i < 30; i++) {
4326
4410
  // Create a circle shaped path at a random position
@@ -4338,7 +4422,7 @@ for (var i = 0; i < 30; i++) {
4338
4422
  }
4339
4423
  }
4340
4424
  </script>
4341
- <div class="canvas"><canvas width="516" height="100" id="canvas-41"></canvas></div>
4425
+ <div class="canvas"><canvas width="516" height="100" id="canvas-42"></canvas></div>
4342
4426
  </div>
4343
4427
 
4344
4428
 
@@ -4382,7 +4466,7 @@ for (var i = 0; i < 30; i++) {
4382
4466
  <div class="button run">Run</div>
4383
4467
  </div>
4384
4468
 
4385
- <script type="text/paperscript" canvas="canvas-42">
4469
+ <script type="text/paperscript" canvas="canvas-43">
4386
4470
  // Create a circle shaped path at the center of the view:
4387
4471
  var path = new Path.Circle({
4388
4472
  center: view.center,
@@ -4395,7 +4479,7 @@ path.onMouseDrag = function(event) {
4395
4479
  path.position += event.delta;
4396
4480
  }
4397
4481
  </script>
4398
- <div class="canvas"><canvas width="516" height="240" id="canvas-42"></canvas></div>
4482
+ <div class="canvas"><canvas width="516" height="240" id="canvas-43"></canvas></div>
4399
4483
  </div>
4400
4484
 
4401
4485
 
@@ -4439,7 +4523,7 @@ path.onMouseDrag = function(event) {
4439
4523
  <div class="button run">Run</div>
4440
4524
  </div>
4441
4525
 
4442
- <script type="text/paperscript" canvas="canvas-43">
4526
+ <script type="text/paperscript" canvas="canvas-44">
4443
4527
  // Create a circle shaped path at the center of the view:
4444
4528
  var path = new Path.Circle({
4445
4529
  center: view.center,
@@ -4453,7 +4537,7 @@ path.onMouseUp = function(event) {
4453
4537
  this.fillColor = 'red';
4454
4538
  }
4455
4539
  </script>
4456
- <div class="canvas"><canvas width="516" height="100" id="canvas-43"></canvas></div>
4540
+ <div class="canvas"><canvas width="516" height="100" id="canvas-44"></canvas></div>
4457
4541
  </div>
4458
4542
 
4459
4543
 
@@ -4497,7 +4581,7 @@ path.onMouseUp = function(event) {
4497
4581
  <div class="button run">Run</div>
4498
4582
  </div>
4499
4583
 
4500
- <script type="text/paperscript" canvas="canvas-44">
4584
+ <script type="text/paperscript" canvas="canvas-45">
4501
4585
  // Create a circle shaped path at the center of the view:
4502
4586
  var path = new Path.Circle({
4503
4587
  center: view.center,
@@ -4511,7 +4595,7 @@ path.onClick = function(event) {
4511
4595
  this.fillColor = 'red';
4512
4596
  }
4513
4597
  </script>
4514
- <div class="canvas"><canvas width="516" height="100" id="canvas-44"></canvas></div>
4598
+ <div class="canvas"><canvas width="516" height="100" id="canvas-45"></canvas></div>
4515
4599
  </div>
4516
4600
 
4517
4601
 
@@ -4523,7 +4607,7 @@ path.onClick = function(event) {
4523
4607
  <div class="button run">Run</div>
4524
4608
  </div>
4525
4609
 
4526
- <script type="text/paperscript" canvas="canvas-45">
4610
+ <script type="text/paperscript" canvas="canvas-46">
4527
4611
  // Loop 30 times:
4528
4612
  for (var i = 0; i < 30; i++) {
4529
4613
  // Create a circle shaped path at a random position
@@ -4541,7 +4625,7 @@ for (var i = 0; i < 30; i++) {
4541
4625
  }
4542
4626
  }
4543
4627
  </script>
4544
- <div class="canvas"><canvas width="516" height="100" id="canvas-45"></canvas></div>
4628
+ <div class="canvas"><canvas width="516" height="100" id="canvas-46"></canvas></div>
4545
4629
  </div>
4546
4630
 
4547
4631
 
@@ -4585,7 +4669,7 @@ for (var i = 0; i < 30; i++) {
4585
4669
  <div class="button run">Run</div>
4586
4670
  </div>
4587
4671
 
4588
- <script type="text/paperscript" canvas="canvas-46">
4672
+ <script type="text/paperscript" canvas="canvas-47">
4589
4673
  // Create a circle shaped path at the center of the view:
4590
4674
  var path = new Path.Circle({
4591
4675
  center: view.center,
@@ -4599,7 +4683,7 @@ path.onDoubleClick = function(event) {
4599
4683
  this.fillColor = 'red';
4600
4684
  }
4601
4685
  </script>
4602
- <div class="canvas"><canvas width="516" height="100" id="canvas-46"></canvas></div>
4686
+ <div class="canvas"><canvas width="516" height="100" id="canvas-47"></canvas></div>
4603
4687
  </div>
4604
4688
 
4605
4689
 
@@ -4611,7 +4695,7 @@ path.onDoubleClick = function(event) {
4611
4695
  <div class="button run">Run</div>
4612
4696
  </div>
4613
4697
 
4614
- <script type="text/paperscript" canvas="canvas-47">
4698
+ <script type="text/paperscript" canvas="canvas-48">
4615
4699
  // Loop 30 times:
4616
4700
  for (var i = 0; i < 30; i++) {
4617
4701
  // Create a circle shaped path at a random position
@@ -4629,7 +4713,7 @@ for (var i = 0; i < 30; i++) {
4629
4713
  }
4630
4714
  }
4631
4715
  </script>
4632
- <div class="canvas"><canvas width="516" height="100" id="canvas-47"></canvas></div>
4716
+ <div class="canvas"><canvas width="516" height="100" id="canvas-48"></canvas></div>
4633
4717
  </div>
4634
4718
 
4635
4719
 
@@ -4673,7 +4757,7 @@ for (var i = 0; i < 30; i++) {
4673
4757
  <div class="button run">Run</div>
4674
4758
  </div>
4675
4759
 
4676
- <script type="text/paperscript" canvas="canvas-48">
4760
+ <script type="text/paperscript" canvas="canvas-49">
4677
4761
  // Create a circle shaped path at the center of the view:
4678
4762
  var path = new Path.Circle({
4679
4763
  center: view.center,
@@ -4687,7 +4771,7 @@ path.onMouseMove = function(event) {
4687
4771
  this.opacity = Math.random();
4688
4772
  }
4689
4773
  </script>
4690
- <div class="canvas"><canvas width="516" height="100" id="canvas-48"></canvas></div>
4774
+ <div class="canvas"><canvas width="516" height="100" id="canvas-49"></canvas></div>
4691
4775
  </div>
4692
4776
 
4693
4777
 
@@ -4731,7 +4815,7 @@ path.onMouseMove = function(event) {
4731
4815
  <div class="button run">Run</div>
4732
4816
  </div>
4733
4817
 
4734
- <script type="text/paperscript" canvas="canvas-49">
4818
+ <script type="text/paperscript" canvas="canvas-50">
4735
4819
  // Create a circle shaped path at the center of the view:
4736
4820
  var path = new Path.Circle({
4737
4821
  center: view.center,
@@ -4749,7 +4833,7 @@ path.onMouseLeave = function(event) {
4749
4833
  this.fillColor = 'black';
4750
4834
  }
4751
4835
  </script>
4752
- <div class="canvas"><canvas width="516" height="100" id="canvas-49"></canvas></div>
4836
+ <div class="canvas"><canvas width="516" height="100" id="canvas-50"></canvas></div>
4753
4837
  </div>
4754
4838
 
4755
4839
 
@@ -4761,7 +4845,7 @@ path.onMouseLeave = function(event) {
4761
4845
  <div class="button run">Run</div>
4762
4846
  </div>
4763
4847
 
4764
- <script type="text/paperscript" canvas="canvas-50">
4848
+ <script type="text/paperscript" canvas="canvas-51">
4765
4849
  function enter(event) {
4766
4850
  this.fillColor = 'red';
4767
4851
  }
@@ -4783,7 +4867,7 @@ function onMouseDown(event) {
4783
4867
  path.onMouseLeave = leave;
4784
4868
  }
4785
4869
  </script>
4786
- <div class="canvas"><canvas width="516" height="100" id="canvas-50"></canvas></div>
4870
+ <div class="canvas"><canvas width="516" height="100" id="canvas-51"></canvas></div>
4787
4871
  </div>
4788
4872
 
4789
4873
 
@@ -4827,7 +4911,7 @@ function onMouseDown(event) {
4827
4911
  <div class="button run">Run</div>
4828
4912
  </div>
4829
4913
 
4830
- <script type="text/paperscript" canvas="canvas-51">
4914
+ <script type="text/paperscript" canvas="canvas-52">
4831
4915
  // Create a circle shaped path at the center of the view:
4832
4916
  var path = new Path.Circle({
4833
4917
  center: view.center,
@@ -4840,7 +4924,7 @@ path.onMouseLeave = function(event) {
4840
4924
  this.fillColor = 'red';
4841
4925
  }
4842
4926
  </script>
4843
- <div class="canvas"><canvas width="516" height="100" id="canvas-51"></canvas></div>
4927
+ <div class="canvas"><canvas width="516" height="100" id="canvas-52"></canvas></div>
4844
4928
  </div>
4845
4929
 
4846
4930
 
@@ -4899,7 +4983,7 @@ path.onMouseLeave = function(event) {
4899
4983
  <div class="button run">Run</div>
4900
4984
  </div>
4901
4985
 
4902
- <script type="text/paperscript" canvas="canvas-52">
4986
+ <script type="text/paperscript" canvas="canvas-53">
4903
4987
  var circle = new Path.Circle({
4904
4988
  center: [80, 50],
4905
4989
  radius: 35
@@ -4912,7 +4996,7 @@ circle.set({
4912
4996
  selected: true
4913
4997
  });
4914
4998
  </script>
4915
- <div class="canvas"><canvas width="516" height="100" id="canvas-52"></canvas></div>
4999
+ <div class="canvas"><canvas width="516" height="100" id="canvas-53"></canvas></div>
4916
5000
  </div>
4917
5001
 
4918
5002
 
@@ -4968,7 +5052,7 @@ circle.set({
4968
5052
  <div class="button run">Run</div>
4969
5053
  </div>
4970
5054
 
4971
- <script type="text/paperscript" canvas="canvas-53">
5055
+ <script type="text/paperscript" canvas="canvas-54">
4972
5056
  var circle = new Path.Circle({
4973
5057
  center: [50, 50],
4974
5058
  radius: 10,
@@ -4983,7 +5067,7 @@ for (var i = 0; i < 20; i++) {
4983
5067
  copy.position.x += i * copy.bounds.width;
4984
5068
  }
4985
5069
  </script>
4986
- <div class="canvas"><canvas width="516" height="100" id="canvas-53"></canvas></div>
5070
+ <div class="canvas"><canvas width="516" height="100" id="canvas-54"></canvas></div>
4987
5071
  </div>
4988
5072
 
4989
5073
 
@@ -5070,9 +5154,9 @@ for (var i = 0; i < 20; i++) {
5070
5154
  <p>Rasterizes the item into a newly created Raster object. The item itself is not removed after rasterization.</p>
5071
5155
  <ul class="member-list">
5072
5156
  <h4>Options:</h4>
5073
- <li><tt>resolution: <tt>Number</tt></tt> &mdash; the desired resolution to be used when rasterizing, in pixels per inch (DPI). If not specified, the value of <code>view.resolution</code> is used by default. &mdash;&nbsp;default: <tt>view.resolution</tt></li>
5074
- <li><tt>raster: <a href="../classes/Raster.html"><tt>Raster</tt></a></tt> &mdash; specifies a raster to be reused when rasterizing. If the raster has the desired size already, then the underlying canvas is reused and no new memory needs to be allocated. If no raster is provided, a new raster item is created and returned instead. &mdash;&nbsp;default: <tt>null</tt></li>
5075
- <li><tt>insert: <tt>Boolean</tt></tt> &mdash; specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the rasterized item. &mdash;&nbsp;default: <tt>true</tt></li>
5157
+ <li><tt>options.resolution: <tt>Number</tt></tt> &mdash; the desired resolution to be used when rasterizing, in pixels per inch (DPI). If not specified, the value of <code>view.resolution</code> is used by default. &mdash;&nbsp;default: <tt>view.resolution</tt></li>
5158
+ <li><tt>options.raster: <a href="../classes/Raster.html"><tt>Raster</tt></a></tt> &mdash; specifies a raster to be reused when rasterizing. If the raster has the desired size already, then the underlying canvas is reused and no new memory needs to be allocated. If no raster is provided, a new raster item is created and returned instead. &mdash;&nbsp;default: <tt>null</tt></li>
5159
+ <li><tt>options.insert: <tt>Boolean</tt></tt> &mdash; specifies whether the raster should be inserted into the scene graph. When set to <code>true</code>, it is inserted above the rasterized item. &mdash;&nbsp;default: <tt>true</tt></li>
5076
5160
  </ul>
5077
5161
 
5078
5162
  <ul class="member-list">
@@ -5109,7 +5193,7 @@ for (var i = 0; i < 20; i++) {
5109
5193
  <div class="button run">Run</div>
5110
5194
  </div>
5111
5195
 
5112
- <script type="text/paperscript" canvas="canvas-54">
5196
+ <script type="text/paperscript" canvas="canvas-55">
5113
5197
  var circle = new Path.Circle({
5114
5198
  center: [50, 50],
5115
5199
  radius: 5,
@@ -5126,7 +5210,7 @@ raster.position.x += 100;
5126
5210
  circle.scale(5);
5127
5211
  raster.scale(5);
5128
5212
  </script>
5129
- <div class="canvas"><canvas width="516" height="100" id="canvas-54"></canvas></div>
5213
+ <div class="canvas"><canvas width="516" height="100" id="canvas-55"></canvas></div>
5130
5214
  </div>
5131
5215
 
5132
5216
 
@@ -5180,7 +5264,7 @@ raster.scale(5);
5180
5264
  <div class="button run">Run</div>
5181
5265
  </div>
5182
5266
 
5183
- <script type="text/paperscript" canvas="canvas-55">
5267
+ <script type="text/paperscript" canvas="canvas-56">
5184
5268
  var path = new Path.Star({
5185
5269
  center: [50, 50],
5186
5270
  points: 12,
@@ -5201,7 +5285,7 @@ function onMouseDown(event) {
5201
5285
  }
5202
5286
  }
5203
5287
  </script>
5204
- <div class="canvas"><canvas width="516" height="100" id="canvas-55"></canvas></div>
5288
+ <div class="canvas"><canvas width="516" height="100" id="canvas-56"></canvas></div>
5205
5289
  </div>
5206
5290
 
5207
5291
 
@@ -5257,7 +5341,7 @@ function onMouseDown(event) {
5257
5341
  </div>
5258
5342
  <div class="member-description hidden">
5259
5343
  <div class="member-text">
5260
-
5344
+ <p>Checks whether the item overlaps with the given item: whether their outlines cross, or one contains the other, as <a href="../classes/Rectangle.html#intersects-rect"><tt>rectangle.intersects(rect)</tt></a> does for rectangles. Items other than paths and shapes are checked through their bounds. To only check whether outlines cross, use <a href="../classes/PathItem.html#getintersections-path"><tt>pathItem.getIntersections(path)</tt></a>.</p>
5261
5345
 
5262
5346
 
5263
5347
  <ul class="member-list">
@@ -5277,7 +5361,7 @@ function onMouseDown(event) {
5277
5361
  <h4>Returns:</h4>
5278
5362
 
5279
5363
  <li>
5280
- <tt><tt>Boolean</tt></tt>
5364
+ <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the items overlap, <tt>false</tt> otherwise
5281
5365
  </li>
5282
5366
 
5283
5367
 
@@ -5773,6 +5857,7 @@ function onMouseDown(event) {
5773
5857
  <div class="member-text">
5774
5858
  <p>Converts the provided SVG content into Paper.js items and adds them to the this item&rsquo;s children list. Note that the item is not cleared first. You can call <a href="../classes/Item.html#removechildren"><tt>item.removeChildren</tt></a>() to do so.</p>
5775
5859
  <p><code>&lt;symbol&gt;</code> elements are imported as <a href="../classes/SymbolDefinition.html"><tt>SymbolDefinition</tt></a> items, and the <code>&lt;use&gt;</code> elements that place them as <a href="../classes/SymbolItem.html"><tt>SymbolItem</tt></a> items. The styles that <code>&lt;use&gt;</code> elements inherit don&rsquo;t reach the symbols&rsquo; content.</p>
5860
+ <p>URLs are fetched as they are, so validate URLs that come from untrusted sources first, especially on servers, where they could reach internal addresses.</p>
5776
5861
  <ul class="member-list">
5777
5862
  <h4>Options:</h4>
5778
5863
  <li><tt>options.expandShapes: <tt>Boolean</tt></tt> &mdash; whether imported shape items should be expanded to path items &mdash;&nbsp;default: <tt>false</tt></li>
@@ -6326,11 +6411,11 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
6326
6411
 
6327
6412
  <div id="replacewith-item" class="member">
6328
6413
  <div class="member-link">
6329
- <a name="replacewith-item" href="#replacewith-item"><tt><b>replaceWith</b>(item)</tt></a>
6414
+ <a name="replacewith-item" href="#replacewith-item"><tt><b>replaceWith</b>(...item)</tt></a>
6330
6415
  </div>
6331
6416
  <div class="member-description hidden">
6332
6417
  <div class="member-text">
6333
- <p>Replaces this item with the provided new item which will takes its place in the project hierarchy instead.</p>
6418
+ <p>Replaces this item with the provided new items which will take its place in the project hierarchy instead, in the given order. This also ungroups a group, e.g. <code>group.replaceWith(…group.children)</code>, but note that the items keep their own matrices, see <a href="../classes/Group.html#ungroup"><tt>group.ungroup</tt></a>().</p>
6334
6419
 
6335
6420
 
6336
6421
  <ul class="member-list">
@@ -6339,7 +6424,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
6339
6424
  <li>
6340
6425
  <tt>item:</tt>
6341
6426
  <a href="../classes/Item.html"><tt>Item</tt></a>
6342
- &mdash;&nbsp;the item that will replace this item
6427
+ &mdash;&nbsp;the items that will replace this item
6343
6428
 
6344
6429
  </li>
6345
6430
 
@@ -7062,7 +7147,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
7062
7147
  <div class="button run">Run</div>
7063
7148
  </div>
7064
7149
 
7065
- <script type="text/paperscript" canvas="canvas-56">
7150
+ <script type="text/paperscript" canvas="canvas-57">
7066
7151
  // Create a rectangle shaped path with its top left
7067
7152
  // point at {x: 80, y: 25} and a size of {width: 50, height: 50}:
7068
7153
  var path = new Path.Rectangle(new Point(80, 25), new Size(50, 50));
@@ -7071,7 +7156,7 @@ path.fillColor = 'black';
7071
7156
  // Rotate the path by 30 degrees:
7072
7157
  path.rotate(30);
7073
7158
  </script>
7074
- <div class="canvas"><canvas width="516" height="100" id="canvas-56"></canvas></div>
7159
+ <div class="canvas"><canvas width="516" height="100" id="canvas-57"></canvas></div>
7075
7160
  </div>
7076
7161
 
7077
7162
 
@@ -7083,7 +7168,7 @@ path.rotate(30);
7083
7168
  <div class="button run">Run</div>
7084
7169
  </div>
7085
7170
 
7086
- <script type="text/paperscript" canvas="canvas-57">
7171
+ <script type="text/paperscript" canvas="canvas-58">
7087
7172
  // Create a rectangle shaped path with its top left
7088
7173
  // point at {x: 175, y: 50} and a size of {width: 100, height: 100}:
7089
7174
  var topLeft = new Point(175, 50);
@@ -7105,7 +7190,7 @@ function onFrame(event) {
7105
7190
  path.rotate(3, view.center);
7106
7191
  }
7107
7192
  </script>
7108
- <div class="canvas"><canvas width="516" height="200" id="canvas-57"></canvas></div>
7193
+ <div class="canvas"><canvas width="516" height="200" id="canvas-58"></canvas></div>
7109
7194
  </div>
7110
7195
 
7111
7196
 
@@ -7154,7 +7239,7 @@ function onFrame(event) {
7154
7239
  <div class="button run">Run</div>
7155
7240
  </div>
7156
7241
 
7157
- <script type="text/paperscript" canvas="canvas-58">
7242
+ <script type="text/paperscript" canvas="canvas-59">
7158
7243
  // Create a circle shaped path at { x: 80, y: 50 }
7159
7244
  // with a radius of 20:
7160
7245
  var circle = new Path.Circle({
@@ -7166,7 +7251,7 @@ var circle = new Path.Circle({
7166
7251
  // Scale the path by 150% from its center point
7167
7252
  circle.scale(1.5);
7168
7253
  </script>
7169
- <div class="canvas"><canvas width="516" height="100" id="canvas-58"></canvas></div>
7254
+ <div class="canvas"><canvas width="516" height="100" id="canvas-59"></canvas></div>
7170
7255
  </div>
7171
7256
 
7172
7257
 
@@ -7178,7 +7263,7 @@ circle.scale(1.5);
7178
7263
  <div class="button run">Run</div>
7179
7264
  </div>
7180
7265
 
7181
- <script type="text/paperscript" canvas="canvas-59">
7266
+ <script type="text/paperscript" canvas="canvas-60">
7182
7267
  // Create a circle shaped path at { x: 80, y: 50 }
7183
7268
  // with a radius of 20:
7184
7269
  var circle = new Path.Circle({
@@ -7190,7 +7275,7 @@ var circle = new Path.Circle({
7190
7275
  // Scale the path 150% from its bottom left corner
7191
7276
  circle.scale(1.5, circle.bounds.bottomLeft);
7192
7277
  </script>
7193
- <div class="canvas"><canvas width="516" height="100" id="canvas-59"></canvas></div>
7278
+ <div class="canvas"><canvas width="516" height="100" id="canvas-60"></canvas></div>
7194
7279
  </div>
7195
7280
 
7196
7281
 
@@ -7246,7 +7331,7 @@ circle.scale(1.5, circle.bounds.bottomLeft);
7246
7331
  <div class="button run">Run</div>
7247
7332
  </div>
7248
7333
 
7249
- <script type="text/paperscript" canvas="canvas-60">
7334
+ <script type="text/paperscript" canvas="canvas-61">
7250
7335
  // Create a circle shaped path at { x: 100, y: 50 }
7251
7336
  // with a radius of 20:
7252
7337
  var circle = new Path.Circle({
@@ -7258,7 +7343,7 @@ var circle = new Path.Circle({
7258
7343
  // Scale the path horizontally by 300%
7259
7344
  circle.scale(3, 1);
7260
7345
  </script>
7261
- <div class="canvas"><canvas width="516" height="100" id="canvas-60"></canvas></div>
7346
+ <div class="canvas"><canvas width="516" height="100" id="canvas-61"></canvas></div>
7262
7347
  </div>
7263
7348
 
7264
7349
 
@@ -7696,7 +7781,7 @@ circle.scale(3, 1);
7696
7781
  <div class="button run">Run</div>
7697
7782
  </div>
7698
7783
 
7699
- <script type="text/paperscript" canvas="canvas-61">
7784
+ <script type="text/paperscript" canvas="canvas-62">
7700
7785
  // Create a rectangle shaped path with its top left corner
7701
7786
  // at {x: 80, y: 25} and a size of {width: 75, height: 50}:
7702
7787
  var path = new Path.Rectangle({
@@ -7717,7 +7802,7 @@ var circlePath = new Path.Circle({
7717
7802
  // the rectangular path:
7718
7803
  circlePath.fitBounds(path.bounds);
7719
7804
  </script>
7720
- <div class="canvas"><canvas width="516" height="100" id="canvas-61"></canvas></div>
7805
+ <div class="canvas"><canvas width="516" height="100" id="canvas-62"></canvas></div>
7721
7806
  </div>
7722
7807
 
7723
7808
 
@@ -7729,7 +7814,7 @@ circlePath.fitBounds(path.bounds);
7729
7814
  <div class="button run">Run</div>
7730
7815
  </div>
7731
7816
 
7732
- <script type="text/paperscript" canvas="canvas-62">
7817
+ <script type="text/paperscript" canvas="canvas-63">
7733
7818
  // Create a rectangle shaped path with its top left corner
7734
7819
  // at {x: 80, y: 25} and a size of {width: 75, height: 50}:
7735
7820
  var path = new Path.Rectangle({
@@ -7750,7 +7835,7 @@ var circlePath = new Path.Circle({
7750
7835
  // the rectangular path:
7751
7836
  circlePath.fitBounds(path.bounds, 'cover');
7752
7837
  </script>
7753
- <div class="canvas"><canvas width="516" height="100" id="canvas-62"></canvas></div>
7838
+ <div class="canvas"><canvas width="516" height="100" id="canvas-63"></canvas></div>
7754
7839
  </div>
7755
7840
 
7756
7841
 
@@ -7762,7 +7847,7 @@ circlePath.fitBounds(path.bounds, 'cover');
7762
7847
  <div class="button run">Run</div>
7763
7848
  </div>
7764
7849
 
7765
- <script type="text/paperscript" canvas="canvas-63">
7850
+ <script type="text/paperscript" canvas="canvas-64">
7766
7851
  var path = new Path.Circle({
7767
7852
  center: [80, 50],
7768
7853
  radius: 30,
@@ -7772,7 +7857,7 @@ var path = new Path.Circle({
7772
7857
  // Fit the path to the bounding rectangle of the view:
7773
7858
  path.fitBounds(view.bounds);
7774
7859
  </script>
7775
- <div class="canvas"><canvas width="516" height="200" id="canvas-63"></canvas></div>
7860
+ <div class="canvas"><canvas width="516" height="200" id="canvas-64"></canvas></div>
7776
7861
  </div>
7777
7862
 
7778
7863
 
@@ -7833,7 +7918,7 @@ path.fitBounds(view.bounds);
7833
7918
  <div class="button run">Run</div>
7834
7919
  </div>
7835
7920
 
7836
- <script type="text/paperscript" canvas="canvas-64">
7921
+ <script type="text/paperscript" canvas="canvas-65">
7837
7922
  // Create a circle shaped path at the center of the view:
7838
7923
  var path = new Path.Circle({
7839
7924
  center: view.center,
@@ -7851,7 +7936,7 @@ path.on('mouseleave', function() {
7851
7936
  this.fillColor = 'black';
7852
7937
  });
7853
7938
  </script>
7854
- <div class="canvas"><canvas width="516" height="100" id="canvas-64"></canvas></div>
7939
+ <div class="canvas"><canvas width="516" height="100" id="canvas-65"></canvas></div>
7855
7940
  </div>
7856
7941
 
7857
7942
 
@@ -7903,7 +7988,7 @@ path.on('mouseleave', function() {
7903
7988
  <div class="button run">Run</div>
7904
7989
  </div>
7905
7990
 
7906
- <script type="text/paperscript" canvas="canvas-65">
7991
+ <script type="text/paperscript" canvas="canvas-66">
7907
7992
  // Create a circle shaped path at the center of the view:
7908
7993
  var path = new Path.Circle({
7909
7994
  center: view.center,
@@ -7921,7 +8006,7 @@ path.on({
7921
8006
  }
7922
8007
  });
7923
8008
  </script>
7924
- <div class="canvas"><canvas width="516" height="100" id="canvas-65"></canvas></div>
8009
+ <div class="canvas"><canvas width="516" height="100" id="canvas-66"></canvas></div>
7925
8010
  </div>
7926
8011
 
7927
8012
 
@@ -7933,7 +8018,7 @@ path.on({
7933
8018
  <div class="button run">Run</div>
7934
8019
  </div>
7935
8020
 
7936
- <script type="text/paperscript" canvas="canvas-66">
8021
+ <script type="text/paperscript" canvas="canvas-67">
7937
8022
  var pathHandlers = {
7938
8023
  mouseenter: function(event) {
7939
8024
  this.fillColor = 'red';
@@ -7956,7 +8041,7 @@ function onMouseDown(event) {
7956
8041
  path.on(pathHandlers);
7957
8042
  }
7958
8043
  </script>
7959
- <div class="canvas"><canvas width="516" height="100" id="canvas-66"></canvas></div>
8044
+ <div class="canvas"><canvas width="516" height="100" id="canvas-67"></canvas></div>
7960
8045
  </div>
7961
8046
 
7962
8047
 
@@ -8154,10 +8239,10 @@ function onMouseDown(event) {
8154
8239
  <p>Removes the item when the events specified in the passed options object occur.</p>
8155
8240
  <ul class="member-list">
8156
8241
  <h4>Options:</h4>
8157
- <li><tt>options.move: undefined</tt> &mdash; {Boolean) remove the item when the next <a href="../classes/Tool.html#onmousemove"><tt>tool.onMouseMove</tt></a> event is fired.</li>
8158
- <li><tt>options.drag: undefined</tt> &mdash; {Boolena) remove the item when the next <a href="../classes/Tool.html#onmousedrag"><tt>tool.onMouseDrag</tt></a> event is fired.</li>
8159
- <li><tt>options.down: undefined</tt> &mdash; {Boolean) remove the item when the next <a href="../classes/Tool.html#onmousedown"><tt>tool.onMouseDown</tt></a> event is fired.</li>
8160
- <li><tt>options.up: undefined</tt> &mdash; {Boolean) remove the item when the next <a href="../classes/Tool.html#onmouseup"><tt>tool.onMouseUp</tt></a> event is fired.</li>
8242
+ <li><tt>options.move: <tt>Boolean</tt></tt> &mdash; remove the item when the next <a href="../classes/Tool.html#onmousemove"><tt>tool.onMouseMove</tt></a> event is fired.</li>
8243
+ <li><tt>options.drag: <tt>Boolean</tt></tt> &mdash; remove the item when the next <a href="../classes/Tool.html#onmousedrag"><tt>tool.onMouseDrag</tt></a> event is fired.</li>
8244
+ <li><tt>options.down: <tt>Boolean</tt></tt> &mdash; remove the item when the next <a href="../classes/Tool.html#onmousedown"><tt>tool.onMouseDown</tt></a> event is fired.</li>
8245
+ <li><tt>options.up: <tt>Boolean</tt></tt> &mdash; remove the item when the next <a href="../classes/Tool.html#onmouseup"><tt>tool.onMouseUp</tt></a> event is fired.</li>
8161
8246
  </ul>
8162
8247
 
8163
8248
  <ul class="member-list">
@@ -8184,7 +8269,7 @@ function onMouseDown(event) {
8184
8269
  <div class="button run">Run</div>
8185
8270
  </div>
8186
8271
 
8187
- <script type="text/paperscript" canvas="canvas-67">
8272
+ <script type="text/paperscript" canvas="canvas-68">
8188
8273
  function onMouseDrag(event) {
8189
8274
  // Create a circle shaped path at the mouse position,
8190
8275
  // with a radius of 10:
@@ -8201,7 +8286,7 @@ function onMouseDrag(event) {
8201
8286
  });
8202
8287
  }
8203
8288
  </script>
8204
- <div class="canvas"><canvas width="516" height="200" id="canvas-67"></canvas></div>
8289
+ <div class="canvas"><canvas width="516" height="200" id="canvas-68"></canvas></div>
8205
8290
  </div>
8206
8291
 
8207
8292
 
@@ -8231,7 +8316,7 @@ function onMouseDrag(event) {
8231
8316
  <div class="button run">Run</div>
8232
8317
  </div>
8233
8318
 
8234
- <script type="text/paperscript" canvas="canvas-68">
8319
+ <script type="text/paperscript" canvas="canvas-69">
8235
8320
  function onMouseMove(event) {
8236
8321
  // Create a circle shaped path at the mouse position,
8237
8322
  // with a radius of 10:
@@ -8245,7 +8330,7 @@ function onMouseMove(event) {
8245
8330
  path.removeOnMove();
8246
8331
  }
8247
8332
  </script>
8248
- <div class="canvas"><canvas width="516" height="200" id="canvas-68"></canvas></div>
8333
+ <div class="canvas"><canvas width="516" height="200" id="canvas-69"></canvas></div>
8249
8334
  </div>
8250
8335
 
8251
8336
 
@@ -8275,7 +8360,7 @@ function onMouseMove(event) {
8275
8360
  <div class="button run">Run</div>
8276
8361
  </div>
8277
8362
 
8278
- <script type="text/paperscript" canvas="canvas-69">
8363
+ <script type="text/paperscript" canvas="canvas-70">
8279
8364
  function onMouseDown(event) {
8280
8365
  // Create a circle shaped path at the mouse position,
8281
8366
  // with a radius of 10:
@@ -8289,7 +8374,7 @@ function onMouseDown(event) {
8289
8374
  path.removeOnDown();
8290
8375
  }
8291
8376
  </script>
8292
- <div class="canvas"><canvas width="516" height="200" id="canvas-69"></canvas></div>
8377
+ <div class="canvas"><canvas width="516" height="200" id="canvas-70"></canvas></div>
8293
8378
  </div>
8294
8379
 
8295
8380
 
@@ -8319,7 +8404,7 @@ function onMouseDown(event) {
8319
8404
  <div class="button run">Run</div>
8320
8405
  </div>
8321
8406
 
8322
- <script type="text/paperscript" canvas="canvas-70">
8407
+ <script type="text/paperscript" canvas="canvas-71">
8323
8408
  function onMouseDrag(event) {
8324
8409
  // Create a circle shaped path at the mouse position,
8325
8410
  // with a radius of 10:
@@ -8333,7 +8418,7 @@ function onMouseDrag(event) {
8333
8418
  path.removeOnDrag();
8334
8419
  }
8335
8420
  </script>
8336
- <div class="canvas"><canvas width="516" height="200" id="canvas-70"></canvas></div>
8421
+ <div class="canvas"><canvas width="516" height="200" id="canvas-71"></canvas></div>
8337
8422
  </div>
8338
8423
 
8339
8424
 
@@ -8363,7 +8448,7 @@ function onMouseDrag(event) {
8363
8448
  <div class="button run">Run</div>
8364
8449
  </div>
8365
8450
 
8366
- <script type="text/paperscript" canvas="canvas-71">
8451
+ <script type="text/paperscript" canvas="canvas-72">
8367
8452
  function onMouseDown(event) {
8368
8453
  // Create a circle shaped path at the mouse position,
8369
8454
  // with a radius of 10:
@@ -8377,7 +8462,7 @@ function onMouseDown(event) {
8377
8462
  path.removeOnUp();
8378
8463
  }
8379
8464
  </script>
8380
- <div class="canvas"><canvas width="516" height="200" id="canvas-71"></canvas></div>
8465
+ <div class="canvas"><canvas width="516" height="200" id="canvas-72"></canvas></div>
8381
8466
  </div>
8382
8467
 
8383
8468
 
@@ -8450,7 +8535,7 @@ function onMouseDown(event) {
8450
8535
  <div class="button run">Run</div>
8451
8536
  </div>
8452
8537
 
8453
- <script type="text/paperscript" canvas="canvas-72">
8538
+ <script type="text/paperscript" canvas="canvas-73">
8454
8539
  var path = new Path.Circle({
8455
8540
  radius: view.bounds.height * 0.4,
8456
8541
  center: view.center
@@ -8461,7 +8546,7 @@ path.tween(
8461
8546
  3000
8462
8547
  );
8463
8548
  </script>
8464
- <div class="canvas"><canvas width="516" height="100" id="canvas-72"></canvas></div>
8549
+ <div class="canvas"><canvas width="516" height="100" id="canvas-73"></canvas></div>
8465
8550
  </div>
8466
8551
 
8467
8552
 
@@ -8473,7 +8558,7 @@ path.tween(
8473
8558
  <div class="button run">Run</div>
8474
8559
  </div>
8475
8560
 
8476
- <script type="text/paperscript" canvas="canvas-73">
8561
+ <script type="text/paperscript" canvas="canvas-74">
8477
8562
  var path = new Shape.Rectangle({
8478
8563
  fillColor: 'red',
8479
8564
  center: [50, view.center.y],
@@ -8488,7 +8573,7 @@ path.tween({
8488
8573
  duration: 2000
8489
8574
  });
8490
8575
  </script>
8491
- <div class="canvas"><canvas width="516" height="100" id="canvas-73"></canvas></div>
8576
+ <div class="canvas"><canvas width="516" height="100" id="canvas-74"></canvas></div>
8492
8577
  </div>
8493
8578
 
8494
8579
 
@@ -8554,7 +8639,7 @@ path.tween({
8554
8639
  <div class="button run">Run</div>
8555
8640
  </div>
8556
8641
 
8557
- <script type="text/paperscript" canvas="canvas-74">
8642
+ <script type="text/paperscript" canvas="canvas-75">
8558
8643
  var path = new Path.Rectangle({
8559
8644
  size: [100, 100],
8560
8645
  position: view.center,
@@ -8568,7 +8653,7 @@ path.tween({
8568
8653
  'segments[2].point.x': '-= 50'
8569
8654
  }, 3000);
8570
8655
  </script>
8571
- <div class="canvas"><canvas width="516" height="200" id="canvas-74"></canvas></div>
8656
+ <div class="canvas"><canvas width="516" height="200" id="canvas-75"></canvas></div>
8572
8657
  </div>
8573
8658
 
8574
8659
 
@@ -8627,7 +8712,7 @@ path.tween({
8627
8712
  <div class="button run">Run</div>
8628
8713
  </div>
8629
8714
 
8630
- <script type="text/paperscript" canvas="canvas-75">
8715
+ <script type="text/paperscript" canvas="canvas-76">
8631
8716
  var path = new Path.Circle({
8632
8717
  fillColor: 'blue',
8633
8718
  radius: view.bounds.height * 0.4,
@@ -8643,7 +8728,7 @@ path.tween(2000).onUpdate = function(event) {
8643
8728
  path.interpolate(pathFrom, pathTo, event.factor)
8644
8729
  };
8645
8730
  </script>
8646
- <div class="canvas"><canvas width="516" height="100" id="canvas-75"></canvas></div>
8731
+ <div class="canvas"><canvas width="516" height="100" id="canvas-76"></canvas></div>
8647
8732
  </div>
8648
8733
 
8649
8734
 
@@ -8764,7 +8849,7 @@ path.tween(2000).onUpdate = function(event) {
8764
8849
  <div class="button run">Run</div>
8765
8850
  </div>
8766
8851
 
8767
- <script type="text/paperscript" canvas="canvas-76">
8852
+ <script type="text/paperscript" canvas="canvas-77">
8768
8853
  var path = new Path.Circle({
8769
8854
  fillColor: 'blue',
8770
8855
  radius: view.bounds.height * 0.4,
@@ -8772,7 +8857,7 @@ var path = new Path.Circle({
8772
8857
  });
8773
8858
  path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
8774
8859
  </script>
8775
- <div class="canvas"><canvas width="516" height="100" id="canvas-76"></canvas></div>
8860
+ <div class="canvas"><canvas width="516" height="100" id="canvas-77"></canvas></div>
8776
8861
  </div>
8777
8862
 
8778
8863
 
@@ -8786,7 +8871,7 @@ path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
8786
8871
 
8787
8872
  <!-- =========================== copyright notice ========================== -->
8788
8873
  <p class="footer">
8789
- Paper.js v0.14.0<br>
8874
+ Paper.js v0.15.0<br>
8790
8875
  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>
8791
8876
  <div class="content-end"></div>
8792
8877