paper 0.13.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 +337 -0
  2. package/README.md +19 -14
  3. package/dist/docs/assets/js/paper.js +7351 -1706
  4. package/dist/docs/classes/AreaText.html +8658 -0
  5. package/dist/docs/classes/ChangeFlag.html +385 -0
  6. package/dist/docs/classes/Color.html +2 -1
  7. package/dist/docs/classes/CompoundPath.html +208 -69
  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 +204 -17
  14. package/dist/docs/classes/HitResult.html +4 -2
  15. package/dist/docs/classes/HostItem.html +6786 -0
  16. package/dist/docs/classes/Item.html +193 -17
  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 +201 -17
  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 +5 -2
  23. package/dist/docs/classes/PaperScript.html +6 -2
  24. package/dist/docs/classes/Path.html +183 -70
  25. package/dist/docs/classes/PathItem.html +326 -187
  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 +1404 -63
  29. package/dist/docs/classes/Project.html +221 -1
  30. package/dist/docs/classes/Raster.html +136 -17
  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 +136 -17
  34. package/dist/docs/classes/Size.html +4 -2
  35. package/dist/docs/classes/Style.html +768 -15
  36. package/dist/docs/classes/SymbolDefinition.html +2 -1
  37. package/dist/docs/classes/SymbolItem.html +136 -17
  38. package/dist/docs/classes/TextItem.html +1566 -222
  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 +127 -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 +148 -5
  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 +7160 -1663
  49. package/dist/paper-core.min.js +3 -3
  50. package/dist/paper-full.js +7351 -1706
  51. package/dist/paper-full.min.js +3 -3
  52. package/dist/paper-hosted.js +24058 -0
  53. package/dist/paper.d.ts +1996 -155
  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 +8 -11
@@ -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
 
@@ -2110,6 +2131,32 @@ Array of <tt>Number[]</tt> objects[]
2110
2131
  <div class="reference-members"><h2>Properties inherited from <a href="../classes/Item.html"><tt>Item</tt></a></h2>
2111
2132
 
2112
2133
 
2134
+ <div id="key" class="member">
2135
+ <div class="member-link">
2136
+ <a name="key" href="#key"><tt><b>key</b></tt></a>
2137
+ </div>
2138
+ <div class="member-description hidden">
2139
+
2140
+ <div class="member-text">
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>
2142
+
2143
+
2144
+
2145
+ <ul class="member-list">
2146
+ <h4>Type:</h4>
2147
+ <li>
2148
+ <tt>Number</tt>
2149
+ </li>
2150
+ </ul>
2151
+
2152
+
2153
+
2154
+ </div>
2155
+
2156
+ </div>
2157
+ </div>
2158
+
2159
+
2113
2160
  <div id="id" class="member">
2114
2161
  <div class="member-link">
2115
2162
  <a name="id" href="#id"><tt><b>id</b></tt></a>
@@ -2196,7 +2243,7 @@ Array of <tt>Number[]</tt> objects[]
2196
2243
  <div class="button run">Run</div>
2197
2244
  </div>
2198
2245
 
