paper 0.12.20 → 0.14.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 +318 -0
- package/README.md +45 -26
- package/dist/docs/assets/js/paper.js +1210 -481
- package/dist/docs/classes/ChangeFlag.html +384 -0
- package/dist/docs/classes/Color.html +63 -47
- package/dist/docs/classes/CompoundPath.html +219 -62
- 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 +151 -27
- package/dist/docs/classes/HitResult.html +3 -2
- package/dist/docs/classes/HostItem.html +6721 -0
- package/dist/docs/classes/Item.html +120 -27
- package/dist/docs/classes/Key.html +1 -1
- package/dist/docs/classes/KeyEvent.html +1 -1
- package/dist/docs/classes/Layer.html +151 -27
- package/dist/docs/classes/Matrix.html +1 -1
- package/dist/docs/classes/MouseEvent.html +1 -1
- package/dist/docs/classes/PaperScope.html +88 -1
- package/dist/docs/classes/PaperScript.html +2 -1
- package/dist/docs/classes/Path.html +232 -72
- package/dist/docs/classes/PathItem.html +337 -180
- package/dist/docs/classes/Point.html +143 -21
- package/dist/docs/classes/PointText.html +151 -27
- package/dist/docs/classes/Project.html +201 -8
- package/dist/docs/classes/Raster.html +150 -38
- package/dist/docs/classes/Rectangle.html +12 -11
- package/dist/docs/classes/Segment.html +1 -1
- package/dist/docs/classes/Shape.html +120 -27
- package/dist/docs/classes/Size.html +81 -21
- package/dist/docs/classes/Style.html +35 -3
- package/dist/docs/classes/SymbolDefinition.html +1 -1
- package/dist/docs/classes/SymbolItem.html +121 -28
- package/dist/docs/classes/TextItem.html +151 -27
- package/dist/docs/classes/Tool.html +127 -1
- package/dist/docs/classes/ToolEvent.html +27 -1
- package/dist/docs/classes/Tween.html +1 -1
- package/dist/docs/classes/View.html +345 -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 +1 -1
- package/dist/node/self.js +4 -3
- package/dist/paper-core.js +1182 -465
- package/dist/paper-core.min.js +3 -3
- package/dist/paper-full.js +1210 -481
- package/dist/paper-full.min.js +3 -3
- package/dist/paper-sourced.js +18631 -0
- package/dist/paper.d.ts +606 -78
- package/examples/Rasters/Smoothing.html +1 -1
- package/package.json +6 -17
- package/dist/node/xml.js +0 -40
|
@@ -354,7 +354,8 @@ console.log(point); // { x: 100, y: 50 }</code></pre>
|
|
|
354
354
|
|
|
355
355
|
|
|
356
356
|
<pre><code>var point = new Point(5, 10);
|
|
357
|
-
var result = point + 20;
|
|
357
|
+
var result = point + 20; // PaperScript
|
|
358
|
+
var result = point.add(20); // JavaScript
|
|
358
359
|
console.log(result); // {x: 25, y: 30}</code></pre>
|
|
359
360
|
|
|
360
361
|
</div>
|
|
@@ -395,7 +396,8 @@ console.log(result); // {x: 25, y: 30}</code></pre>
|
|
|
395
396
|
|
|
396
397
|
<pre><code>var point1 = new Point(5, 10);
|
|
397
398
|
var point2 = new Point(10, 20);
|
|
398
|
-
var result = point1 + point2;
|
|
399
|
+
var result = point1 + point2; // PaperScript
|
|
400
|
+
var result = point1.add(point2); // JavaScript
|
|
399
401
|
console.log(result); // {x: 15, y: 30}</code></pre>
|
|
400
402
|
|
|
401
403
|
</div>
|
|
@@ -445,7 +447,8 @@ console.log(result); // {x: 15, y: 30}</code></pre>
|
|
|
445
447
|
|
|
446
448
|
|
|
447
449
|
<pre><code>var point = new Point(10, 20);
|
|
448
|
-
var result = point - 5;
|
|
450
|
+
var result = point - 5; // PaperScript
|
|
451
|
+
var result = point.subtract(5); // JavaScript
|
|
449
452
|
console.log(result); // {x: 5, y: 15}</code></pre>
|
|
450
453
|
|
|
451
454
|
</div>
|
|
@@ -486,7 +489,8 @@ console.log(result); // {x: 5, y: 15}</code></pre>
|
|
|
486
489
|
|
|
487
490
|
<pre><code>var firstPoint = new Point(10, 20);
|
|
488
491
|
var secondPoint = new Point(5, 5);
|
|
489
|
-
var result = firstPoint - secondPoint;
|
|
492
|
+
var result = firstPoint - secondPoint; // PaperScript
|
|
493
|
+
var result = firstPoint.subtract(secondPoint); // JavaScript
|
|
490
494
|
console.log(result); // {x: 5, y: 15}</code></pre>
|
|
491
495
|
|
|
492
496
|
</div>
|
|
@@ -536,7 +540,8 @@ console.log(result); // {x: 5, y: 15}</code></pre>
|
|
|
536
540
|
|
|
537
541
|
|
|
538
542
|
<pre><code>var point = new Point(10, 20);
|
|
539
|
-
var result = point * 2;
|
|
543
|
+
var result = point * 2; // PaperScript
|
|
544
|
+
var result = point.multiply(2); // JavaScript
|
|
540
545
|
console.log(result); // {x: 20, y: 40}</code></pre>
|
|
541
546
|
|
|
542
547
|
</div>
|
|
@@ -577,7 +582,8 @@ console.log(result); // {x: 20, y: 40}</code></pre>
|
|
|
577
582
|
|
|
578
583
|
<pre><code>var firstPoint = new Point(5, 10);
|
|
579
584
|
var secondPoint = new Point(4, 2);
|
|
580
|
-
var result = firstPoint * secondPoint;
|
|
585
|
+
var result = firstPoint * secondPoint; // PaperScript
|
|
586
|
+
var result = firstPoint.multiply(secondPoint); // JavaScript
|
|
581
587
|
console.log(result); // {x: 20, y: 20}</code></pre>
|
|
582
588
|
|
|
583
589
|
</div>
|
|
@@ -627,7 +633,8 @@ console.log(result); // {x: 20, y: 20}</code></pre>
|
|
|
627
633
|
|
|
628
634
|
|
|
629
635
|
<pre><code>var point = new Point(10, 20);
|
|
630
|
-
var result = point / 2;
|
|
636
|
+
var result = point / 2; // PaperScript
|
|
637
|
+
var result = point.divide(2); // JavaScript
|
|
631
638
|
console.log(result); // {x: 5, y: 10}</code></pre>
|
|
632
639
|
|
|
633
640
|
</div>
|
|
@@ -668,7 +675,8 @@ console.log(result); // {x: 5, y: 10}</code></pre>
|
|
|
668
675
|
|
|
669
676
|
<pre><code>var firstPoint = new Point(8, 10);
|
|
670
677
|
var secondPoint = new Point(2, 5);
|
|
671
|
-
var result = firstPoint / secondPoint;
|
|
678
|
+
var result = firstPoint / secondPoint; // PaperScript
|
|
679
|
+
var result = firstPoint.divide(secondPoint); // JavaScript
|
|
672
680
|
console.log(result); // {x: 4, y: 2}</code></pre>
|
|
673
681
|
|
|
674
682
|
</div>
|
|
@@ -718,7 +726,9 @@ console.log(result); // {x: 4, y: 2}</code></pre>
|
|
|
718
726
|
|
|
719
727
|
|
|
720
728
|
<pre><code>var point = new Point(12, 6);
|
|
721
|
-
|
|
729
|
+
var result = point % 5; // PaperScript
|
|
730
|
+
var result = point.modulo(5); // JavaScript
|
|
731
|
+
console.log(result); // {x: 2, y: 1}</code></pre>
|
|
722
732
|
|
|
723
733
|
</div>
|
|
724
734
|
|
|
@@ -757,7 +767,9 @@ console.log(point % 5); // {x: 2, y: 1}</code></pre>
|
|
|
757
767
|
|
|
758
768
|
|
|
759
769
|
<pre><code>var point = new Point(12, 6);
|
|
760
|
-
|
|
770
|
+
var result = point % new Point(5, 2); // PaperScript
|
|
771
|
+
var result = point.modulo(new Point(5, 2)); // JavaScript
|
|
772
|
+
console.log(result); // {x: 2, y: 0}</code></pre>
|
|
761
773
|
|
|
762
774
|
</div>
|
|
763
775
|
|
|
@@ -1473,6 +1485,42 @@ point2.x = 1; // doesn't change point1.x</code></pre>
|
|
|
1473
1485
|
|
|
1474
1486
|
|
|
1475
1487
|
|
|
1488
|
+
</div>
|
|
1489
|
+
</div>
|
|
1490
|
+
</div>
|
|
1491
|
+
|
|
1492
|
+
|
|
1493
|
+
<div id="negate" class="member">
|
|
1494
|
+
<div class="member-link">
|
|
1495
|
+
<a name="negate" href="#negate"><tt><b>negate</b>()</tt></a>
|
|
1496
|
+
</div>
|
|
1497
|
+
<div class="member-description hidden">
|
|
1498
|
+
<div class="member-text">
|
|
1499
|
+
<p>Returns a new point with both coordinates negated. PaperScript uses it for the unary minus operator. The object itself is not modified!</p>
|
|
1500
|
+
|
|
1501
|
+
|
|
1502
|
+
|
|
1503
|
+
<ul class="member-list">
|
|
1504
|
+
<h4>Returns:</h4>
|
|
1505
|
+
|
|
1506
|
+
<li>
|
|
1507
|
+
<tt><a href="../classes/Point.html"><tt>Point</tt></a></tt> — the negation of the point as a new point
|
|
1508
|
+
</li>
|
|
1509
|
+
|
|
1510
|
+
|
|
1511
|
+
</ul>
|
|
1512
|
+
|
|
1513
|
+
|
|
1514
|
+
|
|
1515
|
+
|
|
1516
|
+
<h4>Example:</h4>
|
|
1517
|
+
|
|
1518
|
+
|
|
1519
|
+
<pre><code>var point = new Point(12, -6);
|
|
1520
|
+
var result = -point; // PaperScript
|
|
1521
|
+
var result = point.negate(); // JavaScript
|
|
1522
|
+
console.log(result); // {x: -12, y: 6}</code></pre>
|
|
1523
|
+
|
|
1476
1524
|
</div>
|
|
1477
1525
|
</div>
|
|
1478
1526
|
</div>
|
|
@@ -2023,6 +2071,68 @@ console.log(absPoint); // {x: 5, y: 10}</code></pre>
|
|
|
2023
2071
|
</div>
|
|
2024
2072
|
</div>
|
|
2025
2073
|
|
|
2074
|
+
|
|
2075
|
+
<div id="clamp-min-max" class="member">
|
|
2076
|
+
<div class="member-link">
|
|
2077
|
+
<a name="clamp-min-max" href="#clamp-min-max"><tt><b>clamp</b>(min, max)</tt></a>
|
|
2078
|
+
</div>
|
|
2079
|
+
<div class="member-description hidden">
|
|
2080
|
+
<div class="member-text">
|
|
2081
|
+
<p>Returns a new point with the <a href="../classes/Point.html#x"><tt>x</tt></a> and <a href="../classes/Point.html#y"><tt>y</tt></a> values clamped to the range between the given minimum and maximum points. The object itself is not modified!</p>
|
|
2082
|
+
|
|
2083
|
+
|
|
2084
|
+
<ul class="member-list">
|
|
2085
|
+
<h4>Parameters:</h4>
|
|
2086
|
+
|
|
2087
|
+
<li>
|
|
2088
|
+
<tt>min:</tt>
|
|
2089
|
+
<a href="../classes/Point.html"><tt>Point</tt></a>
|
|
2090
|
+
— the point with the smallest values
|
|
2091
|
+
|
|
2092
|
+
</li>
|
|
2093
|
+
|
|
2094
|
+
<li>
|
|
2095
|
+
<tt>max:</tt>
|
|
2096
|
+
<a href="../classes/Point.html"><tt>Point</tt></a>
|
|
2097
|
+
— the point with the largest values
|
|
2098
|
+
|
|
2099
|
+
</li>
|
|
2100
|
+
|
|
2101
|
+
</ul>
|
|
2102
|
+
|
|
2103
|
+
|
|
2104
|
+
<ul class="member-list">
|
|
2105
|
+
<h4>Returns:</h4>
|
|
2106
|
+
|
|
2107
|
+
<li>
|
|
2108
|
+
<tt><a href="../classes/Point.html"><tt>Point</tt></a></tt> — the clamped point as a new point
|
|
2109
|
+
</li>
|
|
2110
|
+
|
|
2111
|
+
|
|
2112
|
+
</ul>
|
|
2113
|
+
|
|
2114
|
+
|
|
2115
|
+
|
|
2116
|
+
|
|
2117
|
+
<h4>Example:</h4>
|
|
2118
|
+
|
|
2119
|
+
|
|
2120
|
+
<pre><code>var point = new Point(-5, 150);
|
|
2121
|
+
var clampPoint = point.clamp(new Point(0, 0), new Point(100, 100));
|
|
2122
|
+
console.log(clampPoint); // {x: 0, y: 100}</code></pre>
|
|
2123
|
+
|
|
2124
|
+
<h4>Example:<span class="description">Keep a point inside a rectangle:</span></h4>
|
|
2125
|
+
|
|
2126
|
+
|
|
2127
|
+
<pre><code>var rect = new Rectangle(10, 20, 100, 50);
|
|
2128
|
+
var point = new Point(200, 40);
|
|
2129
|
+
var clampPoint = point.clamp(rect.topLeft, rect.bottomRight);
|
|
2130
|
+
console.log(clampPoint); // {x: 110, y: 40}</code></pre>
|
|
2131
|
+
|
|
2132
|
+
</div>
|
|
2133
|
+
</div>
|
|
2134
|
+
</div>
|
|
2135
|
+
|
|
2026
2136
|
|
|
2027
2137
|
|
|
2028
2138
|
<h3>Math Operator Functions</h3>
|
|
@@ -2068,7 +2178,8 @@ console.log(absPoint); // {x: 5, y: 10}</code></pre>
|
|
|
2068
2178
|
|
|
2069
2179
|
|
|
2070
2180
|
<pre><code>var point = new Point(5, 10);
|
|
2071
|
-
var result = point + 20;
|
|
2181
|
+
var result = point + 20; // PaperScript
|
|
2182
|
+
var result = point.add(20); // JavaScript
|
|
2072
2183
|
console.log(result); // {x: 25, y: 30}</code></pre>
|
|
2073
2184
|
|
|
2074
2185
|
</div>
|
|
@@ -2116,7 +2227,8 @@ console.log(result); // {x: 25, y: 30}</code></pre>
|
|
|
2116
2227
|
|
|
2117
2228
|
<pre><code>var point1 = new Point(5, 10);
|
|
2118
2229
|
var point2 = new Point(10, 20);
|
|
2119
|
-
var result = point1 + point2;
|
|
2230
|
+
var result = point1 + point2; // PaperScript
|
|
2231
|
+
var result = point1.add(point2); // JavaScript
|
|
2120
2232
|
console.log(result); // {x: 15, y: 30}</code></pre>
|
|
2121
2233
|
|
|
2122
2234
|
</div>
|
|
@@ -2166,7 +2278,8 @@ console.log(result); // {x: 15, y: 30}</code></pre>
|
|
|
2166
2278
|
|
|
2167
2279
|
|
|
2168
2280
|
<pre><code>var point = new Point(10, 20);
|
|
2169
|
-
var result = point - 5;
|
|
2281
|
+
var result = point - 5; // PaperScript
|
|
2282
|
+
var result = point.subtract(5); // JavaScript
|
|
2170
2283
|
console.log(result); // {x: 5, y: 15}</code></pre>
|
|
2171
2284
|
|
|
2172
2285
|
</div>
|
|
@@ -2214,7 +2327,8 @@ console.log(result); // {x: 5, y: 15}</code></pre>
|
|
|
2214
2327
|
|
|
2215
2328
|
<pre><code>var firstPoint = new Point(10, 20);
|
|
2216
2329
|
var secondPoint = new Point(5, 5);
|
|
2217
|
-
var result = firstPoint - secondPoint;
|
|
2330
|
+
var result = firstPoint - secondPoint; // PaperScript
|
|
2331
|
+
var result = firstPoint.subtract(secondPoint); // JavaScript
|
|
2218
2332
|
console.log(result); // {x: 5, y: 15}</code></pre>
|
|
2219
2333
|
|
|
2220
2334
|
</div>
|
|
@@ -2264,7 +2378,8 @@ console.log(result); // {x: 5, y: 15}</code></pre>
|
|
|
2264
2378
|
|
|
2265
2379
|
|
|
2266
2380
|
<pre><code>var point = new Point(10, 20);
|
|
2267
|
-
var result = point * 2;
|
|
2381
|
+
var result = point * 2; // PaperScript
|
|
2382
|
+
var result = point.multiply(2); // JavaScript
|
|
2268
2383
|
console.log(result); // {x: 20, y: 40}</code></pre>
|
|
2269
2384
|
|
|
2270
2385
|
</div>
|
|
@@ -2312,7 +2427,8 @@ console.log(result); // {x: 20, y: 40}</code></pre>
|
|
|
2312
2427
|
|
|
2313
2428
|
<pre><code>var firstPoint = new Point(5, 10);
|
|
2314
2429
|
var secondPoint = new Point(4, 2);
|
|
2315
|
-
var result = firstPoint * secondPoint;
|
|
2430
|
+
var result = firstPoint * secondPoint; // PaperScript
|
|
2431
|
+
var result = firstPoint.multiply(secondPoint); // JavaScript
|
|
2316
2432
|
console.log(result); // {x: 20, y: 20}</code></pre>
|
|
2317
2433
|
|
|
2318
2434
|
</div>
|
|
@@ -2362,7 +2478,8 @@ console.log(result); // {x: 20, y: 20}</code></pre>
|
|
|
2362
2478
|
|
|
2363
2479
|
|
|
2364
2480
|
<pre><code>var point = new Point(10, 20);
|
|
2365
|
-
var result = point / 2;
|
|
2481
|
+
var result = point / 2; // PaperScript
|
|
2482
|
+
var result = point.divide(2); // JavaScript
|
|
2366
2483
|
console.log(result); // {x: 5, y: 10}</code></pre>
|
|
2367
2484
|
|
|
2368
2485
|
</div>
|
|
@@ -2410,7 +2527,8 @@ console.log(result); // {x: 5, y: 10}</code></pre>
|
|
|
2410
2527
|
|
|
2411
2528
|
<pre><code>var firstPoint = new Point(8, 10);
|
|
2412
2529
|
var secondPoint = new Point(2, 5);
|
|
2413
|
-
var result = firstPoint / secondPoint;
|
|
2530
|
+
var result = firstPoint / secondPoint; // PaperScript
|
|
2531
|
+
var result = firstPoint.divide(secondPoint); // JavaScript
|
|
2414
2532
|
console.log(result); // {x: 4, y: 2}</code></pre>
|
|
2415
2533
|
|
|
2416
2534
|
</div>
|
|
@@ -2460,7 +2578,9 @@ console.log(result); // {x: 4, y: 2}</code></pre>
|
|
|
2460
2578
|
|
|
2461
2579
|
|
|
2462
2580
|
<pre><code>var point = new Point(12, 6);
|
|
2463
|
-
|
|
2581
|
+
var result = point % 5; // PaperScript
|
|
2582
|
+
var result = point.modulo(5); // JavaScript
|
|
2583
|
+
console.log(result); // {x: 2, y: 1}</code></pre>
|
|
2464
2584
|
|
|
2465
2585
|
</div>
|
|
2466
2586
|
</div>
|
|
@@ -2506,7 +2626,9 @@ console.log(point % 5); // {x: 2, y: 1}</code></pre>
|
|
|
2506
2626
|
|
|
2507
2627
|
|
|
2508
2628
|
<pre><code>var point = new Point(12, 6);
|
|
2509
|
-
|
|
2629
|
+
var result = point % new Point(5, 2); // PaperScript
|
|
2630
|
+
var result = point.modulo(new Point(5, 2)); // JavaScript
|
|
2631
|
+
console.log(result); // {x: 2, y: 0}</code></pre>
|
|
2510
2632
|
|
|
2511
2633
|
</div>
|
|
2512
2634
|
</div>
|
|
@@ -2690,7 +2812,7 @@ var point = maxPoint * randomPoint;</code></pre>
|
|
|
2690
2812
|
|
|
2691
2813
|
<!-- =========================== copyright notice ========================== -->
|
|
2692
2814
|
<p class="footer">
|
|
2693
|
-
Paper.js v0.
|
|
2815
|
+
Paper.js v0.14.0<br>
|
|
2694
2816
|
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>
|
|
2695
2817
|
<div class="content-end"></div>
|
|
2696
2818
|
|