paper 0.12.19 → 0.13.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.
- package/CHANGELOG.md +250 -0
- package/README.md +34 -27
- package/dist/docs/assets/js/paper.js +791 -366
- package/dist/docs/classes/Color.html +63 -47
- package/dist/docs/classes/CompoundPath.html +162 -59
- package/dist/docs/classes/Curve.html +9 -7
- package/dist/docs/classes/CurveLocation.html +1 -1
- package/dist/docs/classes/Event.html +1 -1
- package/dist/docs/classes/Gradient.html +1 -1
- package/dist/docs/classes/GradientStop.html +1 -1
- package/dist/docs/classes/Group.html +63 -24
- package/dist/docs/classes/HitResult.html +1 -1
- package/dist/docs/classes/Item.html +63 -24
- package/dist/docs/classes/Key.html +1 -1
- package/dist/docs/classes/KeyEvent.html +1 -1
- package/dist/docs/classes/Layer.html +63 -24
- package/dist/docs/classes/Matrix.html +1 -1
- package/dist/docs/classes/MouseEvent.html +1 -1
- package/dist/docs/classes/PaperScope.html +87 -1
- package/dist/docs/classes/PaperScript.html +1 -1
- package/dist/docs/classes/Path.html +174 -68
- package/dist/docs/classes/PathItem.html +280 -177
- package/dist/docs/classes/Point.html +143 -21
- package/dist/docs/classes/PointText.html +94 -24
- package/dist/docs/classes/Project.html +14 -8
- package/dist/docs/classes/Raster.html +93 -35
- package/dist/docs/classes/Rectangle.html +12 -11
- package/dist/docs/classes/Segment.html +1 -1
- package/dist/docs/classes/Shape.html +63 -24
- package/dist/docs/classes/Size.html +81 -21
- package/dist/docs/classes/Style.html +34 -2
- package/dist/docs/classes/SymbolDefinition.html +1 -1
- package/dist/docs/classes/SymbolItem.html +64 -25
- package/dist/docs/classes/TextItem.html +94 -24
- package/dist/docs/classes/Tool.html +2 -1
- package/dist/docs/classes/ToolEvent.html +27 -1
- package/dist/docs/classes/Tween.html +1 -1
- package/dist/docs/classes/View.html +203 -10
- package/dist/docs/classes/global.html +1 -1
- package/dist/docs/classes/index.html +2 -2
- package/dist/docs/index.html +1 -1
- package/dist/node/canvas.js +10 -8
- package/dist/node/self.js +13 -4
- package/dist/paper-core.js +772 -355
- package/dist/paper-core.min.js +3 -3
- package/dist/paper-full.js +791 -366
- package/dist/paper-full.min.js +3 -3
- package/dist/paper.d.ts +324 -73
- package/examples/Rasters/Smoothing.html +1 -1
- package/package.json +5 -11
- package/dist/node/xml.js +0 -40
|
@@ -176,7 +176,23 @@
|
|
|
176
176
|
|
|
177
177
|
|
|
178
178
|
|
|
179
|
-
|
|
179
|
+
<h4>Example:</h4>
|
|
180
|
+
|
|
181
|
+
<div class="paperscript split">
|
|
182
|
+
|
|
183
|
+
<div class="buttons">
|
|
184
|
+
<div class="button run">Run</div>
|
|
185
|
+
</div>
|
|
186
|
+
|
|
187
|
+
<script type="text/paperscript" canvas="canvas-0">
|
|
188
|
+
var result = new Path.RegularPolygon([50, 50], 3, 40)
|
|
189
|
+
.unite(new Path.Circle([50, 50], 25));
|
|
190
|
+
result.fillColor = 'red';
|
|
191
|
+
</script>
|
|
192
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-0"></canvas></div>
|
|
193
|
+
</div>
|
|
194
|
+
|
|
195
|
+
|
|
180
196
|
</div>
|
|
181
197
|
</div>
|
|
182
198
|
</div>
|
|
@@ -228,7 +244,23 @@
|
|
|
228
244
|
|
|
229
245
|
|
|
230
246
|
|
|
231
|
-
|
|
247
|
+
<h4>Example:</h4>
|
|
248
|
+
|
|
249
|
+
<div class="paperscript split">
|
|
250
|
+
|
|
251
|
+
<div class="buttons">
|
|
252
|
+
<div class="button run">Run</div>
|
|
253
|
+
</div>
|
|
254
|
+
|
|
255
|
+
<script type="text/paperscript" canvas="canvas-1">
|
|
256
|
+
var result = new Path.RegularPolygon([50, 50], 3, 40)
|
|
257
|
+
.intersect(new Path.Circle([50, 50], 25));
|
|
258
|
+
result.fillColor = 'red';
|
|
259
|
+
</script>
|
|
260
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-1"></canvas></div>
|
|
261
|
+
</div>
|
|
262
|
+
|
|
263
|
+
|
|
232
264
|
</div>
|
|
233
265
|
</div>
|
|
234
266
|
</div>
|
|
@@ -280,7 +312,23 @@
|
|
|
280
312
|
|
|
281
313
|
|
|
282
314
|
|
|
283
|
-
|
|
315
|
+
<h4>Example:</h4>
|
|
316
|
+
|
|
317
|
+
<div class="paperscript split">
|
|
318
|
+
|
|
319
|
+
<div class="buttons">
|
|
320
|
+
<div class="button run">Run</div>
|
|
321
|
+
</div>
|
|
322
|
+
|
|
323
|
+
<script type="text/paperscript" canvas="canvas-2">
|
|
324
|
+
var result = new Path.RegularPolygon([50, 50], 3, 40)
|
|
325
|
+
.subtract(new Path.Circle([50, 50], 25));
|
|
326
|
+
result.fillColor = 'red';
|
|
327
|
+
</script>
|
|
328
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-2"></canvas></div>
|
|
329
|
+
</div>
|
|
330
|
+
|
|
331
|
+
|
|
284
332
|
</div>
|
|
285
333
|
</div>
|
|
286
334
|
</div>
|
|
@@ -331,7 +379,23 @@
|
|
|
331
379
|
|
|
332
380
|
|
|
333
381
|
|
|
334
|
-
|
|
382
|
+
<h4>Example:</h4>
|
|
383
|
+
|
|
384
|
+
<div class="paperscript split">
|
|
385
|
+
|
|
386
|
+
<div class="buttons">
|
|
387
|
+
<div class="button run">Run</div>
|
|
388
|
+
</div>
|
|
389
|
+
|
|
390
|
+
<script type="text/paperscript" canvas="canvas-3">
|
|
391
|
+
var result = new Path.RegularPolygon([50, 50], 3, 40)
|
|
392
|
+
.exclude(new Path.Circle([50, 50], 25));
|
|
393
|
+
result.fillColor = 'red';
|
|
394
|
+
</script>
|
|
395
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-3"></canvas></div>
|
|
396
|
+
</div>
|
|
397
|
+
|
|
398
|
+
|
|
335
399
|
</div>
|
|
336
400
|
</div>
|
|
337
401
|
</div>
|
|
@@ -439,9 +503,9 @@
|
|
|
439
503
|
|
|
440
504
|
<h3>Path Intersections and Locations</h3>
|
|
441
505
|
|
|
442
|
-
<div id="getintersections
|
|
506
|
+
<div id="getintersections" class="member">
|
|
443
507
|
<div class="member-link">
|
|
444
|
-
<a name="getintersections
|
|
508
|
+
<a name="getintersections" href="#getintersections"><tt><b>getIntersections</b>([path[, include]])</tt></a>
|
|
445
509
|
</div>
|
|
446
510
|
<div class="member-description hidden">
|
|
447
511
|
<div class="member-text">
|
|
@@ -455,7 +519,7 @@
|
|
|
455
519
|
<tt>path:</tt>
|
|
456
520
|
<a href="../classes/PathItem.html"><tt>PathItem</tt></a>
|
|
457
521
|
— the other item to find the intersections with
|
|
458
|
-
|
|
522
|
+
— optional
|
|
459
523
|
</li>
|
|
460
524
|
|
|
461
525
|
<li>
|
|
@@ -496,7 +560,7 @@
|
|
|
496
560
|
<div class="button run">Run</div>
|
|
497
561
|
</div>
|
|
498
562
|
|
|
499
|
-
<script type="text/paperscript" canvas="canvas-
|
|
563
|
+
<script type="text/paperscript" canvas="canvas-4">
|
|
500
564
|
var path = new Path.Rectangle(new Point(30, 25), new Size(50, 50));
|
|
501
565
|
path.strokeColor = 'black';
|
|
502
566
|
|
|
@@ -519,7 +583,7 @@ function onFrame(event) {
|
|
|
519
583
|
}
|
|
520
584
|
}
|
|
521
585
|
</script>
|
|
522
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
586
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-4"></canvas></div>
|
|
523
587
|
</div>
|
|
524
588
|
|
|
525
589
|
|
|
@@ -660,7 +724,7 @@ function onFrame(event) {
|
|
|
660
724
|
<div class="button run">Run</div>
|
|
661
725
|
</div>
|
|
662
726
|
|
|
663
|
-
<script type="text/paperscript" canvas="canvas-
|
|
727
|
+
<script type="text/paperscript" canvas="canvas-5">
|
|
664
728
|
var star = new Path.Star({
|
|
665
729
|
center: view.center,
|
|
666
730
|
points: 10,
|
|
@@ -684,7 +748,7 @@ function onMouseMove(event) {
|
|
|
684
748
|
circle.position = nearestPoint;
|
|
685
749
|
}
|
|
686
750
|
</script>
|
|
687
|
-
<div class="canvas"><canvas width="516" height="200" id="canvas-
|
|
751
|
+
<div class="canvas"><canvas width="516" height="200" id="canvas-5"></canvas></div>
|
|
688
752
|
</div>
|
|
689
753
|
|
|
690
754
|
|
|
@@ -747,7 +811,7 @@ function onMouseMove(event) {
|
|
|
747
811
|
<div class="button run">Run</div>
|
|
748
812
|
</div>
|
|
749
813
|
|
|
750
|
-
<script type="text/paperscript" canvas="canvas-
|
|
814
|
+
<script type="text/paperscript" canvas="canvas-6">
|
|
751
815
|
// Create a circle shaped path at { x: 80, y: 50 }
|
|
752
816
|
// with a radius of 35:
|
|
753
817
|
var path = new Path.Circle({
|
|
@@ -765,7 +829,7 @@ copy.position.x += 150;
|
|
|
765
829
|
// Flatten the copied path, with a maximum error of 4 points:
|
|
766
830
|
copy.flatten(4);
|
|
767
831
|
</script>
|
|
768
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
832
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-6"></canvas></div>
|
|
769
833
|
</div>
|
|
770
834
|
|
|
771
835
|
|
|
@@ -843,7 +907,7 @@ copy.flatten(4);
|
|
|
843
907
|
<div class="button run">Run</div>
|
|
844
908
|
</div>
|
|
845
909
|
|
|
846
|
-
<script type="text/paperscript" canvas="canvas-
|
|
910
|
+
<script type="text/paperscript" canvas="canvas-7">
|
|
847
911
|
// Create a rectangular path with its top-left point at
|
|
848
912
|
// {x: 30, y: 25} and a size of {width: 50, height: 50}:
|
|
849
913
|
var path = new Path.Rectangle({
|
|
@@ -862,7 +926,7 @@ copy.position.x += 100;
|
|
|
862
926
|
// Smooth the segments of the copy:
|
|
863
927
|
copy.smooth({ type: 'continuous' });
|
|
864
928
|
</script>
|
|
865
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
929
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-7"></canvas></div>
|
|
866
930
|
</div>
|
|
867
931
|
|
|
868
932
|
|
|
@@ -874,7 +938,7 @@ copy.smooth({ type: 'continuous' });
|
|
|
874
938
|
<div class="button run">Run</div>
|
|
875
939
|
</div>
|
|
876
940
|
|
|
877
|
-
<script type="text/paperscript" canvas="canvas-
|
|
941
|
+
<script type="text/paperscript" canvas="canvas-8">
|
|
878
942
|
var path = new Path();
|
|
879
943
|
path.strokeColor = 'black';
|
|
880
944
|
|
|
@@ -899,7 +963,7 @@ copy.fullySelected = true;
|
|
|
899
963
|
// Smooth the path using centripetal Catmull-Rom splines:
|
|
900
964
|
copy.smooth({ type: 'catmull-rom', factor: 0.5 });
|
|
901
965
|
</script>
|
|
902
|
-
<div class="canvas"><canvas width="516" height="220" id="canvas-
|
|
966
|
+
<div class="canvas"><canvas width="516" height="220" id="canvas-8"></canvas></div>
|
|
903
967
|
</div>
|
|
904
968
|
|
|
905
969
|
|
|
@@ -911,7 +975,7 @@ copy.smooth({ type: 'catmull-rom', factor: 0.5 });
|
|
|
911
975
|
<div class="button run">Run</div>
|
|
912
976
|
</div>
|
|
913
977
|
|
|
914
|
-
<script type="text/paperscript" canvas="canvas-
|
|
978
|
+
<script type="text/paperscript" canvas="canvas-9">
|
|
915
979
|
// Create 5 rectangles, next to each other:
|
|
916
980
|
var paths = [];
|
|
917
981
|
for (var i = 0; i < 5; i++) {
|
|
@@ -941,7 +1005,7 @@ paths[3].smooth({ type: 'continuous', from: 0, to: 2 });
|
|
|
941
1005
|
// Smooth a range, using negative indices:
|
|
942
1006
|
paths[4].smooth({ type: 'continuous', from: -1, to: 1 });
|
|
943
1007
|
</script>
|
|
944
|
-
<div class="canvas"><canvas width="516" height="110" id="canvas-
|
|
1008
|
+
<div class="canvas"><canvas width="516" height="110" id="canvas-9"></canvas></div>
|
|
945
1009
|
</div>
|
|
946
1010
|
|
|
947
1011
|
|
|
@@ -994,7 +1058,7 @@ paths[4].smooth({ type: 'continuous', from: -1, to: 1 });
|
|
|
994
1058
|
<div class="button run">Run</div>
|
|
995
1059
|
</div>
|
|
996
1060
|
|
|
997
|
-
<script type="text/paperscript" canvas="canvas-
|
|
1061
|
+
<script type="text/paperscript" canvas="canvas-10">
|
|
998
1062
|
var path;
|
|
999
1063
|
function onMouseDown(event) {
|
|
1000
1064
|
// If we already made a path before, deselect it:
|
|
@@ -1024,7 +1088,7 @@ function onMouseUp(event) {
|
|
|
1024
1088
|
path.selected = true;
|
|
1025
1089
|
}
|
|
1026
1090
|
</script>
|
|
1027
|
-
<div class="canvas"><canvas width="516" height="300" id="canvas-
|
|
1091
|
+
<div class="canvas"><canvas width="516" height="300" id="canvas-10"></canvas></div>
|
|
1028
1092
|
</div>
|
|
1029
1093
|
|
|
1030
1094
|
|
|
@@ -1223,7 +1287,7 @@ function onMouseUp(event) {
|
|
|
1223
1287
|
<div class="button run">Run</div>
|
|
1224
1288
|
</div>
|
|
1225
1289
|
|
|
1226
|
-
<script type="text/paperscript" canvas="canvas-
|
|
1290
|
+
<script type="text/paperscript" canvas="canvas-11">
|
|
1227
1291
|
var path = new Path();
|
|
1228
1292
|
path.strokeColor = 'black';
|
|
1229
1293
|
|
|
@@ -1243,7 +1307,7 @@ path.arcTo(throughPoint, toPoint);
|
|
|
1243
1307
|
var circle = new Path.Circle(throughPoint, 3);
|
|
1244
1308
|
circle.fillColor = 'red';
|
|
1245
1309
|
</script>
|
|
1246
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
1310
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-11"></canvas></div>
|
|
1247
1311
|
</div>
|
|
1248
1312
|
|
|
1249
1313
|
|
|
@@ -1255,7 +1319,7 @@ circle.fillColor = 'red';
|
|
|
1255
1319
|
<div class="button run">Run</div>
|
|
1256
1320
|
</div>
|
|
1257
1321
|
|
|
1258
|
-
<script type="text/paperscript" canvas="canvas-
|
|
1322
|
+
<script type="text/paperscript" canvas="canvas-12">
|
|
1259
1323
|
var myPath;
|
|
1260
1324
|
function onMouseDrag(event) {
|
|
1261
1325
|
// If we created a path before, remove it:
|
|
@@ -1283,7 +1347,7 @@ function onMouseUp(event) {
|
|
|
1283
1347
|
myPath.fillColor = 'black';
|
|
1284
1348
|
}
|
|
1285
1349
|
</script>
|
|
1286
|
-
<div class="canvas"><canvas width="516" height="300" id="canvas-
|
|
1350
|
+
<div class="canvas"><canvas width="516" height="300" id="canvas-12"></canvas></div>
|
|
1287
1351
|
</div>
|
|
1288
1352
|
|
|
1289
1353
|
|
|
@@ -1332,7 +1396,7 @@ function onMouseUp(event) {
|
|
|
1332
1396
|
<div class="button run">Run</div>
|
|
1333
1397
|
</div>
|
|
1334
1398
|
|
|
1335
|
-
<script type="text/paperscript" canvas="canvas-
|
|
1399
|
+
<script type="text/paperscript" canvas="canvas-13">
|
|
1336
1400
|
var path = new Path();
|
|
1337
1401
|
path.strokeColor = 'black';
|
|
1338
1402
|
|
|
@@ -1347,7 +1411,7 @@ path2.add(new Point(180, 25));
|
|
|
1347
1411
|
// we pass `false` as the second argument to arcTo:
|
|
1348
1412
|
path2.arcTo(new Point(280, 25), false);
|
|
1349
1413
|
</script>
|
|
1350
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
1414
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-13"></canvas></div>
|
|
1351
1415
|
</div>
|
|
1352
1416
|
|
|
1353
1417
|
|
|
@@ -1359,7 +1423,7 @@ path2.arcTo(new Point(280, 25), false);
|
|
|
1359
1423
|
<div class="button run">Run</div>
|
|
1360
1424
|
</div>
|
|
1361
1425
|
|
|
1362
|
-
<script type="text/paperscript" canvas="canvas-
|
|
1426
|
+
<script type="text/paperscript" canvas="canvas-14">
|
|
1363
1427
|
var myPath;
|
|
1364
1428
|
|
|
1365
1429
|
// The mouse has to move at least 20 points before
|
|
@@ -1380,7 +1444,7 @@ function onMouseDrag(event) {
|
|
|
1380
1444
|
myPath.arcTo(event.point);
|
|
1381
1445
|
}
|
|
1382
1446
|
</script>
|
|
1383
|
-
<div class="canvas"><canvas width="516" height="300" id="canvas-
|
|
1447
|
+
<div class="canvas"><canvas width="516" height="300" id="canvas-14"></canvas></div>
|
|
1384
1448
|
</div>
|
|
1385
1449
|
|
|
1386
1450
|
|
|
@@ -1436,7 +1500,7 @@ function onMouseDrag(event) {
|
|
|
1436
1500
|
<div class="button run">Run</div>
|
|
1437
1501
|
</div>
|
|
1438
1502
|
|
|
1439
|
-
<script type="text/paperscript" canvas="canvas-
|
|
1503
|
+
<script type="text/paperscript" canvas="canvas-15">
|
|
1440
1504
|
var myPath;
|
|
1441
1505
|
function onMouseMove(event) {
|
|
1442
1506
|
// If we created a path before, remove it:
|
|
@@ -1457,7 +1521,7 @@ function onMouseMove(event) {
|
|
|
1457
1521
|
myPath.selected = true;
|
|
1458
1522
|
}
|
|
1459
1523
|
</script>
|
|
1460
|
-
<div class="canvas"><canvas width="516" height="300" id="canvas-
|
|
1524
|
+
<div class="canvas"><canvas width="516" height="300" id="canvas-15"></canvas></div>
|
|
1461
1525
|
</div>
|
|
1462
1526
|
|
|
1463
1527
|
|
|
@@ -1642,7 +1706,7 @@ function onMouseMove(event) {
|
|
|
1642
1706
|
<div class="button run">Run</div>
|
|
1643
1707
|
</div>
|
|
1644
1708
|
|
|
1645
|
-
<script type="text/paperscript" canvas="canvas-
|
|
1709
|
+
<script type="text/paperscript" canvas="canvas-16">
|
|
1646
1710
|
var path = new Path();
|
|
1647
1711
|
path.strokeColor = 'black';
|
|
1648
1712
|
|
|
@@ -1656,7 +1720,7 @@ path.lineBy(50, 0);
|
|
|
1656
1720
|
// 0 in x direction and 50 in y direction, becomes {x: 75, y: 75}
|
|
1657
1721
|
path.lineBy(0, 50);
|
|
1658
1722
|
</script>
|
|
1659
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
1723
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-16"></canvas></div>
|
|
1660
1724
|
</div>
|
|
1661
1725
|
|
|
1662
1726
|
|
|
@@ -1668,7 +1732,7 @@ path.lineBy(0, 50);
|
|
|
1668
1732
|
<div class="button run">Run</div>
|
|
1669
1733
|
</div>
|
|
1670
1734
|
|
|
1671
|
-
<script type="text/paperscript" canvas="canvas-
|
|
1735
|
+
<script type="text/paperscript" canvas="canvas-17">
|
|
1672
1736
|
var path = new Path();
|
|
1673
1737
|
path.strokeColor = 'black';
|
|
1674
1738
|
|
|
@@ -1694,7 +1758,7 @@ path.smooth();
|
|
|
1694
1758
|
// the construction of the path:
|
|
1695
1759
|
// path.selected = true;
|
|
1696
1760
|
</script>
|
|
1697
|
-
<div class="canvas"><canvas width="516" height="300" id="canvas-
|
|
1761
|
+
<div class="canvas"><canvas width="516" height="300" id="canvas-17"></canvas></div>
|
|
1698
1762
|
</div>
|
|
1699
1763
|
|
|
1700
1764
|
|
|
@@ -2132,7 +2196,7 @@ Array of <tt>Number[]</tt> objects[]
|
|
|
2132
2196
|
<div class="button run">Run</div>
|
|
2133
2197
|
</div>
|
|
2134
2198
|
|
|
2135
|
-
<script type="text/paperscript" canvas="canvas-
|
|
2199
|
+
<script type="text/paperscript" canvas="canvas-18">
|
|
2136
2200
|
var path = new Path.Circle({
|
|
2137
2201
|
center: [80, 50],
|
|
2138
2202
|
radius: 35
|
|
@@ -2147,7 +2211,7 @@ group.addChild(path);
|
|
|
2147
2211
|
// The path can be accessed by name:
|
|
2148
2212
|
group.children['example'].fillColor = 'red';
|
|
2149
2213
|
</script>
|
|
2150
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
2214
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-18"></canvas></div>
|
|
2151
2215
|
</div>
|
|
2152
2216
|
|
|
2153
2217
|
|
|
@@ -2165,6 +2229,7 @@ group.children['example'].fillColor = 'red';
|
|
|
2165
2229
|
|
|
2166
2230
|
<div class="member-text">
|
|
2167
2231
|
<p>The path style of the item.</p>
|
|
2232
|
+
<p>Styles set on a <a href="../classes/Group.html"><tt>Group</tt></a> or <a href="../classes/Layer.html"><tt>Layer</tt></a> are applied to the children that it contains at that moment. Items added to it later do not receive them.</p>
|
|
2168
2233
|
|
|
2169
2234
|
|
|
2170
2235
|
|
|
@@ -2184,7 +2249,7 @@ group.children['example'].fillColor = 'red';
|
|
|
2184
2249
|
<div class="button run">Run</div>
|
|
2185
2250
|
</div>
|
|
2186
2251
|
|
|
2187
|
-
<script type="text/paperscript" canvas="canvas-
|
|
2252
|
+
<script type="text/paperscript" canvas="canvas-19">
|
|
2188
2253
|
var circle = new Path.Circle({
|
|
2189
2254
|
center: [80, 50],
|
|
2190
2255
|
radius: 30
|
|
@@ -2195,7 +2260,7 @@ circle.style = {
|
|
|
2195
2260
|
strokeWidth: 5
|
|
2196
2261
|
};
|
|
2197
2262
|
</script>
|
|
2198
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
2263
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-19"></canvas></div>
|
|
2199
2264
|
</div>
|
|
2200
2265
|
|
|
2201
2266
|
|
|
@@ -2207,7 +2272,7 @@ circle.style = {
|
|
|
2207
2272
|
<div class="button run">Run</div>
|
|
2208
2273
|
</div>
|
|
2209
2274
|
|
|
2210
|
-
<script type="text/paperscript" canvas="canvas-
|
|
2275
|
+
<script type="text/paperscript" canvas="canvas-20">
|
|
2211
2276
|
var path = new Path.Circle({
|
|
2212
2277
|
center: [50, 50],
|
|
2213
2278
|
radius: 30,
|
|
@@ -2222,7 +2287,7 @@ var path2 = new Path.Circle({
|
|
|
2222
2287
|
// Copy the path style of path:
|
|
2223
2288
|
path2.style = path.style;
|
|
2224
2289
|
</script>
|
|
2225
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
2290
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-20"></canvas></div>
|
|
2226
2291
|
</div>
|
|
2227
2292
|
|
|
2228
2293
|
|
|
@@ -2234,7 +2299,7 @@ path2.style = path.style;
|
|
|
2234
2299
|
<div class="button run">Run</div>
|
|
2235
2300
|
</div>
|
|
2236
2301
|
|
|
2237
|
-
<script type="text/paperscript" canvas="canvas-
|
|
2302
|
+
<script type="text/paperscript" canvas="canvas-21">
|
|
2238
2303
|
var myStyle = {
|
|
2239
2304
|
fillColor: 'red',
|
|
2240
2305
|
strokeColor: 'blue',
|
|
@@ -2253,7 +2318,7 @@ var path2 = new Path.Circle({
|
|
|
2253
2318
|
});
|
|
2254
2319
|
path2.style = myStyle;
|
|
2255
2320
|
</script>
|
|
2256
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
2321
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-21"></canvas></div>
|
|
2257
2322
|
</div>
|
|
2258
2323
|
|
|
2259
2324
|
|
|
@@ -2295,7 +2360,7 @@ path2.style = myStyle;
|
|
|
2295
2360
|
<div class="button run">Run</div>
|
|
2296
2361
|
</div>
|
|
2297
2362
|
|
|
2298
|
-
<script type="text/paperscript" canvas="canvas-
|
|
2363
|
+
<script type="text/paperscript" canvas="canvas-22">
|
|
2299
2364
|
var unlockedItem = new Path.Circle({
|
|
2300
2365
|
center: view.center - [35, 0],
|
|
2301
2366
|
radius: 30,
|
|
@@ -2322,7 +2387,7 @@ new PointText({
|
|
|
2322
2387
|
justification: 'center'
|
|
2323
2388
|
});
|
|
2324
2389
|
</script>
|
|
2325
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
2390
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-22"></canvas></div>
|
|
2326
2391
|
</div>
|
|
2327
2392
|
|
|
2328
2393
|
|
|
@@ -2364,7 +2429,7 @@ new PointText({
|
|
|
2364
2429
|
<div class="button run">Run</div>
|
|
2365
2430
|
</div>
|
|
2366
2431
|
|
|
2367
|
-
<script type="text/paperscript" canvas="canvas-
|
|
2432
|
+
<script type="text/paperscript" canvas="canvas-23">
|
|
2368
2433
|
var path = new Path.Circle({
|
|
2369
2434
|
center: [50, 50],
|
|
2370
2435
|
radius: 20,
|
|
@@ -2374,7 +2439,7 @@ var path = new Path.Circle({
|
|
|
2374
2439
|
// Hide the path:
|
|
2375
2440
|
path.visible = false;
|
|
2376
2441
|
</script>
|
|
2377
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
2442
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-23"></canvas></div>
|
|
2378
2443
|
</div>
|
|
2379
2444
|
|
|
2380
2445
|
|
|
@@ -2422,7 +2487,7 @@ path.visible = false;
|
|
|
2422
2487
|
<div class="button run">Run</div>
|
|
2423
2488
|
</div>
|
|
2424
2489
|
|
|
2425
|
-
<script type="text/paperscript" canvas="canvas-
|
|
2490
|
+
<script type="text/paperscript" canvas="canvas-24">
|
|
2426
2491
|
// Create a white rectangle in the background
|
|
2427
2492
|
// with the same dimensions as the view:
|
|
2428
2493
|
var background = new Path.Rectangle(view.bounds);
|
|
@@ -2443,7 +2508,7 @@ var circle2 = new Path.Circle({
|
|
|
2443
2508
|
// Set the blend mode of circle2:
|
|
2444
2509
|
circle2.blendMode = 'multiply';
|
|
2445
2510
|
</script>
|
|
2446
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
2511
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-24"></canvas></div>
|
|
2447
2512
|
</div>
|
|
2448
2513
|
|
|
2449
2514
|
|
|
@@ -2485,7 +2550,7 @@ circle2.blendMode = 'multiply';
|
|
|
2485
2550
|
<div class="button run">Run</div>
|
|
2486
2551
|
</div>
|
|
2487
2552
|
|
|
2488
|
-
<script type="text/paperscript" canvas="canvas-
|
|
2553
|
+
<script type="text/paperscript" canvas="canvas-25">
|
|
2489
2554
|
var circle = new Path.Circle({
|
|
2490
2555
|
center: [80, 50],
|
|
2491
2556
|
radius: 35,
|
|
@@ -2503,10 +2568,41 @@ var circle2 = new Path.Circle({
|
|
|
2503
2568
|
// Make circle2 50% transparent:
|
|
2504
2569
|
circle2.opacity = 0.5;
|
|
2505
2570
|
</script>
|
|
2506
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
2571
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-25"></canvas></div>
|
|
2507
2572
|
</div>
|
|
2508
2573
|
|
|
2509
2574
|
|
|
2575
|
+
</div>
|
|
2576
|
+
|
|
2577
|
+
</div>
|
|
2578
|
+
</div>
|
|
2579
|
+
|
|
2580
|
+
|
|
2581
|
+
<div id="guide" class="member">
|
|
2582
|
+
<div class="member-link">
|
|
2583
|
+
<a name="guide" href="#guide"><tt><b>guide</b></tt></a>
|
|
2584
|
+
</div>
|
|
2585
|
+
<div class="member-description hidden">
|
|
2586
|
+
|
|
2587
|
+
<div class="member-text">
|
|
2588
|
+
<p>Specifies whether the item functions as a guide. When set to <code>true</code>, the item is drawn as usual, but left out of hit-tests and mouse interactions. Hit-tests only find guides when <code>options.guides</code> is set, and then only them, see <a href="../classes/Item.html#hittest-point"><tt>hitTest(point[, options])</tt></a>.</p>
|
|
2589
|
+
|
|
2590
|
+
|
|
2591
|
+
|
|
2592
|
+
<ul class="member-list">
|
|
2593
|
+
<h4>Default:</h4>
|
|
2594
|
+
<li><tt>false</tt></li>
|
|
2595
|
+
</ul>
|
|
2596
|
+
|
|
2597
|
+
<ul class="member-list">
|
|
2598
|
+
<h4>Type:</h4>
|
|
2599
|
+
<li>
|
|
2600
|
+
<tt>Boolean</tt>
|
|
2601
|
+
</li>
|
|
2602
|
+
</ul>
|
|
2603
|
+
|
|
2604
|
+
|
|
2605
|
+
|
|
2510
2606
|
</div>
|
|
2511
2607
|
|
|
2512
2608
|
</div>
|
|
@@ -2559,14 +2655,14 @@ circle2.opacity = 0.5;
|
|
|
2559
2655
|
<div class="button run">Run</div>
|
|
2560
2656
|
</div>
|
|
2561
2657
|
|
|
2562
|
-
<script type="text/paperscript" canvas="canvas-
|
|
2658
|
+
<script type="text/paperscript" canvas="canvas-26">
|
|
2563
2659
|
var path = new Path.Circle({
|
|
2564
2660
|
center: [80, 50],
|
|
2565
2661
|
radius: 35
|
|
2566
2662
|
});
|
|
2567
2663
|
path.selected = true; // Select the path
|
|
2568
2664
|
</script>
|
|
2569
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
2665
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-26"></canvas></div>
|
|
2570
2666
|
</div>
|
|
2571
2667
|
|
|
2572
2668
|
|
|
@@ -2697,7 +2793,7 @@ console.log(path.data.pets.length); // 1</code></pre>
|
|
|
2697
2793
|
<div class="button run">Run</div>
|
|
2698
2794
|
</div>
|
|
2699
2795
|
|
|
2700
|
-
<script type="text/paperscript" canvas="canvas-
|
|
2796
|
+
<script type="text/paperscript" canvas="canvas-27">
|
|
2701
2797
|
// Create a circle at position { x: 10, y: 10 }
|
|
2702
2798
|
var circle = new Path.Circle({
|
|
2703
2799
|
center: new Point(10, 10),
|
|
@@ -2711,7 +2807,7 @@ circle.position = new Point(20, 20);
|
|
|
2711
2807
|
// Move the circle 100 points to the right and 50 points down
|
|
2712
2808
|
circle.position += new Point(100, 50);
|
|
2713
2809
|
</script>
|
|
2714
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
2810
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-27"></canvas></div>
|
|
2715
2811
|
</div>
|
|
2716
2812
|
|
|
2717
2813
|
|
|
@@ -2723,7 +2819,7 @@ circle.position += new Point(100, 50);
|
|
|
2723
2819
|
<div class="button run">Run</div>
|
|
2724
2820
|
</div>
|
|
2725
2821
|
|
|
2726
|
-
<script type="text/paperscript" canvas="canvas-
|
|
2822
|
+
<script type="text/paperscript" canvas="canvas-28">
|
|
2727
2823
|
// Create a circle at position { x: 20, y: 20 }
|
|
2728
2824
|
var circle = new Path.Circle({
|
|
2729
2825
|
center: new Point(20, 20),
|
|
@@ -2734,7 +2830,7 @@ var circle = new Path.Circle({
|
|
|
2734
2830
|
// Move the circle 100 points to the right
|
|
2735
2831
|
circle.position.x += 100;
|
|
2736
2832
|
</script>
|
|
2737
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
2833
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-28"></canvas></div>
|
|
2738
2834
|
</div>
|
|
2739
2835
|
|
|
2740
2836
|
|
|
@@ -3210,6 +3306,7 @@ console.log(group.children[0] == path); // true</code></pre>
|
|
|
3210
3306
|
|
|
3211
3307
|
<div class="member-text">
|
|
3212
3308
|
<p>The children items contained within this item. Items that define a <a href="../classes/Item.html#name"><tt>name</tt></a> can also be accessed by name.</p>
|
|
3309
|
+
<p>Only <a href="../classes/Group.html"><tt>Group</tt></a>, <a href="../classes/Layer.html"><tt>Layer</tt></a> and <a href="../classes/CompoundPath.html"><tt>CompoundPath</tt></a> items can have children. On all other items, such as <a href="../classes/Path.html"><tt>Path</tt></a>, <a href="../classes/Shape.html"><tt>Shape</tt></a>, <a href="../classes/Raster.html"><tt>Raster</tt></a>, <a href="../classes/SymbolItem.html"><tt>SymbolItem</tt></a> and <a href="../classes/PointText.html"><tt>PointText</tt></a>, <code>children</code> is <code>undefined</code>.</p>
|
|
3213
3310
|
<p><b>Please note:</b> The children array should not be modified directly using array functions. To remove single items from the children list, use <a href="../classes/Item.html#remove"><tt>item.remove</tt></a>(), to remove all items from the children list, use <a href="../classes/Item.html#removechildren"><tt>item.removeChildren</tt></a>(). To add items to the children list, use <a href="../classes/Item.html#addchild-item"><tt>item.addChild(item)</tt></a> or <a href="../classes/Item.html#insertchild-index-item"><tt>item.insertChild(index, item)</tt></a>.</p>
|
|
3214
3311
|
|
|
3215
3312
|
|
|
@@ -3230,7 +3327,7 @@ console.log(group.children[0] == path); // true</code></pre>
|
|
|
3230
3327
|
<div class="button run">Run</div>
|
|
3231
3328
|
</div>
|
|
3232
3329
|
|
|
3233
|
-
<script type="text/paperscript" canvas="canvas-
|
|
3330
|
+
<script type="text/paperscript" canvas="canvas-29">
|
|
3234
3331
|
var path = new Path.Circle({
|
|
3235
3332
|
center: [80, 50],
|
|
3236
3333
|
radius: 35
|
|
@@ -3243,7 +3340,7 @@ group.addChild(path);
|
|
|
3243
3340
|
// Access the path through the group's children array:
|
|
3244
3341
|
group.children[0].fillColor = 'red';
|
|
3245
3342
|
</script>
|
|
3246
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
3343
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-29"></canvas></div>
|
|
3247
3344
|
</div>
|
|
3248
3345
|
|
|
3249
3346
|
|
|
@@ -3255,7 +3352,7 @@ group.children[0].fillColor = 'red';
|
|
|
3255
3352
|
<div class="button run">Run</div>
|
|
3256
3353
|
</div>
|
|
3257
3354
|
|
|
3258
|
-
<script type="text/paperscript" canvas="canvas-
|
|
3355
|
+
<script type="text/paperscript" canvas="canvas-30">
|
|
3259
3356
|
var path = new Path.Circle({
|
|
3260
3357
|
center: [80, 50],
|
|
3261
3358
|
radius: 35
|
|
@@ -3270,7 +3367,7 @@ group.addChild(path);
|
|
|
3270
3367
|
// The path can be accessed by name:
|
|
3271
3368
|
group.children['example'].fillColor = 'orange';
|
|
3272
3369
|
</script>
|
|
3273
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
3370
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-30"></canvas></div>
|
|
3274
3371
|
</div>
|
|
3275
3372
|
|
|
3276
3373
|
|
|
@@ -3282,7 +3379,7 @@ group.children['example'].fillColor = 'orange';
|
|
|
3282
3379
|
<div class="button run">Run</div>
|
|
3283
3380
|
</div>
|
|
3284
3381
|
|
|
3285
|
-
<script type="text/paperscript" canvas="canvas-
|
|
3382
|
+
<script type="text/paperscript" canvas="canvas-31">
|
|
3286
3383
|
var path = new Path.Circle({
|
|
3287
3384
|
center: [80, 50],
|
|
3288
3385
|
radius: 35
|
|
@@ -3294,7 +3391,7 @@ group.children = [path];
|
|
|
3294
3391
|
// The path is the first child of the group:
|
|
3295
3392
|
group.firstChild.fillColor = 'green';
|
|
3296
3393
|
</script>
|
|
3297
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
3394
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-31"></canvas></div>
|
|
3298
3395
|
</div>
|
|
3299
3396
|
|
|
3300
3397
|
|
|
@@ -3471,7 +3568,7 @@ group.firstChild.fillColor = 'green';
|
|
|
3471
3568
|
<div class="button run">Run</div>
|
|
3472
3569
|
</div>
|
|
3473
3570
|
|
|
3474
|
-
<script type="text/paperscript" canvas="canvas-
|
|
3571
|
+
<script type="text/paperscript" canvas="canvas-32">
|
|
3475
3572
|
// Create a circle shaped path at { x: 80, y: 50 }
|
|
3476
3573
|
// with a radius of 35:
|
|
3477
3574
|
var circle = new Path.Circle({
|
|
@@ -3482,7 +3579,7 @@ var circle = new Path.Circle({
|
|
|
3482
3579
|
// Set its stroke color to RGB red:
|
|
3483
3580
|
circle.strokeColor = new Color(1, 0, 0);
|
|
3484
3581
|
</script>
|
|
3485
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
3582
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-32"></canvas></div>
|
|
3486
3583
|
</div>
|
|
3487
3584
|
|
|
3488
3585
|
|
|
@@ -3519,7 +3616,7 @@ circle.strokeColor = new Color(1, 0, 0);
|
|
|
3519
3616
|
<div class="button run">Run</div>
|
|
3520
3617
|
</div>
|
|
3521
3618
|
|
|
3522
|
-
<script type="text/paperscript" canvas="canvas-
|
|
3619
|
+
<script type="text/paperscript" canvas="canvas-33">
|
|
3523
3620
|
// Create a circle shaped path at { x: 80, y: 50 }
|
|
3524
3621
|
// with a radius of 35:
|
|
3525
3622
|
var circle = new Path.Circle({
|
|
@@ -3531,7 +3628,7 @@ var circle = new Path.Circle({
|
|
|
3531
3628
|
// Set its stroke width to 10:
|
|
3532
3629
|
circle.strokeWidth = 10;
|
|
3533
3630
|
</script>
|
|
3534
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
3631
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-33"></canvas></div>
|
|
3535
3632
|
</div>
|
|
3536
3633
|
|
|
3537
3634
|
|
|
@@ -3578,7 +3675,7 @@ circle.strokeWidth = 10;
|
|
|
3578
3675
|
<div class="button run">Run</div>
|
|
3579
3676
|
</div>
|
|
3580
3677
|
|
|
3581
|
-
<script type="text/paperscript" canvas="canvas-
|
|
3678
|
+
<script type="text/paperscript" canvas="canvas-34">
|
|
3582
3679
|
var line = new Path({
|
|
3583
3680
|
segments: [[80, 50], [420, 50]],
|
|
3584
3681
|
strokeColor: 'black',
|
|
@@ -3599,7 +3696,7 @@ var line2 = line.clone();
|
|
|
3599
3696
|
line2.position.y += 100;
|
|
3600
3697
|
line2.strokeCap = 'butt';
|
|
3601
3698
|
</script>
|
|
3602
|
-
<div class="canvas"><canvas width="516" height="200" id="canvas-
|
|
3699
|
+
<div class="canvas"><canvas width="516" height="200" id="canvas-34"></canvas></div>
|
|
3603
3700
|
</div>
|
|
3604
3701
|
|
|
3605
3702
|
|
|
@@ -3646,7 +3743,7 @@ line2.strokeCap = 'butt';
|
|
|
3646
3743
|
<div class="button run">Run</div>
|
|
3647
3744
|
</div>
|
|
3648
3745
|
|
|
3649
|
-
<script type="text/paperscript" canvas="canvas-
|
|
3746
|
+
<script type="text/paperscript" canvas="canvas-35">
|
|
3650
3747
|
var path = new Path({
|
|
3651
3748
|
segments: [[80, 100], [120, 40], [160, 100]],
|
|
3652
3749
|
strokeColor: 'black',
|
|
@@ -3663,7 +3760,7 @@ var path3 = path2.clone();
|
|
|
3663
3760
|
path3.position.x += path3.bounds.width * 1.5;
|
|
3664
3761
|
path3.strokeJoin = 'bevel';
|
|
3665
3762
|
</script>
|
|
3666
|
-
<div class="canvas"><canvas width="516" height="120" id="canvas-
|
|
3763
|
+
<div class="canvas"><canvas width="516" height="120" id="canvas-35"></canvas></div>
|
|
3667
3764
|
</div>
|
|
3668
3765
|
|
|
3669
3766
|
|
|
@@ -3767,7 +3864,7 @@ path3.strokeJoin = 'bevel';
|
|
|
3767
3864
|
<div class="button run">Run</div>
|
|
3768
3865
|
</div>
|
|
3769
3866
|
|
|
3770
|
-
<script type="text/paperscript" canvas="canvas-
|
|
3867
|
+
<script type="text/paperscript" canvas="canvas-36">
|
|
3771
3868
|
var path = new Path.Circle({
|
|
3772
3869
|
center: [80, 50],
|
|
3773
3870
|
radius: 40,
|
|
@@ -3778,7 +3875,7 @@ var path = new Path.Circle({
|
|
|
3778
3875
|
// Set the dashed stroke to [10pt dash, 4pt gap]:
|
|
3779
3876
|
path.dashArray = [10, 4];
|
|
3780
3877
|
</script>
|
|
3781
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
3878
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-36"></canvas></div>
|
|
3782
3879
|
</div>
|
|
3783
3880
|
|
|
3784
3881
|
|
|
@@ -3848,7 +3945,7 @@ path.dashArray = [10, 4];
|
|
|
3848
3945
|
<div class="button run">Run</div>
|
|
3849
3946
|
</div>
|
|
3850
3947
|
|
|
3851
|
-
<script type="text/paperscript" canvas="canvas-
|
|
3948
|
+
<script type="text/paperscript" canvas="canvas-37">
|
|
3852
3949
|
// Create a circle shaped path at { x: 80, y: 50 }
|
|
3853
3950
|
// with a radius of 35:
|
|
3854
3951
|
var circle = new Path.Circle({
|
|
@@ -3859,7 +3956,7 @@ var circle = new Path.Circle({
|
|
|
3859
3956
|
// Set the fill color of the circle to RGB red:
|
|
3860
3957
|
circle.fillColor = new Color(1, 0, 0);
|
|
3861
3958
|
</script>
|
|
3862
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
3959
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-37"></canvas></div>
|
|
3863
3960
|
</div>
|
|
3864
3961
|
|
|
3865
3962
|
|
|
@@ -3934,7 +4031,7 @@ circle.fillColor = new Color(1, 0, 0);
|
|
|
3934
4031
|
<div class="button run">Run</div>
|
|
3935
4032
|
</div>
|
|
3936
4033
|
|
|
3937
|
-
<script type="text/paperscript" canvas="canvas-
|
|
4034
|
+
<script type="text/paperscript" canvas="canvas-38">
|
|
3938
4035
|
var circle = new Path.Circle({
|
|
3939
4036
|
center: [80, 50],
|
|
3940
4037
|
radius: 35,
|
|
@@ -3947,7 +4044,7 @@ var circle = new Path.Circle({
|
|
|
3947
4044
|
shadowOffset: new Point(5, 5)
|
|
3948
4045
|
});
|
|
3949
4046
|
</script>
|
|
3950
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
4047
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-38"></canvas></div>
|
|
3951
4048
|
</div>
|
|
3952
4049
|
|
|
3953
4050
|
|
|
@@ -4088,7 +4185,7 @@ var circle = new Path.Circle({
|
|
|
4088
4185
|
<div class="button run">Run</div>
|
|
4089
4186
|
</div>
|
|
4090
4187
|
|
|
4091
|
-
<script type="text/paperscript" canvas="canvas-
|
|
4188
|
+
<script type="text/paperscript" canvas="canvas-39">
|
|
4092
4189
|
// Create a rectangle shaped path with its top left point at:
|
|
4093
4190
|
// {x: 50, y: 25} and a size of {width: 50, height: 50}
|
|
4094
4191
|
var path = new Path.Rectangle(new Point(50, 25), new Size(50, 50));
|
|
@@ -4099,7 +4196,7 @@ path.onFrame = function(event) {
|
|
|
4099
4196
|
this.rotate(3);
|
|
4100
4197
|
}
|
|
4101
4198
|
</script>
|
|
4102
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
4199
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-39"></canvas></div>
|
|
4103
4200
|
</div>
|
|
4104
4201
|
|
|
4105
4202
|
|
|
@@ -4143,7 +4240,7 @@ path.onFrame = function(event) {
|
|
|
4143
4240
|
<div class="button run">Run</div>
|
|
4144
4241
|
</div>
|
|
4145
4242
|
|
|
4146
|
-
<script type="text/paperscript" canvas="canvas-
|
|
4243
|
+
<script type="text/paperscript" canvas="canvas-40">
|
|
4147
4244
|
// Create a circle shaped path at the center of the view:
|
|
4148
4245
|
var path = new Path.Circle({
|
|
4149
4246
|
center: view.center,
|
|
@@ -4157,7 +4254,7 @@ path.onMouseDown = function(event) {
|
|
|
4157
4254
|
this.fillColor = 'red';
|
|
4158
4255
|
}
|
|
4159
4256
|
</script>
|
|
4160
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
4257
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-40"></canvas></div>
|
|
4161
4258
|
</div>
|
|
4162
4259
|
|
|
4163
4260
|
|
|
@@ -4169,7 +4266,7 @@ path.onMouseDown = function(event) {
|
|
|
4169
4266
|
<div class="button run">Run</div>
|
|
4170
4267
|
</div>
|
|
4171
4268
|
|
|
4172
|
-
<script type="text/paperscript" canvas="canvas-
|
|
4269
|
+
<script type="text/paperscript" canvas="canvas-41">
|
|
4173
4270
|
// Loop 30 times:
|
|
4174
4271
|
for (var i = 0; i < 30; i++) {
|
|
4175
4272
|
// Create a circle shaped path at a random position
|
|
@@ -4187,7 +4284,7 @@ for (var i = 0; i < 30; i++) {
|
|
|
4187
4284
|
}
|
|
4188
4285
|
}
|
|
4189
4286
|
</script>
|
|
4190
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
4287
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-41"></canvas></div>
|
|
4191
4288
|
</div>
|
|
4192
4289
|
|
|
4193
4290
|
|
|
@@ -4231,7 +4328,7 @@ for (var i = 0; i < 30; i++) {
|
|
|
4231
4328
|
<div class="button run">Run</div>
|
|
4232
4329
|
</div>
|
|
4233
4330
|
|
|
4234
|
-
<script type="text/paperscript" canvas="canvas-
|
|
4331
|
+
<script type="text/paperscript" canvas="canvas-42">
|
|
4235
4332
|
// Create a circle shaped path at the center of the view:
|
|
4236
4333
|
var path = new Path.Circle({
|
|
4237
4334
|
center: view.center,
|
|
@@ -4244,7 +4341,7 @@ path.onMouseDrag = function(event) {
|
|
|
4244
4341
|
path.position += event.delta;
|
|
4245
4342
|
}
|
|
4246
4343
|
</script>
|
|
4247
|
-
<div class="canvas"><canvas width="516" height="240" id="canvas-
|
|
4344
|
+
<div class="canvas"><canvas width="516" height="240" id="canvas-42"></canvas></div>
|
|
4248
4345
|
</div>
|
|
4249
4346
|
|
|
4250
4347
|
|
|
@@ -4288,7 +4385,7 @@ path.onMouseDrag = function(event) {
|
|
|
4288
4385
|
<div class="button run">Run</div>
|
|
4289
4386
|
</div>
|
|
4290
4387
|
|
|
4291
|
-
<script type="text/paperscript" canvas="canvas-
|
|
4388
|
+
<script type="text/paperscript" canvas="canvas-43">
|
|
4292
4389
|
// Create a circle shaped path at the center of the view:
|
|
4293
4390
|
var path = new Path.Circle({
|
|
4294
4391
|
center: view.center,
|
|
@@ -4302,7 +4399,7 @@ path.onMouseUp = function(event) {
|
|
|
4302
4399
|
this.fillColor = 'red';
|
|
4303
4400
|
}
|
|
4304
4401
|
</script>
|
|
4305
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
4402
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-43"></canvas></div>
|
|
4306
4403
|
</div>
|
|
4307
4404
|
|
|
4308
4405
|
|
|
@@ -4346,7 +4443,7 @@ path.onMouseUp = function(event) {
|
|
|
4346
4443
|
<div class="button run">Run</div>
|
|
4347
4444
|
</div>
|
|
4348
4445
|
|
|
4349
|
-
<script type="text/paperscript" canvas="canvas-
|
|
4446
|
+
<script type="text/paperscript" canvas="canvas-44">
|
|
4350
4447
|
// Create a circle shaped path at the center of the view:
|
|
4351
4448
|
var path = new Path.Circle({
|
|
4352
4449
|
center: view.center,
|
|
@@ -4360,7 +4457,7 @@ path.onClick = function(event) {
|
|
|
4360
4457
|
this.fillColor = 'red';
|
|
4361
4458
|
}
|
|
4362
4459
|
</script>
|
|
4363
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
4460
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-44"></canvas></div>
|
|
4364
4461
|
</div>
|
|
4365
4462
|
|
|
4366
4463
|
|
|
@@ -4372,7 +4469,7 @@ path.onClick = function(event) {
|
|
|
4372
4469
|
<div class="button run">Run</div>
|
|
4373
4470
|
</div>
|
|
4374
4471
|
|
|
4375
|
-
<script type="text/paperscript" canvas="canvas-
|
|
4472
|
+
<script type="text/paperscript" canvas="canvas-45">
|
|
4376
4473
|
// Loop 30 times:
|
|
4377
4474
|
for (var i = 0; i < 30; i++) {
|
|
4378
4475
|
// Create a circle shaped path at a random position
|
|
@@ -4390,7 +4487,7 @@ for (var i = 0; i < 30; i++) {
|
|
|
4390
4487
|
}
|
|
4391
4488
|
}
|
|
4392
4489
|
</script>
|
|
4393
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
4490
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-45"></canvas></div>
|
|
4394
4491
|
</div>
|
|
4395
4492
|
|
|
4396
4493
|
|
|
@@ -4434,7 +4531,7 @@ for (var i = 0; i < 30; i++) {
|
|
|
4434
4531
|
<div class="button run">Run</div>
|
|
4435
4532
|
</div>
|
|
4436
4533
|
|
|
4437
|
-
<script type="text/paperscript" canvas="canvas-
|
|
4534
|
+
<script type="text/paperscript" canvas="canvas-46">
|
|
4438
4535
|
// Create a circle shaped path at the center of the view:
|
|
4439
4536
|
var path = new Path.Circle({
|
|
4440
4537
|
center: view.center,
|
|
@@ -4448,7 +4545,7 @@ path.onDoubleClick = function(event) {
|
|
|
4448
4545
|
this.fillColor = 'red';
|
|
4449
4546
|
}
|
|
4450
4547
|
</script>
|
|
4451
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
4548
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-46"></canvas></div>
|
|
4452
4549
|
</div>
|
|
4453
4550
|
|
|
4454
4551
|
|
|
@@ -4460,7 +4557,7 @@ path.onDoubleClick = function(event) {
|
|
|
4460
4557
|
<div class="button run">Run</div>
|
|
4461
4558
|
</div>
|
|
4462
4559
|
|
|
4463
|
-
<script type="text/paperscript" canvas="canvas-
|
|
4560
|
+
<script type="text/paperscript" canvas="canvas-47">
|
|
4464
4561
|
// Loop 30 times:
|
|
4465
4562
|
for (var i = 0; i < 30; i++) {
|
|
4466
4563
|
// Create a circle shaped path at a random position
|
|
@@ -4478,7 +4575,7 @@ for (var i = 0; i < 30; i++) {
|
|
|
4478
4575
|
}
|
|
4479
4576
|
}
|
|
4480
4577
|
</script>
|
|
4481
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
4578
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-47"></canvas></div>
|
|
4482
4579
|
</div>
|
|
4483
4580
|
|
|
4484
4581
|
|
|
@@ -4522,7 +4619,7 @@ for (var i = 0; i < 30; i++) {
|
|
|
4522
4619
|
<div class="button run">Run</div>
|
|
4523
4620
|
</div>
|
|
4524
4621
|
|
|
4525
|
-
<script type="text/paperscript" canvas="canvas-
|
|
4622
|
+
<script type="text/paperscript" canvas="canvas-48">
|
|
4526
4623
|
// Create a circle shaped path at the center of the view:
|
|
4527
4624
|
var path = new Path.Circle({
|
|
4528
4625
|
center: view.center,
|
|
@@ -4536,7 +4633,7 @@ path.onMouseMove = function(event) {
|
|
|
4536
4633
|
this.opacity = Math.random();
|
|
4537
4634
|
}
|
|
4538
4635
|
</script>
|
|
4539
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
4636
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-48"></canvas></div>
|
|
4540
4637
|
</div>
|
|
4541
4638
|
|
|
4542
4639
|
|
|
@@ -4580,7 +4677,7 @@ path.onMouseMove = function(event) {
|
|
|
4580
4677
|
<div class="button run">Run</div>
|
|
4581
4678
|
</div>
|
|
4582
4679
|
|
|
4583
|
-
<script type="text/paperscript" canvas="canvas-
|
|
4680
|
+
<script type="text/paperscript" canvas="canvas-49">
|
|
4584
4681
|
// Create a circle shaped path at the center of the view:
|
|
4585
4682
|
var path = new Path.Circle({
|
|
4586
4683
|
center: view.center,
|
|
@@ -4598,7 +4695,7 @@ path.onMouseLeave = function(event) {
|
|
|
4598
4695
|
this.fillColor = 'black';
|
|
4599
4696
|
}
|
|
4600
4697
|
</script>
|
|
4601
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
4698
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-49"></canvas></div>
|
|
4602
4699
|
</div>
|
|
4603
4700
|
|
|
4604
4701
|
|
|
@@ -4610,7 +4707,7 @@ path.onMouseLeave = function(event) {
|
|
|
4610
4707
|
<div class="button run">Run</div>
|
|
4611
4708
|
</div>
|
|
4612
4709
|
|
|
4613
|
-
<script type="text/paperscript" canvas="canvas-
|
|
4710
|
+
<script type="text/paperscript" canvas="canvas-50">
|
|
4614
4711
|
function enter(event) {
|
|
4615
4712
|
this.fillColor = 'red';
|
|
4616
4713
|
}
|
|
@@ -4632,7 +4729,7 @@ function onMouseDown(event) {
|
|
|
4632
4729
|
path.onMouseLeave = leave;
|
|
4633
4730
|
}
|
|
4634
4731
|
</script>
|
|
4635
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
4732
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-50"></canvas></div>
|
|
4636
4733
|
</div>
|
|
4637
4734
|
|
|
4638
4735
|
|
|
@@ -4676,7 +4773,7 @@ function onMouseDown(event) {
|
|
|
4676
4773
|
<div class="button run">Run</div>
|
|
4677
4774
|
</div>
|
|
4678
4775
|
|
|
4679
|
-
<script type="text/paperscript" canvas="canvas-
|
|
4776
|
+
<script type="text/paperscript" canvas="canvas-51">
|
|
4680
4777
|
// Create a circle shaped path at the center of the view:
|
|
4681
4778
|
var path = new Path.Circle({
|
|
4682
4779
|
center: view.center,
|
|
@@ -4689,7 +4786,7 @@ path.onMouseLeave = function(event) {
|
|
|
4689
4786
|
this.fillColor = 'red';
|
|
4690
4787
|
}
|
|
4691
4788
|
</script>
|
|
4692
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
4789
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-51"></canvas></div>
|
|
4693
4790
|
</div>
|
|
4694
4791
|
|
|
4695
4792
|
|
|
@@ -4748,7 +4845,7 @@ path.onMouseLeave = function(event) {
|
|
|
4748
4845
|
<div class="button run">Run</div>
|
|
4749
4846
|
</div>
|
|
4750
4847
|
|
|
4751
|
-
<script type="text/paperscript" canvas="canvas-
|
|
4848
|
+
<script type="text/paperscript" canvas="canvas-52">
|
|
4752
4849
|
var circle = new Path.Circle({
|
|
4753
4850
|
center: [80, 50],
|
|
4754
4851
|
radius: 35
|
|
@@ -4761,7 +4858,7 @@ circle.set({
|
|
|
4761
4858
|
selected: true
|
|
4762
4859
|
});
|
|
4763
4860
|
</script>
|
|
4764
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
4861
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-52"></canvas></div>
|
|
4765
4862
|
</div>
|
|
4766
4863
|
|
|
4767
4864
|
|
|
@@ -4817,7 +4914,7 @@ circle.set({
|
|
|
4817
4914
|
<div class="button run">Run</div>
|
|
4818
4915
|
</div>
|
|
4819
4916
|
|
|
4820
|
-
<script type="text/paperscript" canvas="canvas-
|
|
4917
|
+
<script type="text/paperscript" canvas="canvas-53">
|
|
4821
4918
|
var circle = new Path.Circle({
|
|
4822
4919
|
center: [50, 50],
|
|
4823
4920
|
radius: 10,
|
|
@@ -4832,7 +4929,7 @@ for (var i = 0; i < 20; i++) {
|
|
|
4832
4929
|
copy.position.x += i * copy.bounds.width;
|
|
4833
4930
|
}
|
|
4834
4931
|
</script>
|
|
4835
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
4932
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-53"></canvas></div>
|
|
4836
4933
|
</div>
|
|
4837
4934
|
|
|
4838
4935
|
|
|
@@ -4958,7 +5055,7 @@ for (var i = 0; i < 20; i++) {
|
|
|
4958
5055
|
<div class="button run">Run</div>
|
|
4959
5056
|
</div>
|
|
4960
5057
|
|
|
4961
|
-
<script type="text/paperscript" canvas="canvas-
|
|
5058
|
+
<script type="text/paperscript" canvas="canvas-54">
|
|
4962
5059
|
var circle = new Path.Circle({
|
|
4963
5060
|
center: [50, 50],
|
|
4964
5061
|
radius: 5,
|
|
@@ -4975,7 +5072,7 @@ raster.position.x += 100;
|
|
|
4975
5072
|
circle.scale(5);
|
|
4976
5073
|
raster.scale(5);
|
|
4977
5074
|
</script>
|
|
4978
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
5075
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-54"></canvas></div>
|
|
4979
5076
|
</div>
|
|
4980
5077
|
|
|
4981
5078
|
|
|
@@ -5029,7 +5126,7 @@ raster.scale(5);
|
|
|
5029
5126
|
<div class="button run">Run</div>
|
|
5030
5127
|
</div>
|
|
5031
5128
|
|
|
5032
|
-
<script type="text/paperscript" canvas="canvas-
|
|
5129
|
+
<script type="text/paperscript" canvas="canvas-55">
|
|
5033
5130
|
var path = new Path.Star({
|
|
5034
5131
|
center: [50, 50],
|
|
5035
5132
|
points: 12,
|
|
@@ -5050,7 +5147,7 @@ function onMouseDown(event) {
|
|
|
5050
5147
|
}
|
|
5051
5148
|
}
|
|
5052
5149
|
</script>
|
|
5053
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
5150
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-55"></canvas></div>
|
|
5054
5151
|
</div>
|
|
5055
5152
|
|
|
5056
5153
|
|
|
@@ -5150,22 +5247,22 @@ function onMouseDown(event) {
|
|
|
5150
5247
|
<div class="member-description hidden">
|
|
5151
5248
|
<div class="member-text">
|
|
5152
5249
|
<p>Performs a hit-test on the item and its children (if it is a <a href="../classes/Group.html"><tt>Group</tt></a> or <a href="../classes/Layer.html"><tt>Layer</tt></a>) at the location of the specified point, returning the first found hit.</p>
|
|
5153
|
-
<p>The options object allows you to control the specifics of the hit-
|
|
5250
|
+
<p>The options object allows you to control the specifics of the hit-test. Without options, <code>fill</code>, <code>stroke</code> and <code>segments</code> are hit-tested. As soon as an options object is passed, only the hit-tests that it sets to <code>true</code> are performed. It may contain a combination of the following values:</p>
|
|
5154
5251
|
<ul class="member-list">
|
|
5155
5252
|
<h4>Options:</h4>
|
|
5156
|
-
<li><tt>options.tolerance: <tt>Number</tt></tt> — the tolerance of the hit-test — default: <tt><a href="../classes/PaperScope.html#settings"><tt>paperScope.settings</tt></a>.hitTolerance</tt></li>
|
|
5253
|
+
<li><tt>options.tolerance: <tt>Number</tt></tt> — the tolerance of the hit-test, in project coordinates — default: <tt><a href="../classes/PaperScope.html#settings"><tt>paperScope.settings</tt></a>.hitTolerance</tt></li>
|
|
5157
5254
|
<li><tt>options.class: <tt>Function</tt></tt> — only hit-test against a specific item class, or any of its sub-classes, by providing the constructor function against which an <code>instanceof</code> check is performed: <tt>Group</tt>, <tt>Layer</tt>, <tt>Path</tt>, <tt>CompoundPath</tt>, <tt>Shape</tt>, <tt>Raster</tt>, <tt>SymbolItem</tt>, <tt>PointText</tt>, …</li>
|
|
5158
5255
|
<li><tt>options.match: <tt>Function</tt></tt> — a match function to be called for each found hit result: Return <code>true</code> to return the result, <code>false</code> to keep searching</li>
|
|
5159
|
-
<li><tt>options.fill: <tt>Boolean</tt></tt> — hit-test the fill of items
|
|
5160
|
-
<li><tt>options.stroke: <tt>Boolean</tt></tt> — hit-test the stroke of path
|
|
5161
|
-
<li><tt>options.segments: <tt>Boolean</tt></tt> — hit-test for <a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of
|
|
5256
|
+
<li><tt>options.fill: <tt>Boolean</tt></tt> — hit-test the fill of items</li>
|
|
5257
|
+
<li><tt>options.stroke: <tt>Boolean</tt></tt> — hit-test the stroke of path items, taking into account the setting of stroke color and width</li>
|
|
5258
|
+
<li><tt>options.segments: <tt>Boolean</tt></tt> — hit-test for <a href="../classes/Segment.html#point"><tt>segment.point</tt></a> of <a href="../classes/Path.html"><tt>Path</tt></a> items</li>
|
|
5162
5259
|
<li><tt>options.curves: <tt>Boolean</tt></tt> — hit-test the curves of path items, without taking the stroke color or width into account</li>
|
|
5163
5260
|
<li><tt>options.handles: <tt>Boolean</tt></tt> — hit-test for the handles (<a href="../classes/Segment.html#handlein"><tt>segment.handleIn</tt></a> / <a href="../classes/Segment.html#handleout"><tt>segment.handleOut</tt></a>) of path segments.</li>
|
|
5164
5261
|
<li><tt>options.ends: <tt>Boolean</tt></tt> — only hit-test for the first or last segment points of open path items</li>
|
|
5165
5262
|
<li><tt>options.position: <tt>Boolean</tt></tt> — hit-test the <a href="../classes/Item.html#position"><tt>item.position</tt></a> of of items, which depends on the setting of <a href="../classes/Item.html#pivot"><tt>item.pivot</tt></a></li>
|
|
5166
5263
|
<li><tt>options.center: <tt>Boolean</tt></tt> — hit-test the <a href="../classes/Rectangle.html#center"><tt>rectangle.center</tt></a> of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>)</li>
|
|
5167
5264
|
<li><tt>options.bounds: <tt>Boolean</tt></tt> — hit-test the corners and side-centers of the bounding rectangle of items (<a href="../classes/Item.html#bounds"><tt>item.bounds</tt></a>)</li>
|
|
5168
|
-
<li><tt>options.guides: <tt>Boolean</tt></tt> — hit-test items that have <
|
|
5265
|
+
<li><tt>options.guides: <tt>Boolean</tt></tt> — only hit-test items that have <a href="../classes/Item.html#guide"><tt>item.guide</tt></a> set to <code>true</code></li>
|
|
5169
5266
|
<li><tt>options.selected: <tt>Boolean</tt></tt> — only hit selected items</li>
|
|
5170
5267
|
</ul>
|
|
5171
5268
|
|
|
@@ -5404,7 +5501,7 @@ function onMouseDown(event) {
|
|
|
5404
5501
|
<h4>Returns:</h4>
|
|
5405
5502
|
|
|
5406
5503
|
<li>
|
|
5407
|
-
<tt>Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects</tt> — the list of matching descendant items
|
|
5504
|
+
<tt>Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects</tt> — the list of matching descendant items, in their stacking order from bottom to top, with each item listed before its own descendants
|
|
5408
5505
|
</li>
|
|
5409
5506
|
|
|
5410
5507
|
|
|
@@ -5577,6 +5674,8 @@ function onMouseDown(event) {
|
|
|
5577
5674
|
<li><tt>options.precision: <tt>Number</tt></tt> — the amount of fractional digits in numbers used in SVG data — default: <tt>5</tt></li>
|
|
5578
5675
|
<li><tt>options.matchShapes: <tt>Boolean</tt></tt> — whether path items should tried to be converted to SVG shape items (rect, circle, ellipse, line, polyline, polygon), if their geometries match — default: <tt>false</tt></li>
|
|
5579
5676
|
<li><tt>options.embedImages: <tt>Boolean</tt></tt> — whether raster images should be embedded as base64 data inlined in the xlink:href attribute, or kept as a link to their external URL. — default: <tt>true</tt></li>
|
|
5677
|
+
<li><tt>options.reuseImages: <tt>Boolean</tt></tt> — whether raster images with the same content should only be exported once into the <code><defs></code> element, and placed through <code><use></code> elements referencing it — default: <tt>false</tt></li>
|
|
5678
|
+
<li><tt>options.idPrefix: <tt>String</tt></tt> — a prefix for the ids generated for definitions such as gradients, clip paths and symbols, to keep them unique when several exported SVGs are placed in one document — default: <tt>’’</tt></li>
|
|
5580
5679
|
<li><tt>options.reduceAttributes: <tt>Boolean</tt></tt> — wether to only include style attributes in the SVG output that differ from their parents, or to always include them (much faster but leading to redundancies). — default: <tt>true</tt></li>
|
|
5581
5680
|
</ul>
|
|
5582
5681
|
|
|
@@ -5619,9 +5718,13 @@ function onMouseDown(event) {
|
|
|
5619
5718
|
<div class="member-description hidden">
|
|
5620
5719
|
<div class="member-text">
|
|
5621
5720
|
<p>Converts the provided SVG content into Paper.js items and adds them to the this item’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
|
+
<p><code><symbol></code> elements are imported as <a href="../classes/SymbolDefinition.html"><tt>SymbolDefinition</tt></a> items, and the <code><use></code> elements that place them as <a href="../classes/SymbolItem.html"><tt>SymbolItem</tt></a> items. The styles that <code><use></code> elements inherit don’t reach the symbols’ content.</p>
|
|
5622
5722
|
<ul class="member-list">
|
|
5623
5723
|
<h4>Options:</h4>
|
|
5624
5724
|
<li><tt>options.expandShapes: <tt>Boolean</tt></tt> — whether imported shape items should be expanded to path items — default: <tt>false</tt></li>
|
|
5725
|
+
<li>[options.crossOrigin] {String} the {@link Raster#crossOrigin}
|
|
5726
|
+
value of the rasters created for `<image>` elements, to load their
|
|
5727
|
+
images with CORS</li>
|
|
5625
5728
|
<li><tt>options.onLoad: <tt>Function</tt></tt> — the callback function to call once the SVG content is loaded from the given URL receiving two arguments: the converted <code>item</code> and the original <code>svg</code> data as a string. Only required when loading from external resources.</li>
|
|
5626
5729
|
<li><tt>options.onError: <tt>Function</tt></tt> — the callback function to call if an error occurs during loading. Only required when loading from external resources.</li>
|
|
5627
5730
|
<li><tt>options.insert: <tt>Boolean</tt></tt> — whether the imported items should be added to the item that <code>importSVG()</code> is called on — default: <tt>true</tt></li>
|
|
@@ -6097,9 +6200,9 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
|
|
|
6097
6200
|
</div>
|
|
6098
6201
|
|
|
6099
6202
|
|
|
6100
|
-
<div id="reduce
|
|
6203
|
+
<div id="reduce" class="member">
|
|
6101
6204
|
<div class="member-link">
|
|
6102
|
-
<a name="reduce
|
|
6205
|
+
<a name="reduce" href="#reduce"><tt><b>reduce</b>([options])</tt></a>
|
|
6103
6206
|
</div>
|
|
6104
6207
|
<div class="member-description hidden">
|
|
6105
6208
|
<div class="member-text">
|
|
@@ -6111,9 +6214,9 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
|
|
|
6111
6214
|
|
|
6112
6215
|
<li>
|
|
6113
6216
|
<tt>options:</tt>
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
|
|
6217
|
+
<tt>Object</tt>
|
|
6218
|
+
— the options passed on to <a href="../classes/Path.html#reduce-options"><tt>path.reduce(options)</tt></a>
|
|
6219
|
+
— optional
|
|
6117
6220
|
</li>
|
|
6118
6221
|
|
|
6119
6222
|
</ul>
|
|
@@ -6502,7 +6605,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
|
|
|
6502
6605
|
</div>
|
|
6503
6606
|
<div class="member-description hidden">
|
|
6504
6607
|
<div class="member-text">
|
|
6505
|
-
<p>Checks if this item is above the specified item in the stacking order of the project.</p>
|
|
6608
|
+
<p>Checks if this item is above the specified item in the stacking order of the project. If one item is a descendant of the other, neither is above the other and <code>false</code> is returned.</p>
|
|
6506
6609
|
|
|
6507
6610
|
|
|
6508
6611
|
<ul class="member-list">
|
|
@@ -6543,7 +6646,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
|
|
|
6543
6646
|
</div>
|
|
6544
6647
|
<div class="member-description hidden">
|
|
6545
6648
|
<div class="member-text">
|
|
6546
|
-
<p>Checks if the item is below the specified item in the stacking order of the project.</p>
|
|
6649
|
+
<p>Checks if the item is below the specified item in the stacking order of the project. If one item is a descendant of the other, neither is below the other and <code>false</code> is returned.</p>
|
|
6547
6650
|
|
|
6548
6651
|
|
|
6549
6652
|
<ul class="member-list">
|
|
@@ -6905,7 +7008,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
|
|
|
6905
7008
|
<div class="button run">Run</div>
|
|
6906
7009
|
</div>
|
|
6907
7010
|
|
|
6908
|
-
<script type="text/paperscript" canvas="canvas-
|
|
7011
|
+
<script type="text/paperscript" canvas="canvas-56">
|
|
6909
7012
|
// Create a rectangle shaped path with its top left
|
|
6910
7013
|
// point at {x: 80, y: 25} and a size of {width: 50, height: 50}:
|
|
6911
7014
|
var path = new Path.Rectangle(new Point(80, 25), new Size(50, 50));
|
|
@@ -6914,7 +7017,7 @@ path.fillColor = 'black';
|
|
|
6914
7017
|
// Rotate the path by 30 degrees:
|
|
6915
7018
|
path.rotate(30);
|
|
6916
7019
|
</script>
|
|
6917
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
7020
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-56"></canvas></div>
|
|
6918
7021
|
</div>
|
|
6919
7022
|
|
|
6920
7023
|
|
|
@@ -6926,7 +7029,7 @@ path.rotate(30);
|
|
|
6926
7029
|
<div class="button run">Run</div>
|
|
6927
7030
|
</div>
|
|
6928
7031
|
|
|
6929
|
-
<script type="text/paperscript" canvas="canvas-
|
|
7032
|
+
<script type="text/paperscript" canvas="canvas-57">
|
|
6930
7033
|
// Create a rectangle shaped path with its top left
|
|
6931
7034
|
// point at {x: 175, y: 50} and a size of {width: 100, height: 100}:
|
|
6932
7035
|
var topLeft = new Point(175, 50);
|
|
@@ -6948,7 +7051,7 @@ function onFrame(event) {
|
|
|
6948
7051
|
path.rotate(3, view.center);
|
|
6949
7052
|
}
|
|
6950
7053
|
</script>
|
|
6951
|
-
<div class="canvas"><canvas width="516" height="200" id="canvas-
|
|
7054
|
+
<div class="canvas"><canvas width="516" height="200" id="canvas-57"></canvas></div>
|
|
6952
7055
|
</div>
|
|
6953
7056
|
|
|
6954
7057
|
|
|
@@ -6997,7 +7100,7 @@ function onFrame(event) {
|
|
|
6997
7100
|
<div class="button run">Run</div>
|
|
6998
7101
|
</div>
|
|
6999
7102
|
|
|
7000
|
-
<script type="text/paperscript" canvas="canvas-
|
|
7103
|
+
<script type="text/paperscript" canvas="canvas-58">
|
|
7001
7104
|
// Create a circle shaped path at { x: 80, y: 50 }
|
|
7002
7105
|
// with a radius of 20:
|
|
7003
7106
|
var circle = new Path.Circle({
|
|
@@ -7009,7 +7112,7 @@ var circle = new Path.Circle({
|
|
|
7009
7112
|
// Scale the path by 150% from its center point
|
|
7010
7113
|
circle.scale(1.5);
|
|
7011
7114
|
</script>
|
|
7012
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
7115
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-58"></canvas></div>
|
|
7013
7116
|
</div>
|
|
7014
7117
|
|
|
7015
7118
|
|
|
@@ -7021,7 +7124,7 @@ circle.scale(1.5);
|
|
|
7021
7124
|
<div class="button run">Run</div>
|
|
7022
7125
|
</div>
|
|
7023
7126
|
|
|
7024
|
-
<script type="text/paperscript" canvas="canvas-
|
|
7127
|
+
<script type="text/paperscript" canvas="canvas-59">
|
|
7025
7128
|
// Create a circle shaped path at { x: 80, y: 50 }
|
|
7026
7129
|
// with a radius of 20:
|
|
7027
7130
|
var circle = new Path.Circle({
|
|
@@ -7033,7 +7136,7 @@ var circle = new Path.Circle({
|
|
|
7033
7136
|
// Scale the path 150% from its bottom left corner
|
|
7034
7137
|
circle.scale(1.5, circle.bounds.bottomLeft);
|
|
7035
7138
|
</script>
|
|
7036
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
7139
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-59"></canvas></div>
|
|
7037
7140
|
</div>
|
|
7038
7141
|
|
|
7039
7142
|
|
|
@@ -7089,7 +7192,7 @@ circle.scale(1.5, circle.bounds.bottomLeft);
|
|
|
7089
7192
|
<div class="button run">Run</div>
|
|
7090
7193
|
</div>
|
|
7091
7194
|
|
|
7092
|
-
<script type="text/paperscript" canvas="canvas-
|
|
7195
|
+
<script type="text/paperscript" canvas="canvas-60">
|
|
7093
7196
|
// Create a circle shaped path at { x: 100, y: 50 }
|
|
7094
7197
|
// with a radius of 20:
|
|
7095
7198
|
var circle = new Path.Circle({
|
|
@@ -7101,7 +7204,7 @@ var circle = new Path.Circle({
|
|
|
7101
7204
|
// Scale the path horizontally by 300%
|
|
7102
7205
|
circle.scale(3, 1);
|
|
7103
7206
|
</script>
|
|
7104
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
7207
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-60"></canvas></div>
|
|
7105
7208
|
</div>
|
|
7106
7209
|
|
|
7107
7210
|
|
|
@@ -7501,11 +7604,11 @@ circle.scale(3, 1);
|
|
|
7501
7604
|
|
|
7502
7605
|
<div id="fitbounds-rectangle" class="member">
|
|
7503
7606
|
<div class="member-link">
|
|
7504
|
-
<a name="fitbounds-rectangle" href="#fitbounds-rectangle"><tt><b>fitBounds</b>(rectangle[,
|
|
7607
|
+
<a name="fitbounds-rectangle" href="#fitbounds-rectangle"><tt><b>fitBounds</b>(rectangle[, fit])</tt></a>
|
|
7505
7608
|
</div>
|
|
7506
7609
|
<div class="member-description hidden">
|
|
7507
7610
|
<div class="member-text">
|
|
7508
|
-
<p>Transform the item so that its <a href="../classes/Item.html#bounds"><tt>bounds</tt></a>
|
|
7611
|
+
<p>Transform the item so that its <a href="../classes/Item.html#bounds"><tt>bounds</tt></a> are centered in the specified rectangle and fitted to it as described by <code>fit</code>.</p>
|
|
7509
7612
|
|
|
7510
7613
|
|
|
7511
7614
|
<ul class="member-list">
|
|
@@ -7519,10 +7622,10 @@ circle.scale(3, 1);
|
|
|
7519
7622
|
</li>
|
|
7520
7623
|
|
|
7521
7624
|
<li>
|
|
7522
|
-
<tt>
|
|
7523
|
-
<tt>Boolean</tt>
|
|
7524
|
-
|
|
7525
|
-
— optional, default: <tt
|
|
7625
|
+
<tt>fit:</tt>
|
|
7626
|
+
<tt>String</tt>⟋<tt>Boolean</tt>
|
|
7627
|
+
— how to fit the item, as in CSS’s <code>object-fit</code>: <code>'contain'</code> fits all of it within the rectangle, <code>'cover'</code> makes it cover the whole rectangle, and <code>'fill'</code> stretches it to the rectangle, changing its aspect ratio. The deprecated <code>true</code> and <code>false</code> stand for <code>'cover'</code> and <code>'contain'</code>.
|
|
7628
|
+
— optional, default: <tt>‘contain’</tt>
|
|
7526
7629
|
</li>
|
|
7527
7630
|
|
|
7528
7631
|
</ul>
|
|
@@ -7539,7 +7642,7 @@ circle.scale(3, 1);
|
|
|
7539
7642
|
<div class="button run">Run</div>
|
|
7540
7643
|
</div>
|
|
7541
7644
|
|
|
7542
|
-
<script type="text/paperscript" canvas="canvas-
|
|
7645
|
+
<script type="text/paperscript" canvas="canvas-61">
|
|
7543
7646
|
// Create a rectangle shaped path with its top left corner
|
|
7544
7647
|
// at {x: 80, y: 25} and a size of {width: 75, height: 50}:
|
|
7545
7648
|
var path = new Path.Rectangle({
|
|
@@ -7560,11 +7663,11 @@ var circlePath = new Path.Circle({
|
|
|
7560
7663
|
// the rectangular path:
|
|
7561
7664
|
circlePath.fitBounds(path.bounds);
|
|
7562
7665
|
</script>
|
|
7563
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
7666
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-61"></canvas></div>
|
|
7564
7667
|
</div>
|
|
7565
7668
|
|
|
7566
7669
|
|
|
7567
|
-
<h4>Example:<span class="description">Fitting an item to the bounding rectangle of another item's bounding rectangle
|
|
7670
|
+
<h4>Example:<span class="description">Fitting an item to the bounding rectangle of another item's bounding rectangle, covering all of it:</span></h4>
|
|
7568
7671
|
|
|
7569
7672
|
<div class="paperscript split">
|
|
7570
7673
|
|
|
@@ -7572,7 +7675,7 @@ circlePath.fitBounds(path.bounds);
|
|
|
7572
7675
|
<div class="button run">Run</div>
|
|
7573
7676
|
</div>
|
|
7574
7677
|
|
|
7575
|
-
<script type="text/paperscript" canvas="canvas-
|
|
7678
|
+
<script type="text/paperscript" canvas="canvas-62">
|
|
7576
7679
|
// Create a rectangle shaped path with its top left corner
|
|
7577
7680
|
// at {x: 80, y: 25} and a size of {width: 75, height: 50}:
|
|
7578
7681
|
var path = new Path.Rectangle({
|
|
@@ -7591,9 +7694,9 @@ var circlePath = new Path.Circle({
|
|
|
7591
7694
|
|
|
7592
7695
|
// Fit the circlePath to the bounding rectangle of
|
|
7593
7696
|
// the rectangular path:
|
|
7594
|
-
circlePath.fitBounds(path.bounds,
|
|
7697
|
+
circlePath.fitBounds(path.bounds, 'cover');
|
|
7595
7698
|
</script>
|
|
7596
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
7699
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-62"></canvas></div>
|
|
7597
7700
|
</div>
|
|
7598
7701
|
|
|
7599
7702
|
|
|
@@ -7605,7 +7708,7 @@ circlePath.fitBounds(path.bounds, true);
|
|
|
7605
7708
|
<div class="button run">Run</div>
|
|
7606
7709
|
</div>
|
|
7607
7710
|
|
|
7608
|
-
<script type="text/paperscript" canvas="canvas-
|
|
7711
|
+
<script type="text/paperscript" canvas="canvas-63">
|
|
7609
7712
|
var path = new Path.Circle({
|
|
7610
7713
|
center: [80, 50],
|
|
7611
7714
|
radius: 30,
|
|
@@ -7615,7 +7718,7 @@ var path = new Path.Circle({
|
|
|
7615
7718
|
// Fit the path to the bounding rectangle of the view:
|
|
7616
7719
|
path.fitBounds(view.bounds);
|
|
7617
7720
|
</script>
|
|
7618
|
-
<div class="canvas"><canvas width="516" height="200" id="canvas-
|
|
7721
|
+
<div class="canvas"><canvas width="516" height="200" id="canvas-63"></canvas></div>
|
|
7619
7722
|
</div>
|
|
7620
7723
|
|
|
7621
7724
|
|
|
@@ -7676,7 +7779,7 @@ path.fitBounds(view.bounds);
|
|
|
7676
7779
|
<div class="button run">Run</div>
|
|
7677
7780
|
</div>
|
|
7678
7781
|
|
|
7679
|
-
<script type="text/paperscript" canvas="canvas-
|
|
7782
|
+
<script type="text/paperscript" canvas="canvas-64">
|
|
7680
7783
|
// Create a circle shaped path at the center of the view:
|
|
7681
7784
|
var path = new Path.Circle({
|
|
7682
7785
|
center: view.center,
|
|
@@ -7694,7 +7797,7 @@ path.on('mouseleave', function() {
|
|
|
7694
7797
|
this.fillColor = 'black';
|
|
7695
7798
|
});
|
|
7696
7799
|
</script>
|
|
7697
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
7800
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-64"></canvas></div>
|
|
7698
7801
|
</div>
|
|
7699
7802
|
|
|
7700
7803
|
|
|
@@ -7746,7 +7849,7 @@ path.on('mouseleave', function() {
|
|
|
7746
7849
|
<div class="button run">Run</div>
|
|
7747
7850
|
</div>
|
|
7748
7851
|
|
|
7749
|
-
<script type="text/paperscript" canvas="canvas-
|
|
7852
|
+
<script type="text/paperscript" canvas="canvas-65">
|
|
7750
7853
|
// Create a circle shaped path at the center of the view:
|
|
7751
7854
|
var path = new Path.Circle({
|
|
7752
7855
|
center: view.center,
|
|
@@ -7764,7 +7867,7 @@ path.on({
|
|
|
7764
7867
|
}
|
|
7765
7868
|
});
|
|
7766
7869
|
</script>
|
|
7767
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
7870
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-65"></canvas></div>
|
|
7768
7871
|
</div>
|
|
7769
7872
|
|
|
7770
7873
|
|
|
@@ -7776,7 +7879,7 @@ path.on({
|
|
|
7776
7879
|
<div class="button run">Run</div>
|
|
7777
7880
|
</div>
|
|
7778
7881
|
|
|
7779
|
-
<script type="text/paperscript" canvas="canvas-
|
|
7882
|
+
<script type="text/paperscript" canvas="canvas-66">
|
|
7780
7883
|
var pathHandlers = {
|
|
7781
7884
|
mouseenter: function(event) {
|
|
7782
7885
|
this.fillColor = 'red';
|
|
@@ -7799,7 +7902,7 @@ function onMouseDown(event) {
|
|
|
7799
7902
|
path.on(pathHandlers);
|
|
7800
7903
|
}
|
|
7801
7904
|
</script>
|
|
7802
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
7905
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-66"></canvas></div>
|
|
7803
7906
|
</div>
|
|
7804
7907
|
|
|
7805
7908
|
|
|
@@ -8027,7 +8130,7 @@ function onMouseDown(event) {
|
|
|
8027
8130
|
<div class="button run">Run</div>
|
|
8028
8131
|
</div>
|
|
8029
8132
|
|
|
8030
|
-
<script type="text/paperscript" canvas="canvas-
|
|
8133
|
+
<script type="text/paperscript" canvas="canvas-67">
|
|
8031
8134
|
function onMouseDrag(event) {
|
|
8032
8135
|
// Create a circle shaped path at the mouse position,
|
|
8033
8136
|
// with a radius of 10:
|
|
@@ -8044,7 +8147,7 @@ function onMouseDrag(event) {
|
|
|
8044
8147
|
});
|
|
8045
8148
|
}
|
|
8046
8149
|
</script>
|
|
8047
|
-
<div class="canvas"><canvas width="516" height="200" id="canvas-
|
|
8150
|
+
<div class="canvas"><canvas width="516" height="200" id="canvas-67"></canvas></div>
|
|
8048
8151
|
</div>
|
|
8049
8152
|
|
|
8050
8153
|
|
|
@@ -8074,7 +8177,7 @@ function onMouseDrag(event) {
|
|
|
8074
8177
|
<div class="button run">Run</div>
|
|
8075
8178
|
</div>
|
|
8076
8179
|
|
|
8077
|
-
<script type="text/paperscript" canvas="canvas-
|
|
8180
|
+
<script type="text/paperscript" canvas="canvas-68">
|
|
8078
8181
|
function onMouseMove(event) {
|
|
8079
8182
|
// Create a circle shaped path at the mouse position,
|
|
8080
8183
|
// with a radius of 10:
|
|
@@ -8088,7 +8191,7 @@ function onMouseMove(event) {
|
|
|
8088
8191
|
path.removeOnMove();
|
|
8089
8192
|
}
|
|
8090
8193
|
</script>
|
|
8091
|
-
<div class="canvas"><canvas width="516" height="200" id="canvas-
|
|
8194
|
+
<div class="canvas"><canvas width="516" height="200" id="canvas-68"></canvas></div>
|
|
8092
8195
|
</div>
|
|
8093
8196
|
|
|
8094
8197
|
|
|
@@ -8118,7 +8221,7 @@ function onMouseMove(event) {
|
|
|
8118
8221
|
<div class="button run">Run</div>
|
|
8119
8222
|
</div>
|
|
8120
8223
|
|
|
8121
|
-
<script type="text/paperscript" canvas="canvas-
|
|
8224
|
+
<script type="text/paperscript" canvas="canvas-69">
|
|
8122
8225
|
function onMouseDown(event) {
|
|
8123
8226
|
// Create a circle shaped path at the mouse position,
|
|
8124
8227
|
// with a radius of 10:
|
|
@@ -8132,7 +8235,7 @@ function onMouseDown(event) {
|
|
|
8132
8235
|
path.removeOnDown();
|
|
8133
8236
|
}
|
|
8134
8237
|
</script>
|
|
8135
|
-
<div class="canvas"><canvas width="516" height="200" id="canvas-
|
|
8238
|
+
<div class="canvas"><canvas width="516" height="200" id="canvas-69"></canvas></div>
|
|
8136
8239
|
</div>
|
|
8137
8240
|
|
|
8138
8241
|
|
|
@@ -8162,7 +8265,7 @@ function onMouseDown(event) {
|
|
|
8162
8265
|
<div class="button run">Run</div>
|
|
8163
8266
|
</div>
|
|
8164
8267
|
|
|
8165
|
-
<script type="text/paperscript" canvas="canvas-
|
|
8268
|
+
<script type="text/paperscript" canvas="canvas-70">
|
|
8166
8269
|
function onMouseDrag(event) {
|
|
8167
8270
|
// Create a circle shaped path at the mouse position,
|
|
8168
8271
|
// with a radius of 10:
|
|
@@ -8176,7 +8279,7 @@ function onMouseDrag(event) {
|
|
|
8176
8279
|
path.removeOnDrag();
|
|
8177
8280
|
}
|
|
8178
8281
|
</script>
|
|
8179
|
-
<div class="canvas"><canvas width="516" height="200" id="canvas-
|
|
8282
|
+
<div class="canvas"><canvas width="516" height="200" id="canvas-70"></canvas></div>
|
|
8180
8283
|
</div>
|
|
8181
8284
|
|
|
8182
8285
|
|
|
@@ -8206,7 +8309,7 @@ function onMouseDrag(event) {
|
|
|
8206
8309
|
<div class="button run">Run</div>
|
|
8207
8310
|
</div>
|
|
8208
8311
|
|
|
8209
|
-
<script type="text/paperscript" canvas="canvas-
|
|
8312
|
+
<script type="text/paperscript" canvas="canvas-71">
|
|
8210
8313
|
function onMouseDown(event) {
|
|
8211
8314
|
// Create a circle shaped path at the mouse position,
|
|
8212
8315
|
// with a radius of 10:
|
|
@@ -8220,7 +8323,7 @@ function onMouseDown(event) {
|
|
|
8220
8323
|
path.removeOnUp();
|
|
8221
8324
|
}
|
|
8222
8325
|
</script>
|
|
8223
|
-
<div class="canvas"><canvas width="516" height="200" id="canvas-
|
|
8326
|
+
<div class="canvas"><canvas width="516" height="200" id="canvas-71"></canvas></div>
|
|
8224
8327
|
</div>
|
|
8225
8328
|
|
|
8226
8329
|
|
|
@@ -8241,7 +8344,7 @@ function onMouseDown(event) {
|
|
|
8241
8344
|
<ul class="member-list">
|
|
8242
8345
|
<h4>Options:</h4>
|
|
8243
8346
|
<li><tt>options.duration: <tt>Number</tt></tt> — the duration of the tweening</li>
|
|
8244
|
-
<li><tt>options.easing: <tt>Function</tt>⟋<tt>String</tt></tt> — an easing function or the type of the easing: <tt>‘linear’ ‘easeInQuad’ ‘easeOutQuad’ ‘easeInOutQuad’ ‘easeInCubic’ ‘easeOutCubic’ ‘easeInOutCubic’ ‘easeInQuart’ ‘easeOutQuart’ ‘easeInOutQuart’ ‘easeInQuint’ ‘easeOutQuint’ ‘easeInOutQuint’</tt> — default: <tt>‘linear’</tt></li>
|
|
8347
|
+
<li><tt>options.easing: <tt>Function</tt>⟋<tt>String</tt></tt> — an easing function or the type of the easing: <tt>‘linear’ ‘easeInQuad’ ‘easeOutQuad’ ‘easeInOutQuad’ ‘easeInCubic’ ‘easeOutCubic’ ‘easeInOutCubic’ ‘easeInQuart’ ‘easeOutQuart’ ‘easeInOutQuart’ ‘easeInQuint’ ‘easeOutQuint’ ‘easeInOutQuint’ ‘easeInSine’ ‘easeOutSine’ ‘easeInOutSine’ ‘easeInExpo’ ‘easeOutExpo’ ‘easeInOutExpo’ ‘easeInCirc’ ‘easeOutCirc’ ‘easeInOutCirc’</tt> — default: <tt>‘linear’</tt></li>
|
|
8245
8348
|
<li><tt>options.start: <tt>Boolean</tt></tt> — whether to start tweening automatically — default: <tt>true</tt></li>
|
|
8246
8349
|
</ul>
|
|
8247
8350
|
|
|
@@ -8293,7 +8396,7 @@ function onMouseDown(event) {
|
|
|
8293
8396
|
<div class="button run">Run</div>
|
|
8294
8397
|
</div>
|
|
8295
8398
|
|
|
8296
|
-
<script type="text/paperscript" canvas="canvas-
|
|
8399
|
+
<script type="text/paperscript" canvas="canvas-72">
|
|
8297
8400
|
var path = new Path.Circle({
|
|
8298
8401
|
radius: view.bounds.height * 0.4,
|
|
8299
8402
|
center: view.center
|
|
@@ -8304,7 +8407,7 @@ path.tween(
|
|
|
8304
8407
|
3000
|
|
8305
8408
|
);
|
|
8306
8409
|
</script>
|
|
8307
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
8410
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-72"></canvas></div>
|
|
8308
8411
|
</div>
|
|
8309
8412
|
|
|
8310
8413
|
|
|
@@ -8316,7 +8419,7 @@ path.tween(
|
|
|
8316
8419
|
<div class="button run">Run</div>
|
|
8317
8420
|
</div>
|
|
8318
8421
|
|
|
8319
|
-
<script type="text/paperscript" canvas="canvas-
|
|
8422
|
+
<script type="text/paperscript" canvas="canvas-73">
|
|
8320
8423
|
var path = new Shape.Rectangle({
|
|
8321
8424
|
fillColor: 'red',
|
|
8322
8425
|
center: [50, view.center.y],
|
|
@@ -8331,7 +8434,7 @@ path.tween({
|
|
|
8331
8434
|
duration: 2000
|
|
8332
8435
|
});
|
|
8333
8436
|
</script>
|
|
8334
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
8437
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-73"></canvas></div>
|
|
8335
8438
|
</div>
|
|
8336
8439
|
|
|
8337
8440
|
|
|
@@ -8397,7 +8500,7 @@ path.tween({
|
|
|
8397
8500
|
<div class="button run">Run</div>
|
|
8398
8501
|
</div>
|
|
8399
8502
|
|
|
8400
|
-
<script type="text/paperscript" canvas="canvas-
|
|
8503
|
+
<script type="text/paperscript" canvas="canvas-74">
|
|
8401
8504
|
var path = new Path.Rectangle({
|
|
8402
8505
|
size: [100, 100],
|
|
8403
8506
|
position: view.center,
|
|
@@ -8411,7 +8514,7 @@ path.tween({
|
|
|
8411
8514
|
'segments[2].point.x': '-= 50'
|
|
8412
8515
|
}, 3000);
|
|
8413
8516
|
</script>
|
|
8414
|
-
<div class="canvas"><canvas width="516" height="200" id="canvas-
|
|
8517
|
+
<div class="canvas"><canvas width="516" height="200" id="canvas-74"></canvas></div>
|
|
8415
8518
|
</div>
|
|
8416
8519
|
|
|
8417
8520
|
|
|
@@ -8470,7 +8573,7 @@ path.tween({
|
|
|
8470
8573
|
<div class="button run">Run</div>
|
|
8471
8574
|
</div>
|
|
8472
8575
|
|
|
8473
|
-
<script type="text/paperscript" canvas="canvas-
|
|
8576
|
+
<script type="text/paperscript" canvas="canvas-75">
|
|
8474
8577
|
var path = new Path.Circle({
|
|
8475
8578
|
fillColor: 'blue',
|
|
8476
8579
|
radius: view.bounds.height * 0.4,
|
|
@@ -8486,7 +8589,7 @@ path.tween(2000).onUpdate = function(event) {
|
|
|
8486
8589
|
path.interpolate(pathFrom, pathTo, event.factor)
|
|
8487
8590
|
};
|
|
8488
8591
|
</script>
|
|
8489
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
8592
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-75"></canvas></div>
|
|
8490
8593
|
</div>
|
|
8491
8594
|
|
|
8492
8595
|
|
|
@@ -8607,7 +8710,7 @@ path.tween(2000).onUpdate = function(event) {
|
|
|
8607
8710
|
<div class="button run">Run</div>
|
|
8608
8711
|
</div>
|
|
8609
8712
|
|
|
8610
|
-
<script type="text/paperscript" canvas="canvas-
|
|
8713
|
+
<script type="text/paperscript" canvas="canvas-76">
|
|
8611
8714
|
var path = new Path.Circle({
|
|
8612
8715
|
fillColor: 'blue',
|
|
8613
8716
|
radius: view.bounds.height * 0.4,
|
|
@@ -8615,7 +8718,7 @@ var path = new Path.Circle({
|
|
|
8615
8718
|
});
|
|
8616
8719
|
path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
|
|
8617
8720
|
</script>
|
|
8618
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
8721
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-76"></canvas></div>
|
|
8619
8722
|
</div>
|
|
8620
8723
|
|
|
8621
8724
|
|
|
@@ -8629,7 +8732,7 @@ path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
|
|
|
8629
8732
|
|
|
8630
8733
|
<!-- =========================== copyright notice ========================== -->
|
|
8631
8734
|
<p class="footer">
|
|
8632
|
-
Paper.js v0.
|
|
8735
|
+
Paper.js v0.13.0<br>
|
|
8633
8736
|
Copyright © 2011—2026 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
|
8634
8737
|
<div class="content-end"></div>
|
|
8635
8738
|
|