2199
- <script type="text/paperscript" canvas="canvas-18">
2246
+ <script type="text/paperscript" canvas="canvas-19">
2200
2247
  var path = new Path.Circle({
2201
2248
  center: [80, 50],
2202
2249
  radius: 35
@@ -2211,7 +2258,7 @@ group.addChild(path);
2211
2258
  // The path can be accessed by name:
2212
2259
  group.children['example'].fillColor = 'red';
2213
2260
  </script>
2214
- <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>
2215
2262
  </div>
2216
2263
 
2217
2264
 
@@ -2249,7 +2296,7 @@ group.children['example'].fillColor = 'red';
2249
2296
  <div class="button run">Run</div>
2250
2297
  </div>
2251
2298
 
2252
- <script type="text/paperscript" canvas="canvas-19">
2299
+ <script type="text/paperscript" canvas="canvas-20">
2253
2300
  var circle = new Path.Circle({
2254
2301
  center: [80, 50],
2255
2302
  radius: 30
@@ -2260,7 +2307,7 @@ circle.style = {
2260
2307
  strokeWidth: 5
2261
2308
  };
2262
2309
  </script>
2263
- <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>
2264
2311
  </div>
2265
2312
 
2266
2313
 
@@ -2272,7 +2319,7 @@ circle.style = {
2272
2319
  <div class="button run">Run</div>
2273
2320
  </div>
2274
2321
 
2275
- <script type="text/paperscript" canvas="canvas-20">
2322
+ <script type="text/paperscript" canvas="canvas-21">
2276
2323
  var path = new Path.Circle({
2277
2324
  center: [50, 50],
2278
2325
  radius: 30,
@@ -2287,7 +2334,7 @@ var path2 = new Path.Circle({
2287
2334
  // Copy the path style of path:
2288
2335
  path2.style = path.style;
2289
2336
  </script>
2290
- <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>
2291
2338
  </div>
2292
2339
 
2293
2340
 
@@ -2299,7 +2346,7 @@ path2.style = path.style;
2299
2346
  <div class="button run">Run</div>
2300
2347
  </div>
2301
2348
 
2302
- <script type="text/paperscript" canvas="canvas-21">
2349
+ <script type="text/paperscript" canvas="canvas-22">
2303
2350
  var myStyle = {
2304
2351
  fillColor: 'red',
2305
2352
  strokeColor: 'blue',
@@ -2318,7 +2365,7 @@ var path2 = new Path.Circle({
2318
2365
  });
2319
2366
  path2.style = myStyle;
2320
2367
  </script>
2321
- <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>
2322
2369
  </div>
2323
2370
 
2324
2371
 
@@ -2360,7 +2407,7 @@ path2.style = myStyle;
2360
2407
  <div class="button run">Run</div>
2361
2408
  </div>
2362
2409
 
2363
- <script type="text/paperscript" canvas="canvas-22">
2410
+ <script type="text/paperscript" canvas="canvas-23">
2364
2411
  var unlockedItem = new Path.Circle({
2365
2412
  center: view.center - [35, 0],
2366
2413
  radius: 30,
@@ -2387,7 +2434,7 @@ new PointText({
2387
2434
  justification: 'center'
2388
2435
  });
2389
2436
  </script>
2390
- <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>
2391
2438
  </div>
2392
2439
 
2393
2440
 
@@ -2429,7 +2476,7 @@ new PointText({
2429
2476
  <div class="button run">Run</div>
2430
2477
  </div>
2431
2478
 
2432
- <script type="text/paperscript" canvas="canvas-23">
2479
+ <script type="text/paperscript" canvas="canvas-24">
2433
2480
  var path = new Path.Circle({
2434
2481
  center: [50, 50],
2435
2482
  radius: 20,
@@ -2439,7 +2486,7 @@ var path = new Path.Circle({
2439
2486
  // Hide the path:
2440
2487
  path.visible = false;
2441
2488
  </script>
2442
- <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>
2443
2490
  </div>
2444
2491
 
2445
2492
 
@@ -2456,7 +2503,7 @@ path.visible = false;
2456
2503
  <div class="member-description hidden">
2457
2504
 
2458
2505
  <div class="member-text">
2459
- <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>
2460
2507
 
2461
2508
 
2462
2509
  <ul class="member-list">
@@ -2487,7 +2534,7 @@ path.visible = false;
2487
2534
  <div class="button run">Run</div>
2488
2535
  </div>
2489
2536
 
2490
- <script type="text/paperscript" canvas="canvas-24">
2537
+ <script type="text/paperscript" canvas="canvas-25">
2491
2538
  // Create a white rectangle in the background
2492
2539
  // with the same dimensions as the view:
2493
2540
  var background = new Path.Rectangle(view.bounds);
@@ -2508,7 +2555,7 @@ var circle2 = new Path.Circle({
2508
2555
  // Set the blend mode of circle2:
2509
2556
  circle2.blendMode = 'multiply';
2510
2557
  </script>
2511
- <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>
2512
2559
  </div>
2513
2560
 
2514
2561
 
@@ -2550,7 +2597,7 @@ circle2.blendMode = 'multiply';
2550
2597
  <div class="button run">Run</div>
2551
2598
  </div>
2552
2599
 
2553
- <script type="text/paperscript" canvas="canvas-25">
2600
+ <script type="text/paperscript" canvas="canvas-26">
2554
2601
  var circle = new Path.Circle({
2555
2602
  center: [80, 50],
2556
2603
  radius: 35,
@@ -2568,7 +2615,7 @@ var circle2 = new Path.Circle({
2568
2615
  // Make circle2 50% transparent:
2569
2616
  circle2.opacity = 0.5;
2570
2617
  </script>
2571
- <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>
2572
2619
  </div>
2573
2620
 
2574
2621
 
@@ -2609,6 +2656,42 @@ circle2.opacity = 0.5;
2609
2656
  </div>
2610
2657
 
2611
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
+
2612
2695
  <div id="selected" class="member">
2613
2696
  <div class="member-link">
2614
2697
  <a name="selected" href="#selected"><tt><b>selected</b></tt></a>
@@ -2655,17 +2738,43 @@ circle2.opacity = 0.5;
2655
2738
  <div class="button run">Run</div>
2656
2739
  </div>
2657
2740
 
2658
- <script type="text/paperscript" canvas="canvas-26">
2741
+ <script type="text/paperscript" canvas="canvas-27">
2659
2742
  var path = new Path.Circle({
2660
2743
  center: [80, 50],
2661
2744
  radius: 35
2662
2745
  });
2663
2746
  path.selected = true; // Select the path
2664
2747
  </script>
2665
- <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>
2666
2749
  </div>
2667
2750
 
2668
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
+
2669
2778
  </div>
2670
2779
 
2671
2780
  </div>
@@ -2793,7 +2902,7 @@ console.log(path.data.pets.length); // 1</code></pre>
2793
2902
  <div class="button run">Run</div>
2794
2903
  </div>
2795
2904
 
2796
- <script type="text/paperscript" canvas="canvas-27">
2905
+ <script type="text/paperscript" canvas="canvas-28">
2797
2906
  // Create a circle at position { x: 10, y: 10 }
2798
2907
  var circle = new Path.Circle({
2799
2908
  center: new Point(10, 10),
@@ -2807,7 +2916,7 @@ circle.position = new Point(20, 20);
2807
2916
  // Move the circle 100 points to the right and 50 points down
2808
2917
  circle.position += new Point(100, 50);
2809
2918
  </script>
2810
- <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>
2811
2920
  </div>
2812
2921
 
2813
2922
 
@@ -2819,7 +2928,7 @@ circle.position += new Point(100, 50);
2819
2928
  <div class="button run">Run</div>
2820
2929
  </div>
2821
2930
 
2822
- <script type="text/paperscript" canvas="canvas-28">
2931
+ <script type="text/paperscript" canvas="canvas-29">
2823
2932
  // Create a circle at position { x: 20, y: 20 }
2824
2933
  var circle = new Path.Circle({
2825
2934
  center: new Point(20, 20),
@@ -2830,7 +2939,7 @@ var circle = new Path.Circle({
2830
2939
  // Move the circle 100 points to the right
2831
2940
  circle.position.x += 100;
2832
2941
  </script>
2833
- <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>
2834
2943
  </div>
2835
2944
 
2836
2945
 
@@ -2905,6 +3014,7 @@ circle.position.x += 100;
2905
3014
 
2906
3015
  <div class="member-text">
2907
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>
2908
3018
 
2909
3019
 
2910
3020
 
@@ -3193,6 +3303,34 @@ circle.position.x += 100;
3193
3303
 
3194
3304
 
3195
3305
 
3306
+ </div>
3307
+
3308
+ </div>
3309
+ </div>
3310
+
3311
+
3312
+ <div id="scope" class="member">
3313
+ <div class="member-link">
3314
+ <a name="scope" href="#scope"><tt><b>scope</b></tt></a>
3315
+ </div>
3316
+ <div class="member-description hidden">
3317
+
3318
+ <div class="member-text">
3319
+ <p>The scope that this item belongs to, through its project.</p>
3320
+
3321
+ <p>Read only.</p>
3322
+
3323
+
3324
+
3325
+ <ul class="member-list">
3326
+ <h4>Type:</h4>
3327
+ <li>
3328
+ <a href="../classes/PaperScope.html"><tt>PaperScope</tt></a>
3329
+ </li>
3330
+ </ul>
3331
+
3332
+
3333
+
3196
3334
  </div>
3197
3335
 
3198
3336
  </div>
@@ -3327,7 +3465,7 @@ console.log(group.children[0] == path); // true</code></pre>
3327
3465
  <div class="button run">Run</div>
3328
3466
  </div>
3329
3467
 
3330
- <script type="text/paperscript" canvas="canvas-29">
3468
+ <script type="text/paperscript" canvas="canvas-30">
3331
3469
  var path = new Path.Circle({
3332
3470
  center: [80, 50],
3333
3471
  radius: 35
@@ -3340,7 +3478,7 @@ group.addChild(path);
3340
3478
  // Access the path through the group's children array:
3341
3479
  group.children[0].fillColor = 'red';
3342
3480
  </script>
3343
- <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>
3344
3482
  </div>
3345
3483
 
3346
3484
 
@@ -3352,7 +3490,7 @@ group.children[0].fillColor = 'red';
3352
3490
  <div class="button run">Run</div>
3353
3491
  </div>
3354
3492
 
3355
- <script type="text/paperscript" canvas="canvas-30">
3493
+ <script type="text/paperscript" canvas="canvas-31">
3356
3494
  var path = new Path.Circle({
3357
3495
  center: [80, 50],
3358
3496
  radius: 35
@@ -3367,7 +3505,7 @@ group.addChild(path);
3367
3505
  // The path can be accessed by name:
3368
3506
  group.children['example'].fillColor = 'orange';
3369
3507
  </script>
3370
- <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>
3371
3509
  </div>
3372
3510
 
3373
3511
 
@@ -3379,7 +3517,7 @@ group.children['example'].fillColor = 'orange';
3379
3517
  <div class="button run">Run</div>
3380
3518
  </div>
3381
3519
 
3382
- <script type="text/paperscript" canvas="canvas-31">
3520
+ <script type="text/paperscript" canvas="canvas-32">
3383
3521
  var path = new Path.Circle({
3384
3522
  center: [80, 50],
3385
3523
  radius: 35
@@ -3391,7 +3529,7 @@ group.children = [path];
3391
3529
  // The path is the first child of the group:
3392
3530
  group.firstChild.fillColor = 'green';
3393
3531
  </script>
3394
- <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>
3395
3533
  </div>
3396
3534
 
3397
3535
 
@@ -3568,7 +3706,7 @@ group.firstChild.fillColor = 'green';
3568
3706
  <div class="button run">Run</div>
3569
3707
  </div>
3570
3708
 
3571
- <script type="text/paperscript" canvas="canvas-32">
3709
+ <script type="text/paperscript" canvas="canvas-33">
3572
3710
  // Create a circle shaped path at { x: 80, y: 50 }
3573
3711
  // with a radius of 35:
3574
3712
  var circle = new Path.Circle({
@@ -3579,7 +3717,7 @@ var circle = new Path.Circle({
3579
3717
  // Set its stroke color to RGB red:
3580
3718
  circle.strokeColor = new Color(1, 0, 0);
3581
3719
  </script>
3582
- <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>
3583
3721
  </div>
3584
3722
 
3585
3723
 
@@ -3616,7 +3754,7 @@ circle.strokeColor = new Color(1, 0, 0);
3616
3754
  <div class="button run">Run</div>
3617
3755
  </div>
3618
3756
 
3619
- <script type="text/paperscript" canvas="canvas-33">
3757
+ <script type="text/paperscript" canvas="canvas-34">
3620
3758
  // Create a circle shaped path at { x: 80, y: 50 }
3621
3759
  // with a radius of 35:
3622
3760
  var circle = new Path.Circle({
@@ -3628,7 +3766,7 @@ var circle = new Path.Circle({
3628
3766
  // Set its stroke width to 10:
3629
3767
  circle.strokeWidth = 10;
3630
3768
  </script>
3631
- <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>
3632
3770
  </div>
3633
3771
 
3634
3772
 
@@ -3675,7 +3813,7 @@ circle.strokeWidth = 10;
3675
3813
  <div class="button run">Run</div>
3676
3814
  </div>
3677
3815
 
3678
- <script type="text/paperscript" canvas="canvas-34">
3816
+ <script type="text/paperscript" canvas="canvas-35">
3679
3817
  var line = new Path({
3680
3818
  segments: [[80, 50], [420, 50]],
3681
3819
  strokeColor: 'black',
@@ -3696,7 +3834,7 @@ var line2 = line.clone();
3696
3834
  line2.position.y += 100;
3697
3835
  line2.strokeCap = 'butt';
3698
3836
  </script>
3699
- <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>
3700
3838
  </div>
3701
3839
 
3702
3840
 
@@ -3743,7 +3881,7 @@ line2.strokeCap = 'butt';
3743
3881
  <div class="button run">Run</div>
3744
3882
  </div>
3745
3883
 
3746
- <script type="text/paperscript" canvas="canvas-35">
3884
+ <script type="text/paperscript" canvas="canvas-36">
3747
3885
  var path = new Path({
3748
3886
  segments: [[80, 100], [120, 40], [160, 100]],
3749
3887
  strokeColor: 'black',
@@ -3760,7 +3898,7 @@ var path3 = path2.clone();
3760
3898
  path3.position.x += path3.bounds.width * 1.5;
3761
3899
  path3.strokeJoin = 'bevel';
3762
3900
  </script>
3763
- <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>
3764
3902
  </div>
3765
3903
 
3766
3904
 
@@ -3808,7 +3946,7 @@ path3.strokeJoin = 'bevel';
3808
3946
  <div class="member-description hidden">
3809
3947
 
3810
3948
  <div class="member-text">
3811
- <p>Specifies whether the stroke is to be drawn taking the current affine transformation into account (the default behavior), or whether it should appear as a non-scaling stroke.</p>
3949
+ <p>Specifies whether the stroke is to be drawn taking the current affine transformation into account (the default behavior), or whether it should appear as a non-scaling stroke. On text, non-scaling strokes are exact for uniform scaling only, as the glyphs are always stroked through the transformation.</p>
3812
3950
 
3813
3951
 
3814
3952
 
@@ -3864,7 +4002,7 @@ path3.strokeJoin = 'bevel';
3864
4002
  <div class="button run">Run</div>
3865
4003
  </div>
3866
4004
 
3867
- <script type="text/paperscript" canvas="canvas-36">
4005
+ <script type="text/paperscript" canvas="canvas-37">
3868
4006
  var path = new Path.Circle({
3869
4007
  center: [80, 50],
3870
4008
  radius: 40,
@@ -3875,7 +4013,7 @@ var path = new Path.Circle({
3875
4013
  // Set the dashed stroke to [10pt dash, 4pt gap]:
3876
4014
  path.dashArray = [10, 4];
3877
4015
  </script>
3878
- <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>
3879
4017
  </div>
3880
4018
 
3881
4019
 
@@ -3945,7 +4083,7 @@ path.dashArray = [10, 4];
3945
4083
  <div class="button run">Run</div>
3946
4084
  </div>
3947
4085
 
3948
- <script type="text/paperscript" canvas="canvas-37">
4086
+ <script type="text/paperscript" canvas="canvas-38">
3949
4087
  // Create a circle shaped path at { x: 80, y: 50 }
3950
4088
  // with a radius of 35:
3951
4089
  var circle = new Path.Circle({
@@ -3956,7 +4094,7 @@ var circle = new Path.Circle({
3956
4094
  // Set the fill color of the circle to RGB red:
3957
4095
  circle.fillColor = new Color(1, 0, 0);
3958
4096
  </script>
3959
- <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>
3960
4098
  </div>
3961
4099
 
3962
4100
 
@@ -4031,7 +4169,7 @@ circle.fillColor = new Color(1, 0, 0);
4031
4169
  <div class="button run">Run</div>
4032
4170
  </div>
4033
4171
 
4034
- <script type="text/paperscript" canvas="canvas-38">
4172
+ <script type="text/paperscript" canvas="canvas-39">
4035
4173
  var circle = new Path.Circle({
4036
4174
  center: [80, 50],
4037
4175
  radius: 35,
@@ -4044,7 +4182,7 @@ var circle = new Path.Circle({
4044
4182
  shadowOffset: new Point(5, 5)
4045
4183
  });
4046
4184
  </script>
4047
- <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>
4048
4186
  </div>
4049
4187
 
4050
4188
 
@@ -4185,7 +4323,7 @@ var circle = new Path.Circle({
4185
4323
  <div class="button run">Run</div>
4186
4324
  </div>
4187
4325
 
4188
- <script type="text/paperscript" canvas="canvas-39">
4326
+ <script type="text/paperscript" canvas="canvas-40">
4189
4327
  // Create a rectangle shaped path with its top left point at:
4190
4328
  // {x: 50, y: 25} and a size of {width: 50, height: 50}
4191
4329
  var path = new Path.Rectangle(new Point(50, 25), new Size(50, 50));
@@ -4196,7 +4334,7 @@ path.onFrame = function(event) {
4196
4334
  this.rotate(3);
4197
4335
  }
4198
4336
  </script>
4199
- <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>
4200
4338
  </div>
4201
4339
 
4202
4340
 
@@ -4240,7 +4378,7 @@ path.onFrame = function(event) {
4240
4378
  <div class="button run">Run</div>
4241
4379
  </div>
4242
4380
 
4243
- <script type="text/paperscript" canvas="canvas-40">
4381
+ <script type="text/paperscript" canvas="canvas-41">
4244
4382
  // Create a circle shaped path at the center of the view:
4245
4383
  var path = new Path.Circle({
4246
4384
  center: view.center,
@@ -4254,7 +4392,7 @@ path.onMouseDown = function(event) {
4254
4392
  this.fillColor = 'red';
4255
4393
  }
4256
4394
  </script>
4257
- <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>
4258
4396
  </div>
4259
4397
 
4260
4398
 
@@ -4266,7 +4404,7 @@ path.onMouseDown = function(event) {
4266
4404
  <div class="button run">Run</div>
4267
4405
  </div>
4268
4406
 
4269
- <script type="text/paperscript" canvas="canvas-41">
4407
+ <script type="text/paperscript" canvas="canvas-42">
4270
4408
  // Loop 30 times:
4271
4409
  for (var i = 0; i < 30; i++) {
4272
4410
  // Create a circle shaped path at a random position
@@ -4284,7 +4422,7 @@ for (var i = 0; i < 30; i++) {
4284
4422
  }
4285
4423
  }
4286
4424
  </script>
4287
- <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>
4288
4426
  </div>
4289
4427
 
4290
4428
 
@@ -4328,7 +4466,7 @@ for (var i = 0; i < 30; i++) {
4328
4466
  <div class="button run">Run</div>
4329
4467
  </div>
4330
4468
 
4331
- <script type="text/paperscript" canvas="canvas-42">
4469
+ <script type="text/paperscript" canvas="canvas-43">
4332
4470
  // Create a circle shaped path at the center of the view:
4333
4471
  var path = new Path.Circle({
4334
4472
  center: view.center,
@@ -4341,7 +4479,7 @@ path.onMouseDrag = function(event) {
4341
4479
  path.position += event.delta;
4342
4480
  }
4343
4481
  </script>
4344
- <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>
4345
4483
  </div>
4346
4484
 
4347
4485
 
@@ -4385,7 +4523,7 @@ path.onMouseDrag = function(event) {
4385
4523
  <div class="button run">Run</div>
4386
4524
  </div>
4387
4525
 
4388
- <script type="text/paperscript" canvas="canvas-43">
4526
+ <script type="text/paperscript" canvas="canvas-44">
4389
4527
  // Create a circle shaped path at the center of the view:
4390
4528
  var path = new Path.Circle({
4391
4529
  center: view.center,
@@ -4399,7 +4537,7 @@ path.onMouseUp = function(event) {
4399
4537
  this.fillColor = 'red';
4400
4538
  }
4401
4539
  </script>
4402
- <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>
4403
4541
  </div>
4404
4542
 
4405
4543
 
@@ -4443,7 +4581,7 @@ path.onMouseUp = function(event) {
4443
4581
  <div class="button run">Run</div>
4444
4582
  </div>
4445
4583
 
4446
- <script type="text/paperscript" canvas="canvas-44">
4584
+ <script type="text/paperscript" canvas="canvas-45">
4447
4585
  // Create a circle shaped path at the center of the view:
4448
4586
  var path = new Path.Circle({
4449
4587
  center: view.center,
@@ -4457,7 +4595,7 @@ path.onClick = function(event) {
4457
4595
  this.fillColor = 'red';
4458
4596
  }
4459
4597
  </script>
4460
- <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>
4461
4599
  </div>
4462
4600
 
4463
4601
 
@@ -4469,7 +4607,7 @@ path.onClick = function(event) {
4469
4607
  <div class="button run">Run</div>
4470
4608
  </div>
4471
4609
 
4472
- <script type="text/paperscript" canvas="canvas-45">
4610
+ <script type="text/paperscript" canvas="canvas-46">
4473
4611
  // Loop 30 times:
4474
4612
  for (var i = 0; i < 30; i++) {
4475
4613
  // Create a circle shaped path at a random position
@@ -4487,7 +4625,7 @@ for (var i = 0; i < 30; i++) {
4487
4625
  }
4488
4626
  }
4489
4627
  </script>
4490
- <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>
4491
4629
  </div>
4492
4630
 
4493
4631
 
@@ -4531,7 +4669,7 @@ for (var i = 0; i < 30; i++) {
4531
4669
  <div class="button run">Run</div>
4532
4670
  </div>
4533
4671
 
4534
- <script type="text/paperscript" canvas="canvas-46">
4672
+ <script type="text/paperscript" canvas="canvas-47">
4535
4673
  // Create a circle shaped path at the center of the view:
4536
4674
  var path = new Path.Circle({
4537
4675
  center: view.center,
@@ -4545,7 +4683,7 @@ path.onDoubleClick = function(event) {
4545
4683
  this.fillColor = 'red';
4546
4684
  }
4547
4685
  </script>
4548
- <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>
4549
4687
  </div>
4550
4688
 
4551
4689
 
@@ -4557,7 +4695,7 @@ path.onDoubleClick = function(event) {
4557
4695
  <div class="button run">Run</div>
4558
4696
  </div>
4559
4697
 
4560
- <script type="text/paperscript" canvas="canvas-47">
4698
+ <script type="text/paperscript" canvas="canvas-48">
4561
4699
  // Loop 30 times:
4562
4700
  for (var i = 0; i < 30; i++) {
4563
4701
  // Create a circle shaped path at a random position
@@ -4575,7 +4713,7 @@ for (var i = 0; i < 30; i++) {
4575
4713
  }
4576
4714
  }
4577
4715
  </script>
4578
- <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>
4579
4717
  </div>
4580
4718
 
4581
4719
 
@@ -4619,7 +4757,7 @@ for (var i = 0; i < 30; i++) {
4619
4757
  <div class="button run">Run</div>
4620
4758
  </div>
4621
4759
 
4622
- <script type="text/paperscript" canvas="canvas-48">
4760
+ <script type="text/paperscript" canvas="canvas-49">
4623
4761
  // Create a circle shaped path at the center of the view:
4624
4762
  var path = new Path.Circle({
4625
4763
  center: view.center,
@@ -4633,7 +4771,7 @@ path.onMouseMove = function(event) {
4633
4771
  this.opacity = Math.random();
4634
4772
  }
4635
4773
  </script>
4636
- <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>
4637
4775
  </div>
4638
4776
 
4639
4777
 
@@ -4677,7 +4815,7 @@ path.onMouseMove = function(event) {
4677
4815
  <div class="button run">Run</div>
4678
4816
  </div>
4679
4817
 
4680
- <script type="text/paperscript" canvas="canvas-49">
4818
+ <script type="text/paperscript" canvas="canvas-50">
4681
4819
  // Create a circle shaped path at the center of the view:
4682
4820
  var path = new Path.Circle({
4683
4821
  center: view.center,
@@ -4695,7 +4833,7 @@ path.onMouseLeave = function(event) {
4695
4833
  this.fillColor = 'black';
4696
4834
  }
4697
4835
  </script>
4698
- <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>
4699
4837
  </div>
4700
4838
 
4701
4839
 
@@ -4707,7 +4845,7 @@ path.onMouseLeave = function(event) {
4707
4845
  <div class="button run">Run</div>
4708
4846
  </div>
4709
4847
 
4710
- <script type="text/paperscript" canvas="canvas-50">
4848
+ <script type="text/paperscript" canvas="canvas-51">
4711
4849
  function enter(event) {
4712
4850
  this.fillColor = 'red';
4713
4851
  }
@@ -4729,7 +4867,7 @@ function onMouseDown(event) {
4729
4867
  path.onMouseLeave = leave;
4730
4868
  }
4731
4869
  </script>
4732
- <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>
4733
4871
  </div>
4734
4872
 
4735
4873
 
@@ -4773,7 +4911,7 @@ function onMouseDown(event) {
4773
4911
  <div class="button run">Run</div>
4774
4912
  </div>
4775
4913
 
4776
- <script type="text/paperscript" canvas="canvas-51">
4914
+ <script type="text/paperscript" canvas="canvas-52">
4777
4915
  // Create a circle shaped path at the center of the view:
4778
4916
  var path = new Path.Circle({
4779
4917
  center: view.center,
@@ -4786,7 +4924,7 @@ path.onMouseLeave = function(event) {
4786
4924
  this.fillColor = 'red';
4787
4925
  }
4788
4926
  </script>
4789
- <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>
4790
4928
  </div>
4791
4929
 
4792
4930
 
@@ -4845,7 +4983,7 @@ path.onMouseLeave = function(event) {
4845
4983
  <div class="button run">Run</div>
4846
4984
  </div>
4847
4985
 
4848
- <script type="text/paperscript" canvas="canvas-52">
4986
+ <script type="text/paperscript" canvas="canvas-53">
4849
4987
  var circle = new Path.Circle({
4850
4988
  center: [80, 50],
4851
4989
  radius: 35
@@ -4858,7 +4996,7 @@ circle.set({
4858
4996
  selected: true
4859
4997
  });
4860
4998
  </script>
4861
- <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>
4862
5000
  </div>
4863
5001
 
4864
5002
 
@@ -4914,7 +5052,7 @@ circle.set({
4914
5052
  <div class="button run">Run</div>
4915
5053
  </div>
4916
5054
 
4917
- <script type="text/paperscript" canvas="canvas-53">
5055
+ <script type="text/paperscript" canvas="canvas-54">
4918
5056
  var circle = new Path.Circle({
4919
5057
  center: [50, 50],
4920
5058
  radius: 10,
@@ -4929,7 +5067,7 @@ for (var i = 0; i < 20; i++) {
4929
5067
  copy.position.x += i * copy.bounds.width;
4930
5068
  }
4931
5069
  </script>
4932
- <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>
4933
5071
  </div>
4934
5072
 
4935
5073
 
@@ -5016,9 +5154,9 @@ for (var i = 0; i < 20; i++) {
5016
5154
  <p>Rasterizes the item into a newly created Raster object. The item itself is not removed after rasterization.</p>
5017
5155
  <ul class="member-list">
5018
5156
  <h4>Options:</h4>
5019
- <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>
5020
- <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>
5021
- <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>
5022
5160
  </ul>
5023
5161
 
5024
5162
  <ul class="member-list">
@@ -5055,7 +5193,7 @@ for (var i = 0; i < 20; i++) {
5055
5193
  <div class="button run">Run</div>
5056
5194
  </div>
5057
5195
 
5058
- <script type="text/paperscript" canvas="canvas-54">
5196
+ <script type="text/paperscript" canvas="canvas-55">
5059
5197
  var circle = new Path.Circle({
5060
5198
  center: [50, 50],
5061
5199
  radius: 5,
@@ -5072,7 +5210,7 @@ raster.position.x += 100;
5072
5210
  circle.scale(5);
5073
5211
  raster.scale(5);
5074
5212
  </script>
5075
- <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>
5076
5214
  </div>
5077
5215
 
5078
5216
 
@@ -5126,7 +5264,7 @@ raster.scale(5);
5126
5264
  <div class="button run">Run</div>
5127
5265
  </div>
5128
5266
 
5129
- <script type="text/paperscript" canvas="canvas-55">
5267
+ <script type="text/paperscript" canvas="canvas-56">
5130
5268
  var path = new Path.Star({
5131
5269
  center: [50, 50],
5132
5270
  points: 12,
@@ -5147,7 +5285,7 @@ function onMouseDown(event) {
5147
5285
  }
5148
5286
  }
5149
5287
  </script>
5150
- <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>
5151
5289
  </div>
5152
5290
 
5153
5291
 
@@ -5203,7 +5341,7 @@ function onMouseDown(event) {
5203
5341
  </div>
5204
5342
  <div class="member-description hidden">
5205
5343
  <div class="member-text">
5206
-
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>
5207
5345
 
5208
5346
 
5209
5347
  <ul class="member-list">
@@ -5223,7 +5361,7 @@ function onMouseDown(event) {
5223
5361
  <h4>Returns:</h4>
5224
5362
 
5225
5363
  <li>
5226
- <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
5227
5365
  </li>
5228
5366
 
5229
5367
 
@@ -5719,6 +5857,7 @@ function onMouseDown(event) {
5719
5857
  <div class="member-text">
5720
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>
5721
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>
5722
5861
  <ul class="member-list">
5723
5862
  <h4>Options:</h4>
5724
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>
@@ -6272,11 +6411,11 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
6272
6411
 
6273
6412
  <div id="replacewith-item" class="member">
6274
6413
  <div class="member-link">
6275
- <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>
6276
6415
  </div>
6277
6416
  <div class="member-description hidden">
6278
6417
  <div class="member-text">
6279
- <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>
6280
6419
 
6281
6420
 
6282
6421
  <ul class="member-list">
@@ -6285,7 +6424,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
6285
6424
  <li>
6286
6425
  <tt>item:</tt>
6287
6426
  <a href="../classes/Item.html"><tt>Item</tt></a>
6288
- &mdash;&nbsp;the item that will replace this item
6427
+ &mdash;&nbsp;the items that will replace this item
6289
6428
 
6290
6429
  </li>
6291
6430
 
@@ -6458,7 +6597,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
6458
6597
  </div>
6459
6598
  <div class="member-description hidden">
6460
6599
  <div class="member-text">
6461
- <p>Checks whether the item has a fill.</p>
6600
+ <p>Checks whether the item has a visible fill, a fill color with an alpha above 0. Hit-tests also hit transparent fills, see <a href="../classes/Item.html#hittest"><tt>hitTest</tt></a>.</p>
6462
6601
 
6463
6602
 
6464
6603
 
@@ -6466,7 +6605,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
6466
6605
  <h4>Returns:</h4>
6467
6606
 
6468
6607
  <li>
6469
- <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the item has a fill, <tt>false</tt> otherwise
6608
+ <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the item has a visible fill, <tt>false</tt> otherwise
6470
6609
  </li>
6471
6610
 
6472
6611
 
@@ -7008,7 +7147,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
7008
7147
  <div class="button run">Run</div>
7009
7148
  </div>
7010
7149
 
7011
- <script type="text/paperscript" canvas="canvas-56">
7150
+ <script type="text/paperscript" canvas="canvas-57">
7012
7151
  // Create a rectangle shaped path with its top left
7013
7152
  // point at {x: 80, y: 25} and a size of {width: 50, height: 50}:
7014
7153
  var path = new Path.Rectangle(new Point(80, 25), new Size(50, 50));
@@ -7017,7 +7156,7 @@ path.fillColor = 'black';
7017
7156
  // Rotate the path by 30 degrees:
7018
7157
  path.rotate(30);
7019
7158
  </script>
7020
- <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>
7021
7160
  </div>
7022
7161
 
7023
7162
 
@@ -7029,7 +7168,7 @@ path.rotate(30);
7029
7168
  <div class="button run">Run</div>
7030
7169
  </div>
7031
7170
 
7032
- <script type="text/paperscript" canvas="canvas-57">
7171
+ <script type="text/paperscript" canvas="canvas-58">
7033
7172
  // Create a rectangle shaped path with its top left
7034
7173
  // point at {x: 175, y: 50} and a size of {width: 100, height: 100}:
7035
7174
  var topLeft = new Point(175, 50);
@@ -7051,7 +7190,7 @@ function onFrame(event) {
7051
7190
  path.rotate(3, view.center);
7052
7191
  }
7053
7192
  </script>
7054
- <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>
7055
7194
  </div>
7056
7195
 
7057
7196
 
@@ -7100,7 +7239,7 @@ function onFrame(event) {
7100
7239
  <div class="button run">Run</div>
7101
7240
  </div>
7102
7241
 
7103
- <script type="text/paperscript" canvas="canvas-58">
7242
+ <script type="text/paperscript" canvas="canvas-59">
7104
7243
  // Create a circle shaped path at { x: 80, y: 50 }
7105
7244
  // with a radius of 20:
7106
7245
  var circle = new Path.Circle({
@@ -7112,7 +7251,7 @@ var circle = new Path.Circle({
7112
7251
  // Scale the path by 150% from its center point
7113
7252
  circle.scale(1.5);
7114
7253
  </script>
7115
- <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>
7116
7255
  </div>
7117
7256
 
7118
7257
 
@@ -7124,7 +7263,7 @@ circle.scale(1.5);
7124
7263
  <div class="button run">Run</div>
7125
7264
  </div>
7126
7265
 
7127
- <script type="text/paperscript" canvas="canvas-59">
7266
+ <script type="text/paperscript" canvas="canvas-60">
7128
7267
  // Create a circle shaped path at { x: 80, y: 50 }
7129
7268
  // with a radius of 20:
7130
7269
  var circle = new Path.Circle({
@@ -7136,7 +7275,7 @@ var circle = new Path.Circle({
7136
7275
  // Scale the path 150% from its bottom left corner
7137
7276
  circle.scale(1.5, circle.bounds.bottomLeft);
7138
7277
  </script>
7139
- <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>
7140
7279
  </div>
7141
7280
 
7142
7281
 
@@ -7192,7 +7331,7 @@ circle.scale(1.5, circle.bounds.bottomLeft);
7192
7331
  <div class="button run">Run</div>
7193
7332
  </div>
7194
7333
 
7195
- <script type="text/paperscript" canvas="canvas-60">
7334
+ <script type="text/paperscript" canvas="canvas-61">
7196
7335
  // Create a circle shaped path at { x: 100, y: 50 }
7197
7336
  // with a radius of 20:
7198
7337
  var circle = new Path.Circle({
@@ -7204,7 +7343,7 @@ var circle = new Path.Circle({
7204
7343
  // Scale the path horizontally by 300%
7205
7344
  circle.scale(3, 1);
7206
7345
  </script>
7207
- <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>
7208
7347
  </div>
7209
7348
 
7210
7349
 
@@ -7642,7 +7781,7 @@ circle.scale(3, 1);
7642
7781
  <div class="button run">Run</div>
7643
7782
  </div>
7644
7783
 
7645
- <script type="text/paperscript" canvas="canvas-61">
7784
+ <script type="text/paperscript" canvas="canvas-62">
7646
7785
  // Create a rectangle shaped path with its top left corner
7647
7786
  // at {x: 80, y: 25} and a size of {width: 75, height: 50}:
7648
7787
  var path = new Path.Rectangle({
@@ -7663,7 +7802,7 @@ var circlePath = new Path.Circle({
7663
7802
  // the rectangular path:
7664
7803
  circlePath.fitBounds(path.bounds);
7665
7804
  </script>
7666
- <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>
7667
7806
  </div>
7668
7807
 
7669
7808
 
@@ -7675,7 +7814,7 @@ circlePath.fitBounds(path.bounds);
7675
7814
  <div class="button run">Run</div>
7676
7815
  </div>
7677
7816
 
7678
- <script type="text/paperscript" canvas="canvas-62">
7817
+ <script type="text/paperscript" canvas="canvas-63">
7679
7818
  // Create a rectangle shaped path with its top left corner
7680
7819
  // at {x: 80, y: 25} and a size of {width: 75, height: 50}:
7681
7820
  var path = new Path.Rectangle({
@@ -7696,7 +7835,7 @@ var circlePath = new Path.Circle({
7696
7835
  // the rectangular path:
7697
7836
  circlePath.fitBounds(path.bounds, 'cover');
7698
7837
  </script>
7699
- <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>
7700
7839
  </div>
7701
7840
 
7702
7841
 
@@ -7708,7 +7847,7 @@ circlePath.fitBounds(path.bounds, 'cover');
7708
7847
  <div class="button run">Run</div>
7709
7848
  </div>
7710
7849
 
7711
- <script type="text/paperscript" canvas="canvas-63">
7850
+ <script type="text/paperscript" canvas="canvas-64">
7712
7851
  var path = new Path.Circle({
7713
7852
  center: [80, 50],
7714
7853
  radius: 30,
@@ -7718,7 +7857,7 @@ var path = new Path.Circle({
7718
7857
  // Fit the path to the bounding rectangle of the view:
7719
7858
  path.fitBounds(view.bounds);
7720
7859
  </script>
7721
- <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>
7722
7861
  </div>
7723
7862
 
7724
7863
 
@@ -7779,7 +7918,7 @@ path.fitBounds(view.bounds);
7779
7918
  <div class="button run">Run</div>
7780
7919
  </div>
7781
7920
 
7782
- <script type="text/paperscript" canvas="canvas-64">
7921
+ <script type="text/paperscript" canvas="canvas-65">
7783
7922
  // Create a circle shaped path at the center of the view:
7784
7923
  var path = new Path.Circle({
7785
7924
  center: view.center,
@@ -7797,7 +7936,7 @@ path.on('mouseleave', function() {
7797
7936
  this.fillColor = 'black';
7798
7937
  });
7799
7938
  </script>
7800
- <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>
7801
7940
  </div>
7802
7941
 
7803
7942
 
@@ -7849,7 +7988,7 @@ path.on('mouseleave', function() {
7849
7988
  <div class="button run">Run</div>
7850
7989
  </div>
7851
7990
 
7852
- <script type="text/paperscript" canvas="canvas-65">
7991
+ <script type="text/paperscript" canvas="canvas-66">
7853
7992
  // Create a circle shaped path at the center of the view:
7854
7993
  var path = new Path.Circle({
7855
7994
  center: view.center,
@@ -7867,7 +8006,7 @@ path.on({
7867
8006
  }
7868
8007
  });
7869
8008
  </script>
7870
- <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>
7871
8010
  </div>
7872
8011
 
7873
8012
 
@@ -7879,7 +8018,7 @@ path.on({
7879
8018
  <div class="button run">Run</div>
7880
8019
  </div>
7881
8020
 
7882
- <script type="text/paperscript" canvas="canvas-66">
8021
+ <script type="text/paperscript" canvas="canvas-67">
7883
8022
  var pathHandlers = {
7884
8023
  mouseenter: function(event) {
7885
8024
  this.fillColor = 'red';
@@ -7902,7 +8041,7 @@ function onMouseDown(event) {
7902
8041
  path.on(pathHandlers);
7903
8042
  }
7904
8043
  </script>
7905
- <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>
7906
8045
  </div>
7907
8046
 
7908
8047
 
@@ -8100,10 +8239,10 @@ function onMouseDown(event) {
8100
8239
  <p>Removes the item when the events specified in the passed options object occur.</p>
8101
8240
  <ul class="member-list">
8102
8241
  <h4>Options:</h4>
8103
- <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>
8104
- <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>
8105
- <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>
8106
- <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>
8107
8246
  </ul>
8108
8247
 
8109
8248
  <ul class="member-list">
@@ -8130,7 +8269,7 @@ function onMouseDown(event) {
8130
8269
  <div class="button run">Run</div>
8131
8270
  </div>
8132
8271
 
8133
- <script type="text/paperscript" canvas="canvas-67">
8272
+ <script type="text/paperscript" canvas="canvas-68">
8134
8273
  function onMouseDrag(event) {
8135
8274
  // Create a circle shaped path at the mouse position,
8136
8275
  // with a radius of 10:
@@ -8147,7 +8286,7 @@ function onMouseDrag(event) {
8147
8286
  });
8148
8287
  }
8149
8288
  </script>
8150
- <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>
8151
8290
  </div>
8152
8291
 
8153
8292
 
@@ -8177,7 +8316,7 @@ function onMouseDrag(event) {
8177
8316
  <div class="button run">Run</div>
8178
8317
  </div>
8179
8318
 
8180
- <script type="text/paperscript" canvas="canvas-68">
8319
+ <script type="text/paperscript" canvas="canvas-69">
8181
8320
  function onMouseMove(event) {
8182
8321
  // Create a circle shaped path at the mouse position,
8183
8322
  // with a radius of 10:
@@ -8191,7 +8330,7 @@ function onMouseMove(event) {
8191
8330
  path.removeOnMove();
8192
8331
  }
8193
8332
  </script>
8194
- <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>
8195
8334
  </div>
8196
8335
 
8197
8336
 
@@ -8221,7 +8360,7 @@ function onMouseMove(event) {
8221
8360
  <div class="button run">Run</div>
8222
8361
  </div>
8223
8362
 
8224
- <script type="text/paperscript" canvas="canvas-69">
8363
+ <script type="text/paperscript" canvas="canvas-70">
8225
8364
  function onMouseDown(event) {
8226
8365
  // Create a circle shaped path at the mouse position,
8227
8366
  // with a radius of 10:
@@ -8235,7 +8374,7 @@ function onMouseDown(event) {
8235
8374
  path.removeOnDown();
8236
8375
  }
8237
8376
  </script>
8238
- <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>
8239
8378
  </div>
8240
8379
 
8241
8380
 
@@ -8265,7 +8404,7 @@ function onMouseDown(event) {
8265
8404
  <div class="button run">Run</div>
8266
8405
  </div>
8267
8406
 
8268
- <script type="text/paperscript" canvas="canvas-70">
8407
+ <script type="text/paperscript" canvas="canvas-71">
8269
8408
  function onMouseDrag(event) {
8270
8409
  // Create a circle shaped path at the mouse position,
8271
8410
  // with a radius of 10:
@@ -8279,7 +8418,7 @@ function onMouseDrag(event) {
8279
8418
  path.removeOnDrag();
8280
8419
  }
8281
8420
  </script>
8282
- <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>
8283
8422
  </div>
8284
8423
 
8285
8424
 
@@ -8309,7 +8448,7 @@ function onMouseDrag(event) {
8309
8448
  <div class="button run">Run</div>
8310
8449
  </div>
8311
8450
 
8312
- <script type="text/paperscript" canvas="canvas-71">
8451
+ <script type="text/paperscript" canvas="canvas-72">
8313
8452
  function onMouseDown(event) {
8314
8453
  // Create a circle shaped path at the mouse position,
8315
8454
  // with a radius of 10:
@@ -8323,7 +8462,7 @@ function onMouseDown(event) {
8323
8462
  path.removeOnUp();
8324
8463
  }
8325
8464
  </script>
8326
- <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>
8327
8466
  </div>
8328
8467
 
8329
8468
 
@@ -8396,7 +8535,7 @@ function onMouseDown(event) {
8396
8535
  <div class="button run">Run</div>
8397
8536
  </div>
8398
8537
 
8399
- <script type="text/paperscript" canvas="canvas-72">
8538
+ <script type="text/paperscript" canvas="canvas-73">
8400
8539
  var path = new Path.Circle({
8401
8540
  radius: view.bounds.height * 0.4,
8402
8541
  center: view.center
@@ -8407,7 +8546,7 @@ path.tween(
8407
8546
  3000
8408
8547
  );
8409
8548
  </script>
8410
- <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>
8411
8550
  </div>
8412
8551
 
8413
8552
 
@@ -8419,7 +8558,7 @@ path.tween(
8419
8558
  <div class="button run">Run</div>
8420
8559
  </div>
8421
8560
 
8422
- <script type="text/paperscript" canvas="canvas-73">
8561
+ <script type="text/paperscript" canvas="canvas-74">
8423
8562
  var path = new Shape.Rectangle({
8424
8563
  fillColor: 'red',
8425
8564
  center: [50, view.center.y],
@@ -8434,7 +8573,7 @@ path.tween({
8434
8573
  duration: 2000
8435
8574
  });
8436
8575
  </script>
8437
- <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>
8438
8577
  </div>
8439
8578
 
8440
8579
 
@@ -8500,7 +8639,7 @@ path.tween({
8500
8639
  <div class="button run">Run</div>
8501
8640
  </div>
8502
8641
 
8503
- <script type="text/paperscript" canvas="canvas-74">
8642
+ <script type="text/paperscript" canvas="canvas-75">
8504
8643
  var path = new Path.Rectangle({
8505
8644
  size: [100, 100],
8506
8645
  position: view.center,
@@ -8514,7 +8653,7 @@ path.tween({
8514
8653
  'segments[2].point.x': '-= 50'
8515
8654
  }, 3000);
8516
8655
  </script>
8517
- <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>
8518
8657
  </div>
8519
8658
 
8520
8659
 
@@ -8573,7 +8712,7 @@ path.tween({
8573
8712
  <div class="button run">Run</div>
8574
8713
  </div>
8575
8714
 
8576
- <script type="text/paperscript" canvas="canvas-75">
8715
+ <script type="text/paperscript" canvas="canvas-76">
8577
8716
  var path = new Path.Circle({
8578
8717
  fillColor: 'blue',
8579
8718
  radius: view.bounds.height * 0.4,
@@ -8589,7 +8728,7 @@ path.tween(2000).onUpdate = function(event) {
8589
8728
  path.interpolate(pathFrom, pathTo, event.factor)
8590
8729
  };
8591
8730
  </script>
8592
- <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>
8593
8732
  </div>
8594
8733
 
8595
8734
 
@@ -8710,7 +8849,7 @@ path.tween(2000).onUpdate = function(event) {
8710
8849
  <div class="button run">Run</div>
8711
8850
  </div>
8712
8851
 
8713
- <script type="text/paperscript" canvas="canvas-76">
8852
+ <script type="text/paperscript" canvas="canvas-77">
8714
8853
  var path = new Path.Circle({
8715
8854
  fillColor: 'blue',
8716
8855
  radius: view.bounds.height * 0.4,
@@ -8718,7 +8857,7 @@ var path = new Path.Circle({
8718
8857
  });
8719
8858
  path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
8720
8859
  </script>
8721
- <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>
8722
8861
  </div>
8723
8862
 
8724
8863
 
@@ -8732,7 +8871,7 @@ path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
8732
8871
 
8733
8872
  <!-- =========================== copyright notice ========================== -->
8734
8873
  <p class="footer">
8735
- Paper.js v0.13.0<br>
8874
+ Paper.js v0.15.0<br>
8736
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>
8737
8876
  <div class="content-end"></div>
8738
8877