paper 0.12.16 → 0.12.18
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 +19 -4
- package/dist/docs/assets/js/paper.js +22 -14
- package/dist/docs/classes/Color.html +2 -2
- package/dist/docs/classes/CompoundPath.html +3 -4
- package/dist/docs/classes/Curve.html +2 -2
- package/dist/docs/classes/CurveLocation.html +2 -2
- package/dist/docs/classes/Event.html +2 -2
- package/dist/docs/classes/Gradient.html +2 -2
- package/dist/docs/classes/GradientStop.html +2 -2
- package/dist/docs/classes/Group.html +3 -4
- package/dist/docs/classes/HitResult.html +2 -2
- package/dist/docs/classes/Item.html +3 -4
- package/dist/docs/classes/Key.html +2 -2
- package/dist/docs/classes/KeyEvent.html +2 -2
- package/dist/docs/classes/Layer.html +3 -4
- package/dist/docs/classes/Matrix.html +2 -2
- package/dist/docs/classes/MouseEvent.html +2 -2
- package/dist/docs/classes/PaperScope.html +2 -2
- package/dist/docs/classes/PaperScript.html +2 -2
- package/dist/docs/classes/Path.html +3 -4
- package/dist/docs/classes/PathItem.html +3 -4
- package/dist/docs/classes/Point.html +2 -2
- package/dist/docs/classes/PointText.html +3 -4
- package/dist/docs/classes/Project.html +3 -2
- package/dist/docs/classes/Raster.html +3 -4
- package/dist/docs/classes/Rectangle.html +2 -2
- package/dist/docs/classes/Segment.html +2 -2
- package/dist/docs/classes/Shape.html +3 -4
- package/dist/docs/classes/Size.html +2 -2
- package/dist/docs/classes/Style.html +2 -2
- package/dist/docs/classes/SymbolDefinition.html +2 -2
- package/dist/docs/classes/SymbolItem.html +3 -4
- package/dist/docs/classes/TextItem.html +3 -4
- package/dist/docs/classes/Tool.html +2 -2
- package/dist/docs/classes/ToolEvent.html +2 -2
- package/dist/docs/classes/Tween.html +2 -2
- package/dist/docs/classes/View.html +3 -3
- package/dist/docs/classes/global.html +2 -2
- package/dist/docs/classes/index.html +2 -2
- package/dist/docs/index.html +1 -1
- package/dist/paper-core.js +22 -14
- package/dist/paper-core.min.js +3 -3
- package/dist/paper-full.js +22 -14
- package/dist/paper-full.min.js +3 -3
- package/dist/paper.d.ts +175 -147
- package/dist/paperjs/LICENSE.txt +23 -0
- package/dist/paperjs/dist/node/canvas.js +66 -0
- package/dist/paperjs/dist/node/extend.js +156 -0
- package/dist/paperjs/dist/node/self.js +58 -0
- package/dist/paperjs/dist/node/xml.js +40 -0
- package/dist/paperjs/dist/paper-core.d.ts +1 -0
- package/dist/paperjs/dist/paper-core.js +15703 -0
- package/dist/paperjs/dist/paper-core.min.js +32 -0
- package/dist/paperjs/dist/paper-full.js +17472 -0
- package/dist/paperjs/dist/paper-full.min.js +32 -0
- package/dist/paperjs/dist/paper.d.ts +7394 -0
- package/dist/paperjs/docs/assets/css/docs.css +414 -0
- package/dist/paperjs/docs/assets/js/codemirror.js +4 -0
- package/dist/paperjs/docs/assets/js/docs.js +493 -0
- package/dist/paperjs/docs/assets/js/jquery.js +6 -0
- package/dist/paperjs/docs/assets/js/paper.js +17472 -0
- package/dist/paperjs/docs/classes/Color.html +2188 -0
- package/dist/paperjs/docs/classes/CompoundPath.html +8877 -0
- package/dist/paperjs/docs/classes/Curve.html +2323 -0
- package/dist/paperjs/docs/classes/CurveLocation.html +672 -0
- package/dist/paperjs/docs/classes/Event.html +176 -0
- package/dist/paperjs/docs/classes/Gradient.html +240 -0
- package/dist/paperjs/docs/classes/GradientStop.html +273 -0
- package/dist/paperjs/docs/classes/Group.html +6864 -0
- package/dist/paperjs/docs/classes/HitResult.html +239 -0
- package/dist/paperjs/docs/classes/Item.html +6628 -0
- package/dist/paperjs/docs/classes/Key.html +139 -0
- package/dist/paperjs/docs/classes/KeyEvent.html +308 -0
- package/dist/paperjs/docs/classes/Layer.html +6850 -0
- package/dist/paperjs/docs/classes/Matrix.html +1744 -0
- package/dist/paperjs/docs/classes/MouseEvent.html +355 -0
- package/dist/paperjs/docs/classes/PaperScope.html +459 -0
- package/dist/paperjs/docs/classes/PaperScript.html +198 -0
- package/dist/paperjs/docs/classes/Path.html +11775 -0
- package/dist/paperjs/docs/classes/PathItem.html +8639 -0
- package/dist/paperjs/docs/classes/Point.html +2699 -0
- package/dist/paperjs/docs/classes/PointText.html +7029 -0
- package/dist/paperjs/docs/classes/Project.html +1305 -0
- package/dist/paperjs/docs/classes/Raster.html +7843 -0
- package/dist/paperjs/docs/classes/Rectangle.html +1654 -0
- package/dist/paperjs/docs/classes/Segment.html +939 -0
- package/dist/paperjs/docs/classes/Shape.html +7363 -0
- package/dist/paperjs/docs/classes/Size.html +1825 -0
- package/dist/paperjs/docs/classes/Style.html +919 -0
- package/dist/paperjs/docs/classes/SymbolDefinition.html +311 -0
- package/dist/paperjs/docs/classes/SymbolItem.html +6755 -0
- package/dist/paperjs/docs/classes/TextItem.html +6869 -0
- package/dist/paperjs/docs/classes/Tool.html +761 -0
- package/dist/paperjs/docs/classes/ToolEvent.html +446 -0
- package/dist/paperjs/docs/classes/Tween.html +374 -0
- package/dist/paperjs/docs/classes/View.html +1772 -0
- package/dist/paperjs/docs/classes/global.html +425 -0
- package/dist/paperjs/docs/classes/index.html +88 -0
- package/dist/paperjs/docs/index.html +11 -0
- package/dist/paperjs/examples/Animated/AnimatedStar.html +53 -0
- package/dist/paperjs/examples/Animated/BooleanOperations.html +115 -0
- package/dist/paperjs/examples/Animated/CandyCrash.html +151 -0
- package/dist/paperjs/examples/Animated/Extruded.html +50 -0
- package/dist/paperjs/examples/Animated/Lines.html +53 -0
- package/dist/paperjs/examples/Animated/Smoothing.html +70 -0
- package/dist/paperjs/examples/Animated/Space.html +86 -0
- package/dist/paperjs/examples/Animated/SpaceUsingShapes.html +79 -0
- package/dist/paperjs/examples/Games/Paperoids.html +569 -0
- package/dist/paperjs/examples/JSON/Circle Testing.html +34 -0
- package/dist/paperjs/examples/JSON/Compound Path.html +25 -0
- package/dist/paperjs/examples/JSON/Empty Path Testing.html +31 -0
- package/dist/paperjs/examples/JSON/Gradients.html +34 -0
- package/dist/paperjs/examples/JSON/Group Transform.html +28 -0
- package/dist/paperjs/examples/JSON/Line Testing.html +44 -0
- package/dist/paperjs/examples/JSON/Random Path Testing.html +42 -0
- package/dist/paperjs/examples/JSON/Raster.html +29 -0
- package/dist/paperjs/examples/JSON/Rect and Attribute Testing.html +56 -0
- package/dist/paperjs/examples/JSON/Rotated Primitives.html +55 -0
- package/dist/paperjs/examples/JSON/Selection.html +43 -0
- package/dist/paperjs/examples/JSON/Shapes.html +54 -0
- package/dist/paperjs/examples/JSON/Symbols.html +30 -0
- package/dist/paperjs/examples/JSON/Text Testing.html +38 -0
- package/dist/paperjs/examples/JSON/Tiger.html +19 -0
- package/dist/paperjs/examples/JSON/Transform Test 1.html +32 -0
- package/dist/paperjs/examples/JSON/Transform Test 2.html +30 -0
- package/dist/paperjs/examples/Node.js/AnimatedStar.js +52 -0
- package/dist/paperjs/examples/Node.js/BooleanOperations.js +36 -0
- package/dist/paperjs/examples/Node.js/JSONtoPDF.js +20 -0
- package/dist/paperjs/examples/Node.js/Raster.js +32 -0
- package/dist/paperjs/examples/Node.js/RasterRemote.js +33 -0
- package/dist/paperjs/examples/Node.js/SvgExport.js +52 -0
- package/dist/paperjs/examples/Node.js/SvgImport.js +23 -0
- package/dist/paperjs/examples/Node.js/Tadpoles.js +16 -0
- package/dist/paperjs/examples/Node.js/Tadpoles.pjs +278 -0
- package/dist/paperjs/examples/Node.js/in.json +1 -0
- package/dist/paperjs/examples/Node.js/in.svg +16 -0
- package/dist/paperjs/examples/Paperjs.org/BooleanOperattions.html +115 -0
- package/dist/paperjs/examples/Paperjs.org/BouncingBalls.html +103 -0
- package/dist/paperjs/examples/Paperjs.org/Chain.html +54 -0
- package/dist/paperjs/examples/Paperjs.org/DivisionRaster.html +72 -0
- package/dist/paperjs/examples/Paperjs.org/FutureSplash.html +122 -0
- package/dist/paperjs/examples/Paperjs.org/HitTesting.html +103 -0
- package/dist/paperjs/examples/Paperjs.org/InteractiveTiger.html +777 -0
- package/dist/paperjs/examples/Paperjs.org/MetaBalls.html +132 -0
- package/dist/paperjs/examples/Paperjs.org/NyanRainbow.html +202 -0
- package/dist/paperjs/examples/Paperjs.org/PathIntersections.html +76 -0
- package/dist/paperjs/examples/Paperjs.org/Qbertify.html +146 -0
- package/dist/paperjs/examples/Paperjs.org/RadialRainbows.html +80 -0
- package/dist/paperjs/examples/Paperjs.org/RoundedRectangles.html +41 -0
- package/dist/paperjs/examples/Paperjs.org/SatieLikedToDraw.html +140 -0
- package/dist/paperjs/examples/Paperjs.org/Simplify.html +63 -0
- package/dist/paperjs/examples/Paperjs.org/SpiralRaster.html +120 -0
- package/dist/paperjs/examples/Paperjs.org/Tadpoles.html +283 -0
- package/dist/paperjs/examples/Paperjs.org/Voronoi.html +134 -0
- package/dist/paperjs/examples/Rasters/PhyllotaxisRaster.html +96 -0
- package/dist/paperjs/examples/Rasters/Raster.html +34 -0
- package/dist/paperjs/examples/Rasters/RotationRaster.html +44 -0
- package/dist/paperjs/examples/Rasters/Smoothing.html +36 -0
- package/dist/paperjs/examples/SVG Export/Circle Testing.html +32 -0
- package/dist/paperjs/examples/SVG Export/Clipping.html +17 -0
- package/dist/paperjs/examples/SVG Export/Compound Path.html +22 -0
- package/dist/paperjs/examples/SVG Export/Empty Path Testing.html +28 -0
- package/dist/paperjs/examples/SVG Export/Gradients.html +52 -0
- package/dist/paperjs/examples/SVG Export/Group Transform.html +25 -0
- package/dist/paperjs/examples/SVG Export/Line Testing.html +41 -0
- package/dist/paperjs/examples/SVG Export/Random Path Testing.html +39 -0
- package/dist/paperjs/examples/SVG Export/Raster.html +21 -0
- package/dist/paperjs/examples/SVG Export/Rect and Attribute Testing.html +53 -0
- package/dist/paperjs/examples/SVG Export/Rotated Primitives.html +80 -0
- package/dist/paperjs/examples/SVG Export/Shapes.html +58 -0
- package/dist/paperjs/examples/SVG Export/Symbols.html +27 -0
- package/dist/paperjs/examples/SVG Export/Text Testing.html +45 -0
- package/dist/paperjs/examples/SVG Export/Tiger.html +23 -0
- package/dist/paperjs/examples/SVG Export/Transform Test 1.html +29 -0
- package/dist/paperjs/examples/SVG Export/Transform Test 2.html +27 -0
- package/dist/paperjs/examples/SVG Import/Arcs.html +78 -0
- package/dist/paperjs/examples/SVG Import/Butterfly.html +223 -0
- package/dist/paperjs/examples/SVG Import/Circle and Ellipse Testing.html +26 -0
- package/dist/paperjs/examples/SVG Import/Clipping.html +100 -0
- package/dist/paperjs/examples/SVG Import/From File.html +30 -0
- package/dist/paperjs/examples/SVG Import/Gradient.html +138 -0
- package/dist/paperjs/examples/SVG Import/Gradients.html +30 -0
- package/dist/paperjs/examples/SVG Import/Inkscape Pivot.html +52 -0
- package/dist/paperjs/examples/SVG Import/Inkscape.html +88 -0
- package/dist/paperjs/examples/SVG Import/Line Testing.html +24 -0
- package/dist/paperjs/examples/SVG Import/MoreGradients.html +107 -0
- package/dist/paperjs/examples/SVG Import/Multiple Paths Test 1.html +42 -0
- package/dist/paperjs/examples/SVG Import/Multiple Paths Test 2.html +33 -0
- package/dist/paperjs/examples/SVG Import/Nested Groups Test.html +78 -0
- package/dist/paperjs/examples/SVG Import/Polybezier.html +43 -0
- package/dist/paperjs/examples/SVG Import/Rect Testing.html +25 -0
- package/dist/paperjs/examples/SVG Import/Symbols.html +24 -0
- package/dist/paperjs/examples/SVG Import/Testing.html +40 -0
- package/dist/paperjs/examples/SVG Import/Text Testing.html +19 -0
- package/dist/paperjs/examples/SVG Import/Tiger.html +742 -0
- package/dist/paperjs/examples/SVG Import/Transform Testing.html +22 -0
- package/dist/paperjs/examples/SVG Import/Viewbox.html +38 -0
- package/dist/paperjs/examples/Scripts/Arcs.html +39 -0
- package/dist/paperjs/examples/Scripts/BlendModes.html +77 -0
- package/dist/paperjs/examples/Scripts/BooleanOperations.html +937 -0
- package/dist/paperjs/examples/Scripts/CompoundPath.html +19 -0
- package/dist/paperjs/examples/Scripts/CurveTimeParameterization.html +61 -0
- package/dist/paperjs/examples/Scripts/HslColor.html +53 -0
- package/dist/paperjs/examples/Scripts/PathStructure.html +82 -0
- package/dist/paperjs/examples/Scripts/PathTangents.html +73 -0
- package/dist/paperjs/examples/Scripts/Resize.html +42 -0
- package/dist/paperjs/examples/Scripts/RoundRectangle.html +28 -0
- package/dist/paperjs/examples/Scripts/Shapes.html +54 -0
- package/dist/paperjs/examples/Scripts/StrokeBounds.html +101 -0
- package/dist/paperjs/examples/Scripts/StrokeScaling.html +65 -0
- package/dist/paperjs/examples/Tools/BezierTool.html +90 -0
- package/dist/paperjs/examples/Tools/Circles.html +28 -0
- package/dist/paperjs/examples/Tools/Clouds.html +35 -0
- package/dist/paperjs/examples/Tools/DrippingBrush.html +73 -0
- package/dist/paperjs/examples/Tools/FancyBrush.html +82 -0
- package/dist/paperjs/examples/Tools/Grid.html +44 -0
- package/dist/paperjs/examples/Tools/MultiLines.html +44 -0
- package/dist/paperjs/examples/Tools/MultipleTools.html +44 -0
- package/dist/paperjs/examples/Tools/PathEditing.html +95 -0
- package/dist/paperjs/examples/Tools/SquareRounded.html +76 -0
- package/dist/paperjs/examples/Tools/Stars.html +38 -0
- package/dist/paperjs/examples/Tools/Vektor.html +200 -0
- package/dist/paperjs/examples/Tools/Wave.html +50 -0
- package/dist/paperjs/examples/Tools/WormFarm.html +88 -0
- package/dist/paperjs/examples/Worker/Main.html +53 -0
- package/dist/paperjs/examples/Worker/Worker.js +14 -0
- package/dist/paperjs/examples/css/style.css +12 -0
- package/package.json +4 -4
package/dist/paper.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Paper.js v0.12.
|
|
2
|
+
* Paper.js v0.12.18 - The Swiss Army Knife of Vector Graphics Scripting.
|
|
3
3
|
* http://paperjs.org/
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2011 - 2020, Jürg Lehni & Jonathan Puckey
|
|
@@ -9,13 +9,35 @@
|
|
|
9
9
|
*
|
|
10
10
|
* All rights reserved.
|
|
11
11
|
*
|
|
12
|
-
* Date:
|
|
12
|
+
* Date: Wed Jul 17 14:57:24 2024 +0200
|
|
13
13
|
*
|
|
14
14
|
* This is an auto-generated type definition.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
declare namespace paper {
|
|
18
18
|
|
|
19
|
+
type PointLike = (
|
|
20
|
+
Point
|
|
21
|
+
| [ number, number ]
|
|
22
|
+
| { x: number, y: number }
|
|
23
|
+
| { width: number, height: number }
|
|
24
|
+
| { angle: number, length: number }
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
type SizeLike = (
|
|
28
|
+
Size
|
|
29
|
+
| [ number, number ]
|
|
30
|
+
| { x: number, y: number }
|
|
31
|
+
| { width: number, height: number }
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
type RectangleLike = (
|
|
35
|
+
Rectangle
|
|
36
|
+
| [ number, number, number, number ]
|
|
37
|
+
| { x: number, y: number, width: number, height: number }
|
|
38
|
+
| { from: PointLike, to: PointLike }
|
|
39
|
+
)
|
|
40
|
+
|
|
19
41
|
/**
|
|
20
42
|
* All properties and functions that expect color values in the form
|
|
21
43
|
* of instances of Color objects, also accept named colors and hex values as
|
|
@@ -133,7 +155,7 @@ declare namespace paper {
|
|
|
133
155
|
/**
|
|
134
156
|
* Creates a gradient Color object.
|
|
135
157
|
*/
|
|
136
|
-
constructor(gradient: Gradient, origin:
|
|
158
|
+
constructor(gradient: Gradient, origin: PointLike, destination: PointLike, highlight?: PointLike)
|
|
137
159
|
|
|
138
160
|
/**
|
|
139
161
|
* Creates a HSB, HSL or gradient Color object from the properties of
|
|
@@ -540,7 +562,7 @@ declare namespace paper {
|
|
|
540
562
|
/**
|
|
541
563
|
* Creates a new curve object.
|
|
542
564
|
*/
|
|
543
|
-
constructor(point1:
|
|
565
|
+
constructor(point1: PointLike, handle1: PointLike, handle2: PointLike, point2: PointLike)
|
|
544
566
|
|
|
545
567
|
/**
|
|
546
568
|
* Returns a copy of the curve.
|
|
@@ -782,7 +804,7 @@ declare namespace paper {
|
|
|
782
804
|
* @return at most two curve-time parameters, where the curve is
|
|
783
805
|
* tangential to the given tangent
|
|
784
806
|
*/
|
|
785
|
-
getTimesWithTangent(tangent:
|
|
807
|
+
getTimesWithTangent(tangent: PointLike): number[]
|
|
786
808
|
|
|
787
809
|
/**
|
|
788
810
|
* Calculates the curve offset at the specified curve-time parameter on
|
|
@@ -802,7 +824,7 @@ declare namespace paper {
|
|
|
802
824
|
*
|
|
803
825
|
* @return the curve location of the specified point
|
|
804
826
|
*/
|
|
805
|
-
getLocationOf(point:
|
|
827
|
+
getLocationOf(point: PointLike): CurveLocation
|
|
806
828
|
|
|
807
829
|
/**
|
|
808
830
|
* Returns the length of the path from its beginning up to up to the
|
|
@@ -812,7 +834,7 @@ declare namespace paper {
|
|
|
812
834
|
*
|
|
813
835
|
* @return the length of the path up to the specified point
|
|
814
836
|
*/
|
|
815
|
-
getOffsetOf(point:
|
|
837
|
+
getOffsetOf(point: PointLike): number
|
|
816
838
|
|
|
817
839
|
/**
|
|
818
840
|
* Returns the curve-time parameter of the specified point if it lies on the
|
|
@@ -824,7 +846,7 @@ declare namespace paper {
|
|
|
824
846
|
*
|
|
825
847
|
* @return the curve-time parameter of the specified point
|
|
826
848
|
*/
|
|
827
|
-
getTimeOf(point:
|
|
849
|
+
getTimeOf(point: PointLike): number
|
|
828
850
|
|
|
829
851
|
/**
|
|
830
852
|
* Returns the nearest location on the curve to the specified point.
|
|
@@ -834,7 +856,7 @@ declare namespace paper {
|
|
|
834
856
|
* @return the location on the curve that's the closest to
|
|
835
857
|
* the specified point
|
|
836
858
|
*/
|
|
837
|
-
getNearestLocation(point:
|
|
859
|
+
getNearestLocation(point: PointLike): CurveLocation
|
|
838
860
|
|
|
839
861
|
/**
|
|
840
862
|
* Returns the nearest point on the curve to the specified point.
|
|
@@ -844,7 +866,7 @@ declare namespace paper {
|
|
|
844
866
|
* @return the point on the curve that's the closest to the
|
|
845
867
|
* specified point
|
|
846
868
|
*/
|
|
847
|
-
getNearestPoint(point:
|
|
869
|
+
getNearestPoint(point: PointLike): Point
|
|
848
870
|
|
|
849
871
|
/**
|
|
850
872
|
* Calculates the point on the curve at the given location.
|
|
@@ -1083,7 +1105,7 @@ declare namespace paper {
|
|
|
1083
1105
|
/**
|
|
1084
1106
|
* Creates a new CurveLocation object.
|
|
1085
1107
|
*/
|
|
1086
|
-
constructor(curve: Curve, time: number, point?:
|
|
1108
|
+
constructor(curve: Curve, time: number, point?: PointLike)
|
|
1087
1109
|
|
|
1088
1110
|
/**
|
|
1089
1111
|
* Checks whether tow CurveLocation objects are describing the same location
|
|
@@ -1550,7 +1572,7 @@ declare namespace paper {
|
|
|
1550
1572
|
/**
|
|
1551
1573
|
* The index of this item within the list of its parent's children.
|
|
1552
1574
|
*/
|
|
1553
|
-
|
|
1575
|
+
index: number
|
|
1554
1576
|
|
|
1555
1577
|
/**
|
|
1556
1578
|
* The color of the stroke.
|
|
@@ -1815,12 +1837,12 @@ declare namespace paper {
|
|
|
1815
1837
|
*
|
|
1816
1838
|
* @param point - the point to check for
|
|
1817
1839
|
*/
|
|
1818
|
-
contains(point:
|
|
1840
|
+
contains(point: PointLike): boolean
|
|
1819
1841
|
|
|
1820
1842
|
/**
|
|
1821
1843
|
* @param rect - the rectangle to check against
|
|
1822
1844
|
*/
|
|
1823
|
-
isInside(rect:
|
|
1845
|
+
isInside(rect: RectangleLike): boolean
|
|
1824
1846
|
|
|
1825
1847
|
/**
|
|
1826
1848
|
* @param item - the item to check against
|
|
@@ -1872,7 +1894,7 @@ declare namespace paper {
|
|
|
1872
1894
|
* @return a hit result object describing what exactly was hit
|
|
1873
1895
|
* or `null` if nothing was hit
|
|
1874
1896
|
*/
|
|
1875
|
-
hitTest(point:
|
|
1897
|
+
hitTest(point: PointLike, options?: object): HitResult
|
|
1876
1898
|
|
|
1877
1899
|
/**
|
|
1878
1900
|
* Performs a hit-test on the item and its children (if it is a {@link
|
|
@@ -1890,7 +1912,7 @@ declare namespace paper {
|
|
|
1890
1912
|
* @return hit result objects for all hits, describing what
|
|
1891
1913
|
* exactly was hit or `null` if nothing was hit
|
|
1892
1914
|
*/
|
|
1893
|
-
hitTestAll(point:
|
|
1915
|
+
hitTestAll(point: PointLike, options?: object): HitResult[]
|
|
1894
1916
|
|
|
1895
1917
|
/**
|
|
1896
1918
|
* Checks whether the item matches the criteria described by the given
|
|
@@ -2032,6 +2054,9 @@ declare namespace paper {
|
|
|
2032
2054
|
* @option [options.embedImages=true] {Boolean} whether raster images should
|
|
2033
2055
|
* be embedded as base64 data inlined in the xlink:href attribute, or
|
|
2034
2056
|
* kept as a link to their external URL.
|
|
2057
|
+
* @option [options.reduceAttributes=true] {Boolean} wether to only include
|
|
2058
|
+
* style attributes in the SVG output that differ from their parents,
|
|
2059
|
+
* or to always include them (much faster but leading to redundancies).
|
|
2035
2060
|
*
|
|
2036
2061
|
* @param options - the export options
|
|
2037
2062
|
*
|
|
@@ -2357,7 +2382,7 @@ declare namespace paper {
|
|
|
2357
2382
|
*
|
|
2358
2383
|
* @param delta - the offset to translate the item by
|
|
2359
2384
|
*/
|
|
2360
|
-
translate(delta:
|
|
2385
|
+
translate(delta: PointLike): void
|
|
2361
2386
|
|
|
2362
2387
|
/**
|
|
2363
2388
|
* Rotates the item by a given angle around the given center point.
|
|
@@ -2368,7 +2393,7 @@ declare namespace paper {
|
|
|
2368
2393
|
*
|
|
2369
2394
|
* @param angle - the rotation angle
|
|
2370
2395
|
*/
|
|
2371
|
-
rotate(angle: number, center?:
|
|
2396
|
+
rotate(angle: number, center?: PointLike): void
|
|
2372
2397
|
|
|
2373
2398
|
/**
|
|
2374
2399
|
* Scales the item by the given value from its center point, or optionally
|
|
@@ -2376,7 +2401,7 @@ declare namespace paper {
|
|
|
2376
2401
|
*
|
|
2377
2402
|
* @param scale - the scale factor
|
|
2378
2403
|
*/
|
|
2379
|
-
scale(scale: number, center?:
|
|
2404
|
+
scale(scale: number, center?: PointLike): void
|
|
2380
2405
|
|
|
2381
2406
|
/**
|
|
2382
2407
|
* Scales the item by the given values from its center point, or optionally
|
|
@@ -2385,7 +2410,7 @@ declare namespace paper {
|
|
|
2385
2410
|
* @param hor - the horizontal scale factor
|
|
2386
2411
|
* @param ver - the vertical scale factor
|
|
2387
2412
|
*/
|
|
2388
|
-
scale(hor: number, ver: number, center?:
|
|
2413
|
+
scale(hor: number, ver: number, center?: PointLike): void
|
|
2389
2414
|
|
|
2390
2415
|
/**
|
|
2391
2416
|
* Shears the item by the given value from its center point, or optionally
|
|
@@ -2395,7 +2420,7 @@ declare namespace paper {
|
|
|
2395
2420
|
*
|
|
2396
2421
|
* @param shear - the horizontal and vertical shear factors as a point
|
|
2397
2422
|
*/
|
|
2398
|
-
shear(shear:
|
|
2423
|
+
shear(shear: PointLike, center?: PointLike): void
|
|
2399
2424
|
|
|
2400
2425
|
/**
|
|
2401
2426
|
* Shears the item by the given values from its center point, or optionally
|
|
@@ -2406,7 +2431,7 @@ declare namespace paper {
|
|
|
2406
2431
|
* @param hor - the horizontal shear factor
|
|
2407
2432
|
* @param ver - the vertical shear factor
|
|
2408
2433
|
*/
|
|
2409
|
-
shear(hor: number, ver: number, center?:
|
|
2434
|
+
shear(hor: number, ver: number, center?: PointLike): void
|
|
2410
2435
|
|
|
2411
2436
|
/**
|
|
2412
2437
|
* Skews the item by the given angles from its center point, or optionally
|
|
@@ -2416,7 +2441,7 @@ declare namespace paper {
|
|
|
2416
2441
|
*
|
|
2417
2442
|
* @param skew - the horizontal and vertical skew angles in degrees
|
|
2418
2443
|
*/
|
|
2419
|
-
skew(skew:
|
|
2444
|
+
skew(skew: PointLike, center?: PointLike): void
|
|
2420
2445
|
|
|
2421
2446
|
/**
|
|
2422
2447
|
* Skews the item by the given angles from its center point, or optionally
|
|
@@ -2427,7 +2452,7 @@ declare namespace paper {
|
|
|
2427
2452
|
* @param hor - the horizontal skew angle in degrees
|
|
2428
2453
|
* @param ver - the vertical sskew angle in degrees
|
|
2429
2454
|
*/
|
|
2430
|
-
skew(hor: number, ver: number, center?:
|
|
2455
|
+
skew(hor: number, ver: number, center?: PointLike): void
|
|
2431
2456
|
|
|
2432
2457
|
/**
|
|
2433
2458
|
* Transform the item.
|
|
@@ -2444,7 +2469,7 @@ declare namespace paper {
|
|
|
2444
2469
|
*
|
|
2445
2470
|
* @return the transformed point as a new instance
|
|
2446
2471
|
*/
|
|
2447
|
-
globalToLocal(point:
|
|
2472
|
+
globalToLocal(point: PointLike): Point
|
|
2448
2473
|
|
|
2449
2474
|
/**
|
|
2450
2475
|
* Converts the specified point from the item's own local coordinate space
|
|
@@ -2454,7 +2479,7 @@ declare namespace paper {
|
|
|
2454
2479
|
*
|
|
2455
2480
|
* @return the transformed point as a new instance
|
|
2456
2481
|
*/
|
|
2457
|
-
localToGlobal(point:
|
|
2482
|
+
localToGlobal(point: PointLike): Point
|
|
2458
2483
|
|
|
2459
2484
|
/**
|
|
2460
2485
|
* Converts the specified point from the parent's coordinate space to
|
|
@@ -2464,7 +2489,7 @@ declare namespace paper {
|
|
|
2464
2489
|
*
|
|
2465
2490
|
* @return the transformed point as a new instance
|
|
2466
2491
|
*/
|
|
2467
|
-
parentToLocal(point:
|
|
2492
|
+
parentToLocal(point: PointLike): Point
|
|
2468
2493
|
|
|
2469
2494
|
/**
|
|
2470
2495
|
* Converts the specified point from the item's own local coordinate space
|
|
@@ -2474,13 +2499,13 @@ declare namespace paper {
|
|
|
2474
2499
|
*
|
|
2475
2500
|
* @return the transformed point as a new instance
|
|
2476
2501
|
*/
|
|
2477
|
-
localToParent(point:
|
|
2502
|
+
localToParent(point: PointLike): Point
|
|
2478
2503
|
|
|
2479
2504
|
/**
|
|
2480
2505
|
* Transform the item so that its {@link #bounds} fit within the specified
|
|
2481
2506
|
* rectangle, without changing its aspect ratio.
|
|
2482
2507
|
*/
|
|
2483
|
-
fitBounds(rectangle:
|
|
2508
|
+
fitBounds(rectangle: RectangleLike, fill?: boolean): void
|
|
2484
2509
|
|
|
2485
2510
|
/**
|
|
2486
2511
|
* Attaches an event handler to the item.
|
|
@@ -2923,7 +2948,7 @@ declare namespace paper {
|
|
|
2923
2948
|
*
|
|
2924
2949
|
* @return this affine transform
|
|
2925
2950
|
*/
|
|
2926
|
-
translate(point:
|
|
2951
|
+
translate(point: PointLike): Matrix
|
|
2927
2952
|
|
|
2928
2953
|
/**
|
|
2929
2954
|
* Concatenates this matrix with a translate transformation.
|
|
@@ -2943,7 +2968,7 @@ declare namespace paper {
|
|
|
2943
2968
|
*
|
|
2944
2969
|
* @return this affine transform
|
|
2945
2970
|
*/
|
|
2946
|
-
scale(scale: number, center?:
|
|
2971
|
+
scale(scale: number, center?: PointLike): Matrix
|
|
2947
2972
|
|
|
2948
2973
|
/**
|
|
2949
2974
|
* Concatenates this matrix with a scaling transformation.
|
|
@@ -2954,7 +2979,7 @@ declare namespace paper {
|
|
|
2954
2979
|
*
|
|
2955
2980
|
* @return this affine transform
|
|
2956
2981
|
*/
|
|
2957
|
-
scale(hor: number, ver: number, center?:
|
|
2982
|
+
scale(hor: number, ver: number, center?: PointLike): Matrix
|
|
2958
2983
|
|
|
2959
2984
|
/**
|
|
2960
2985
|
* Concatenates this matrix with a rotation transformation around an
|
|
@@ -2965,7 +2990,7 @@ declare namespace paper {
|
|
|
2965
2990
|
*
|
|
2966
2991
|
* @return this affine transform
|
|
2967
2992
|
*/
|
|
2968
|
-
rotate(angle: number, center:
|
|
2993
|
+
rotate(angle: number, center: PointLike): Matrix
|
|
2969
2994
|
|
|
2970
2995
|
/**
|
|
2971
2996
|
* Concatenates this matrix with a rotation transformation around an
|
|
@@ -2987,7 +3012,7 @@ declare namespace paper {
|
|
|
2987
3012
|
*
|
|
2988
3013
|
* @return this affine transform
|
|
2989
3014
|
*/
|
|
2990
|
-
shear(shear:
|
|
3015
|
+
shear(shear: PointLike, center?: PointLike): Matrix
|
|
2991
3016
|
|
|
2992
3017
|
/**
|
|
2993
3018
|
* Concatenates this matrix with a shear transformation.
|
|
@@ -2998,7 +3023,7 @@ declare namespace paper {
|
|
|
2998
3023
|
*
|
|
2999
3024
|
* @return this affine transform
|
|
3000
3025
|
*/
|
|
3001
|
-
shear(hor: number, ver: number, center?:
|
|
3026
|
+
shear(hor: number, ver: number, center?: PointLike): Matrix
|
|
3002
3027
|
|
|
3003
3028
|
/**
|
|
3004
3029
|
* Concatenates this matrix with a skew transformation.
|
|
@@ -3008,7 +3033,7 @@ declare namespace paper {
|
|
|
3008
3033
|
*
|
|
3009
3034
|
* @return this affine transform
|
|
3010
3035
|
*/
|
|
3011
|
-
skew(skew:
|
|
3036
|
+
skew(skew: PointLike, center?: PointLike): Matrix
|
|
3012
3037
|
|
|
3013
3038
|
/**
|
|
3014
3039
|
* Concatenates this matrix with a skew transformation.
|
|
@@ -3019,7 +3044,7 @@ declare namespace paper {
|
|
|
3019
3044
|
*
|
|
3020
3045
|
* @return this affine transform
|
|
3021
3046
|
*/
|
|
3022
|
-
skew(hor: number, ver: number, center?:
|
|
3047
|
+
skew(hor: number, ver: number, center?: PointLike): Matrix
|
|
3023
3048
|
|
|
3024
3049
|
/**
|
|
3025
3050
|
* Appends the specified matrix to this matrix. This is the equivalent of
|
|
@@ -3109,7 +3134,7 @@ declare namespace paper {
|
|
|
3109
3134
|
*
|
|
3110
3135
|
* @return the transformed point
|
|
3111
3136
|
*/
|
|
3112
|
-
transform(point:
|
|
3137
|
+
transform(point: PointLike): Point
|
|
3113
3138
|
|
|
3114
3139
|
/**
|
|
3115
3140
|
* Transforms an array of coordinates by this matrix and stores the results
|
|
@@ -3130,7 +3155,7 @@ declare namespace paper {
|
|
|
3130
3155
|
*
|
|
3131
3156
|
* @param point - the point to be transformed
|
|
3132
3157
|
*/
|
|
3133
|
-
inverseTransform(point:
|
|
3158
|
+
inverseTransform(point: PointLike): Point
|
|
3134
3159
|
|
|
3135
3160
|
/**
|
|
3136
3161
|
* Decomposes the affine transformation described by this matrix into
|
|
@@ -3341,7 +3366,7 @@ declare namespace paper {
|
|
|
3341
3366
|
* the element, or the size of the canvas to be created for usage in a web
|
|
3342
3367
|
* worker.
|
|
3343
3368
|
*/
|
|
3344
|
-
setup(element: HTMLCanvasElement | string |
|
|
3369
|
+
setup(element: HTMLCanvasElement | string | SizeLike): void
|
|
3345
3370
|
|
|
3346
3371
|
/**
|
|
3347
3372
|
* Activates this PaperScope, so all newly created items will be placed
|
|
@@ -3510,7 +3535,7 @@ declare namespace paper {
|
|
|
3510
3535
|
* the same object, e.g. if the segment to be added already belongs to
|
|
3511
3536
|
* another path.
|
|
3512
3537
|
*/
|
|
3513
|
-
add(...segment: (Segment |
|
|
3538
|
+
add(...segment: (Segment | PointLike | number[])[]): Segment | Segment[]
|
|
3514
3539
|
|
|
3515
3540
|
/**
|
|
3516
3541
|
* Inserts one or more segments at a given index in the list of this path's
|
|
@@ -3522,7 +3547,7 @@ declare namespace paper {
|
|
|
3522
3547
|
* @return the added segment. This is not necessarily the same
|
|
3523
3548
|
* object, e.g. if the segment to be added already belongs to another path
|
|
3524
3549
|
*/
|
|
3525
|
-
insert(index: number, segment: Segment |
|
|
3550
|
+
insert(index: number, segment: Segment | PointLike): Segment
|
|
3526
3551
|
|
|
3527
3552
|
/**
|
|
3528
3553
|
* Adds an array of segments (or types that can be converted to segments)
|
|
@@ -3664,7 +3689,7 @@ declare namespace paper {
|
|
|
3664
3689
|
*
|
|
3665
3690
|
* @return the curve location of the specified point
|
|
3666
3691
|
*/
|
|
3667
|
-
getLocationOf(point:
|
|
3692
|
+
getLocationOf(point: PointLike): CurveLocation
|
|
3668
3693
|
|
|
3669
3694
|
/**
|
|
3670
3695
|
* Returns the length of the path from its beginning up to up to the
|
|
@@ -3674,7 +3699,7 @@ declare namespace paper {
|
|
|
3674
3699
|
*
|
|
3675
3700
|
* @return the length of the path up to the specified point
|
|
3676
3701
|
*/
|
|
3677
|
-
getOffsetOf(point:
|
|
3702
|
+
getOffsetOf(point: PointLike): number
|
|
3678
3703
|
|
|
3679
3704
|
/**
|
|
3680
3705
|
* Returns the curve location of the specified offset on the path.
|
|
@@ -3760,7 +3785,7 @@ declare namespace paper {
|
|
|
3760
3785
|
* @return path offsets where the path is tangential to the
|
|
3761
3786
|
* provided tangent
|
|
3762
3787
|
*/
|
|
3763
|
-
getOffsetsWithTangent(tangent:
|
|
3788
|
+
getOffsetsWithTangent(tangent: PointLike): number[]
|
|
3764
3789
|
|
|
3765
3790
|
}
|
|
3766
3791
|
namespace Path {
|
|
@@ -3772,7 +3797,7 @@ declare namespace paper {
|
|
|
3772
3797
|
* @param from - the line's starting point
|
|
3773
3798
|
* @param to - the line's ending point
|
|
3774
3799
|
*/
|
|
3775
|
-
constructor(from:
|
|
3800
|
+
constructor(from: PointLike, to: PointLike)
|
|
3776
3801
|
|
|
3777
3802
|
/**
|
|
3778
3803
|
* Creates a linear path item from the properties described by an object
|
|
@@ -3792,7 +3817,7 @@ declare namespace paper {
|
|
|
3792
3817
|
* @param center - the center point of the circle
|
|
3793
3818
|
* @param radius - the radius of the circle
|
|
3794
3819
|
*/
|
|
3795
|
-
constructor(center:
|
|
3820
|
+
constructor(center: PointLike, radius: number)
|
|
3796
3821
|
|
|
3797
3822
|
/**
|
|
3798
3823
|
* Creates a circular path item from the properties described by an
|
|
@@ -3813,7 +3838,7 @@ declare namespace paper {
|
|
|
3813
3838
|
* geometry of the rectangular path to be created
|
|
3814
3839
|
* @param radius - the size of the rounded corners
|
|
3815
3840
|
*/
|
|
3816
|
-
constructor(rectangle:
|
|
3841
|
+
constructor(rectangle: RectangleLike, radius?: SizeLike)
|
|
3817
3842
|
|
|
3818
3843
|
/**
|
|
3819
3844
|
* Creates a rectangular path item from a point and a size object.
|
|
@@ -3821,7 +3846,7 @@ declare namespace paper {
|
|
|
3821
3846
|
* @param point - the rectangle's top-left corner.
|
|
3822
3847
|
* @param size - the rectangle's size.
|
|
3823
3848
|
*/
|
|
3824
|
-
constructor(point:
|
|
3849
|
+
constructor(point: PointLike, size: SizeLike)
|
|
3825
3850
|
|
|
3826
3851
|
/**
|
|
3827
3852
|
* Creates a rectangular path item from the passed points. These do not
|
|
@@ -3831,7 +3856,7 @@ declare namespace paper {
|
|
|
3831
3856
|
* @param from - the first point defining the rectangle
|
|
3832
3857
|
* @param to - the second point defining the rectangle
|
|
3833
3858
|
*/
|
|
3834
|
-
constructor(from:
|
|
3859
|
+
constructor(from: PointLike, to: PointLike)
|
|
3835
3860
|
|
|
3836
3861
|
/**
|
|
3837
3862
|
* Creates a rectangular path item from the properties described by an
|
|
@@ -3850,7 +3875,7 @@ declare namespace paper {
|
|
|
3850
3875
|
*
|
|
3851
3876
|
* @param rectangle - the rectangle circumscribing the ellipse
|
|
3852
3877
|
*/
|
|
3853
|
-
constructor(rectangle:
|
|
3878
|
+
constructor(rectangle: RectangleLike)
|
|
3854
3879
|
|
|
3855
3880
|
/**
|
|
3856
3881
|
* Creates an elliptical path item from the properties described by an
|
|
@@ -3871,7 +3896,7 @@ declare namespace paper {
|
|
|
3871
3896
|
* @param through - the point the arc passes through
|
|
3872
3897
|
* @param to - the end point of the arc
|
|
3873
3898
|
*/
|
|
3874
|
-
constructor(from:
|
|
3899
|
+
constructor(from: PointLike, through: PointLike, to: PointLike)
|
|
3875
3900
|
|
|
3876
3901
|
/**
|
|
3877
3902
|
* Creates an circular arc path item from the properties described by an
|
|
@@ -3892,7 +3917,7 @@ declare namespace paper {
|
|
|
3892
3917
|
* @param sides - the number of sides of the polygon
|
|
3893
3918
|
* @param radius - the radius of the polygon
|
|
3894
3919
|
*/
|
|
3895
|
-
constructor(center:
|
|
3920
|
+
constructor(center: PointLike, sides: number, radius: number)
|
|
3896
3921
|
|
|
3897
3922
|
/**
|
|
3898
3923
|
* Creates a regular polygon shaped path item from the properties
|
|
@@ -3916,7 +3941,7 @@ declare namespace paper {
|
|
|
3916
3941
|
* @param center - the center point of the star
|
|
3917
3942
|
* @param points - the number of points of the star
|
|
3918
3943
|
*/
|
|
3919
|
-
constructor(center:
|
|
3944
|
+
constructor(center: PointLike, points: number, radius1: number, radius2: number)
|
|
3920
3945
|
|
|
3921
3946
|
/**
|
|
3922
3947
|
* Creates a star shaped path item from the properties described by an
|
|
@@ -4141,7 +4166,7 @@ declare namespace paper {
|
|
|
4141
4166
|
* @return the location on the path that's the closest to
|
|
4142
4167
|
* the specified point
|
|
4143
4168
|
*/
|
|
4144
|
-
getNearestLocation(point:
|
|
4169
|
+
getNearestLocation(point: PointLike): CurveLocation
|
|
4145
4170
|
|
|
4146
4171
|
/**
|
|
4147
4172
|
* Returns the nearest point on the path item to the specified point.
|
|
@@ -4151,7 +4176,7 @@ declare namespace paper {
|
|
|
4151
4176
|
* @return the point on the path that's the closest to the specified
|
|
4152
4177
|
* point
|
|
4153
4178
|
*/
|
|
4154
|
-
getNearestPoint(point:
|
|
4179
|
+
getNearestPoint(point: PointLike): Point
|
|
4155
4180
|
|
|
4156
4181
|
/**
|
|
4157
4182
|
* Reverses the orientation of the path item. When called on
|
|
@@ -4292,7 +4317,7 @@ declare namespace paper {
|
|
|
4292
4317
|
*
|
|
4293
4318
|
* @param point - the point in which to start the path
|
|
4294
4319
|
*/
|
|
4295
|
-
moveTo(point:
|
|
4320
|
+
moveTo(point: PointLike): void
|
|
4296
4321
|
|
|
4297
4322
|
/**
|
|
4298
4323
|
* Adds a straight curve to the path, from the the last segment in the path
|
|
@@ -4301,7 +4326,7 @@ declare namespace paper {
|
|
|
4301
4326
|
* @param point - the destination point of the newly added straight
|
|
4302
4327
|
* curve
|
|
4303
4328
|
*/
|
|
4304
|
-
lineTo(point:
|
|
4329
|
+
lineTo(point: PointLike): void
|
|
4305
4330
|
|
|
4306
4331
|
/**
|
|
4307
4332
|
* Adds an arc from the position of the last segment in the path, passing
|
|
@@ -4311,7 +4336,7 @@ declare namespace paper {
|
|
|
4311
4336
|
* @param through - the point where the arc should pass through
|
|
4312
4337
|
* @param to - the point where the arc should end
|
|
4313
4338
|
*/
|
|
4314
|
-
arcTo(through:
|
|
4339
|
+
arcTo(through: PointLike, to: PointLike): void
|
|
4315
4340
|
|
|
4316
4341
|
/**
|
|
4317
4342
|
* Adds an arc from the position of the last segment in the path to
|
|
@@ -4321,7 +4346,7 @@ declare namespace paper {
|
|
|
4321
4346
|
* @param clockwise - specifies whether the arc should be
|
|
4322
4347
|
* drawn in clockwise direction
|
|
4323
4348
|
*/
|
|
4324
|
-
arcTo(to:
|
|
4349
|
+
arcTo(to: PointLike, clockwise?: boolean): void
|
|
4325
4350
|
|
|
4326
4351
|
/**
|
|
4327
4352
|
* Adds a curve from the last segment in the path through the specified
|
|
@@ -4333,7 +4358,7 @@ declare namespace paper {
|
|
|
4333
4358
|
* @param time - the curve-time parameter at which the
|
|
4334
4359
|
* `through` point is to be located
|
|
4335
4360
|
*/
|
|
4336
|
-
curveTo(through:
|
|
4361
|
+
curveTo(through: PointLike, to: PointLike, time?: number): void
|
|
4337
4362
|
|
|
4338
4363
|
/**
|
|
4339
4364
|
* Adds a cubic bezier curve to the path, from the last segment to the
|
|
@@ -4348,7 +4373,7 @@ declare namespace paper {
|
|
|
4348
4373
|
* for {@link Segment#handleIn} of its second segment are calculated
|
|
4349
4374
|
* @param to - the destination point of the newly added curve
|
|
4350
4375
|
*/
|
|
4351
|
-
cubicCurveTo(handle1:
|
|
4376
|
+
cubicCurveTo(handle1: PointLike, handle2: PointLike, to: PointLike): void
|
|
4352
4377
|
|
|
4353
4378
|
/**
|
|
4354
4379
|
* Adds a quadratic bezier curve to the path, from the last segment to the
|
|
@@ -4365,7 +4390,7 @@ declare namespace paper {
|
|
|
4365
4390
|
* calculated
|
|
4366
4391
|
* @param to - the destination point of the newly added curve
|
|
4367
4392
|
*/
|
|
4368
|
-
quadraticCurveTo(handle:
|
|
4393
|
+
quadraticCurveTo(handle: PointLike, to: PointLike): void
|
|
4369
4394
|
|
|
4370
4395
|
/**
|
|
4371
4396
|
* Closes the path. When closed, Paper.js connects the first and last
|
|
@@ -4382,7 +4407,7 @@ declare namespace paper {
|
|
|
4382
4407
|
* child and a point is added as its first segment relative to the position
|
|
4383
4408
|
* of the last segment of the current path.
|
|
4384
4409
|
*/
|
|
4385
|
-
moveBy(to:
|
|
4410
|
+
moveBy(to: PointLike): void
|
|
4386
4411
|
|
|
4387
4412
|
/**
|
|
4388
4413
|
* Adds a straight curve to the path, from the the last segment in the path
|
|
@@ -4391,7 +4416,7 @@ declare namespace paper {
|
|
|
4391
4416
|
* @param point - the vector describing the destination of the newly
|
|
4392
4417
|
* added straight curve
|
|
4393
4418
|
*/
|
|
4394
|
-
lineBy(point:
|
|
4419
|
+
lineBy(point: PointLike): void
|
|
4395
4420
|
|
|
4396
4421
|
/**
|
|
4397
4422
|
* Adds an arc from the position of the last segment in the path, passing
|
|
@@ -4402,7 +4427,7 @@ declare namespace paper {
|
|
|
4402
4427
|
* @param through - the vector where the arc should pass through
|
|
4403
4428
|
* @param to - the vector where the arc should end
|
|
4404
4429
|
*/
|
|
4405
|
-
arcBy(through:
|
|
4430
|
+
arcBy(through: PointLike, to: PointLike): void
|
|
4406
4431
|
|
|
4407
4432
|
/**
|
|
4408
4433
|
* Adds an arc from the position of the last segment in the path to the `to`
|
|
@@ -4413,7 +4438,7 @@ declare namespace paper {
|
|
|
4413
4438
|
* @param clockwise - specifies whether the arc should be
|
|
4414
4439
|
* drawn in clockwise direction
|
|
4415
4440
|
*/
|
|
4416
|
-
arcBy(to:
|
|
4441
|
+
arcBy(to: PointLike, clockwise?: boolean): void
|
|
4417
4442
|
|
|
4418
4443
|
/**
|
|
4419
4444
|
* Adds a curve from the last segment in the path through the specified
|
|
@@ -4425,7 +4450,7 @@ declare namespace paper {
|
|
|
4425
4450
|
* @param time - the curve-time parameter at which the
|
|
4426
4451
|
* `through` point is to be located
|
|
4427
4452
|
*/
|
|
4428
|
-
curveBy(through:
|
|
4453
|
+
curveBy(through: PointLike, to: PointLike, time?: number): void
|
|
4429
4454
|
|
|
4430
4455
|
/**
|
|
4431
4456
|
* Adds a cubic bezier curve to the path, from the last segment to the
|
|
@@ -4438,7 +4463,7 @@ declare namespace paper {
|
|
|
4438
4463
|
* added curve
|
|
4439
4464
|
* @param to - the destination point of the newly added curve
|
|
4440
4465
|
*/
|
|
4441
|
-
cubicCurveBy(handle1:
|
|
4466
|
+
cubicCurveBy(handle1: PointLike, handle2: PointLike, to: PointLike): void
|
|
4442
4467
|
|
|
4443
4468
|
/**
|
|
4444
4469
|
* Adds a quadratic bezier curve to the path, from the last segment to the
|
|
@@ -4454,7 +4479,7 @@ declare namespace paper {
|
|
|
4454
4479
|
* second segment are calculated
|
|
4455
4480
|
* @param to - the destination point of the newly added curve
|
|
4456
4481
|
*/
|
|
4457
|
-
quadraticCurveBy(handle:
|
|
4482
|
+
quadraticCurveBy(handle: PointLike, to: PointLike): void
|
|
4458
4483
|
|
|
4459
4484
|
}
|
|
4460
4485
|
|
|
@@ -4536,12 +4561,12 @@ declare namespace paper {
|
|
|
4536
4561
|
* Creates a Point object using the width and height values of the given
|
|
4537
4562
|
* Size object.
|
|
4538
4563
|
*/
|
|
4539
|
-
constructor(size:
|
|
4564
|
+
constructor(size: SizeLike)
|
|
4540
4565
|
|
|
4541
4566
|
/**
|
|
4542
4567
|
* Creates a Point object using the coordinates of the given Point object.
|
|
4543
4568
|
*/
|
|
4544
|
-
constructor(point:
|
|
4569
|
+
constructor(point: PointLike)
|
|
4545
4570
|
|
|
4546
4571
|
/**
|
|
4547
4572
|
* Creates a Point object using the properties in the given object.
|
|
@@ -4563,7 +4588,7 @@ declare namespace paper {
|
|
|
4563
4588
|
*
|
|
4564
4589
|
* @return true if the points are equal
|
|
4565
4590
|
*/
|
|
4566
|
-
equals(point:
|
|
4591
|
+
equals(point: PointLike): boolean
|
|
4567
4592
|
|
|
4568
4593
|
/**
|
|
4569
4594
|
* Returns a copy of the point.
|
|
@@ -4583,7 +4608,7 @@ declare namespace paper {
|
|
|
4583
4608
|
*
|
|
4584
4609
|
* @return the angle in degrees
|
|
4585
4610
|
*/
|
|
4586
|
-
getAngle(point:
|
|
4611
|
+
getAngle(point: PointLike): number
|
|
4587
4612
|
|
|
4588
4613
|
/**
|
|
4589
4614
|
* Returns the smaller angle between two vectors in radians. The angle is
|
|
@@ -4591,7 +4616,7 @@ declare namespace paper {
|
|
|
4591
4616
|
*
|
|
4592
4617
|
* @return the angle in radians
|
|
4593
4618
|
*/
|
|
4594
|
-
getAngleInRadians(point:
|
|
4619
|
+
getAngleInRadians(point: PointLike): number
|
|
4595
4620
|
|
|
4596
4621
|
/**
|
|
4597
4622
|
* Returns the angle between two vectors. The angle is directional and
|
|
@@ -4602,7 +4627,7 @@ declare namespace paper {
|
|
|
4602
4627
|
*
|
|
4603
4628
|
* @return the angle between the two vectors
|
|
4604
4629
|
*/
|
|
4605
|
-
getDirectedAngle(point:
|
|
4630
|
+
getDirectedAngle(point: PointLike): number
|
|
4606
4631
|
|
|
4607
4632
|
/**
|
|
4608
4633
|
* Returns the distance between the point and another point.
|
|
@@ -4610,7 +4635,7 @@ declare namespace paper {
|
|
|
4610
4635
|
* @param squared - Controls whether the distance should
|
|
4611
4636
|
* remain squared, or its square root should be calculated
|
|
4612
4637
|
*/
|
|
4613
|
-
getDistance(point:
|
|
4638
|
+
getDistance(point: PointLike, squared?: boolean): number
|
|
4614
4639
|
|
|
4615
4640
|
/**
|
|
4616
4641
|
* Normalize modifies the {@link #length} of the vector to `1` without
|
|
@@ -4637,7 +4662,7 @@ declare namespace paper {
|
|
|
4637
4662
|
*
|
|
4638
4663
|
* @return the rotated point
|
|
4639
4664
|
*/
|
|
4640
|
-
rotate(angle: number, center:
|
|
4665
|
+
rotate(angle: number, center: PointLike): Point
|
|
4641
4666
|
|
|
4642
4667
|
/**
|
|
4643
4668
|
* Transforms the point by the matrix as a new point. The object itself is
|
|
@@ -4667,7 +4692,7 @@ declare namespace paper {
|
|
|
4667
4692
|
*
|
|
4668
4693
|
* @return the addition of the two points as a new point
|
|
4669
4694
|
*/
|
|
4670
|
-
add(point:
|
|
4695
|
+
add(point: PointLike): Point
|
|
4671
4696
|
|
|
4672
4697
|
/**
|
|
4673
4698
|
* Returns the subtraction of the supplied value to both coordinates of
|
|
@@ -4689,7 +4714,7 @@ declare namespace paper {
|
|
|
4689
4714
|
*
|
|
4690
4715
|
* @return the subtraction of the two points as a new point
|
|
4691
4716
|
*/
|
|
4692
|
-
subtract(point:
|
|
4717
|
+
subtract(point: PointLike): Point
|
|
4693
4718
|
|
|
4694
4719
|
/**
|
|
4695
4720
|
* Returns the multiplication of the supplied value to both coordinates of
|
|
@@ -4712,7 +4737,7 @@ declare namespace paper {
|
|
|
4712
4737
|
*
|
|
4713
4738
|
* @return the multiplication of the two points as a new point
|
|
4714
4739
|
*/
|
|
4715
|
-
multiply(point:
|
|
4740
|
+
multiply(point: PointLike): Point
|
|
4716
4741
|
|
|
4717
4742
|
/**
|
|
4718
4743
|
* Returns the division of the supplied value to both coordinates of
|
|
@@ -4734,7 +4759,7 @@ declare namespace paper {
|
|
|
4734
4759
|
*
|
|
4735
4760
|
* @return the division of the two points as a new point
|
|
4736
4761
|
*/
|
|
4737
|
-
divide(point:
|
|
4762
|
+
divide(point: PointLike): Point
|
|
4738
4763
|
|
|
4739
4764
|
/**
|
|
4740
4765
|
* The modulo operator returns the integer remainders of dividing the point
|
|
@@ -4752,7 +4777,7 @@ declare namespace paper {
|
|
|
4752
4777
|
* @return the integer remainders of dividing the points by each
|
|
4753
4778
|
* other as a new point
|
|
4754
4779
|
*/
|
|
4755
|
-
modulo(point:
|
|
4780
|
+
modulo(point: PointLike): Point
|
|
4756
4781
|
|
|
4757
4782
|
/**
|
|
4758
4783
|
* Checks whether the point is inside the boundaries of the rectangle.
|
|
@@ -4761,7 +4786,7 @@ declare namespace paper {
|
|
|
4761
4786
|
*
|
|
4762
4787
|
* @return true if the point is inside the rectangle
|
|
4763
4788
|
*/
|
|
4764
|
-
isInside(rect:
|
|
4789
|
+
isInside(rect: RectangleLike): boolean
|
|
4765
4790
|
|
|
4766
4791
|
/**
|
|
4767
4792
|
* Checks if the point is within a given distance of another point.
|
|
@@ -4771,7 +4796,7 @@ declare namespace paper {
|
|
|
4771
4796
|
*
|
|
4772
4797
|
* @return true if it is within the given distance
|
|
4773
4798
|
*/
|
|
4774
|
-
isClose(point:
|
|
4799
|
+
isClose(point: PointLike, tolerance: number): boolean
|
|
4775
4800
|
|
|
4776
4801
|
/**
|
|
4777
4802
|
* Checks if the vector represented by this point is collinear (parallel) to
|
|
@@ -4781,7 +4806,7 @@ declare namespace paper {
|
|
|
4781
4806
|
*
|
|
4782
4807
|
* @return true it is collinear
|
|
4783
4808
|
*/
|
|
4784
|
-
isCollinear(point:
|
|
4809
|
+
isCollinear(point: PointLike): boolean
|
|
4785
4810
|
|
|
4786
4811
|
/**
|
|
4787
4812
|
* Checks if the vector represented by this point is orthogonal
|
|
@@ -4791,7 +4816,7 @@ declare namespace paper {
|
|
|
4791
4816
|
*
|
|
4792
4817
|
* @return true it is orthogonal
|
|
4793
4818
|
*/
|
|
4794
|
-
isOrthogonal(point:
|
|
4819
|
+
isOrthogonal(point: PointLike): boolean
|
|
4795
4820
|
|
|
4796
4821
|
/**
|
|
4797
4822
|
* Checks if this point has both the x and y coordinate set to 0.
|
|
@@ -4826,14 +4851,14 @@ declare namespace paper {
|
|
|
4826
4851
|
*
|
|
4827
4852
|
* @return the dot product of the two points
|
|
4828
4853
|
*/
|
|
4829
|
-
dot(point:
|
|
4854
|
+
dot(point: PointLike): number
|
|
4830
4855
|
|
|
4831
4856
|
/**
|
|
4832
4857
|
* Returns the cross product of the point and another point.
|
|
4833
4858
|
*
|
|
4834
4859
|
* @return the cross product of the two points
|
|
4835
4860
|
*/
|
|
4836
|
-
cross(point:
|
|
4861
|
+
cross(point: PointLike): number
|
|
4837
4862
|
|
|
4838
4863
|
/**
|
|
4839
4864
|
* Returns the projection of the point onto another point.
|
|
@@ -4841,7 +4866,7 @@ declare namespace paper {
|
|
|
4841
4866
|
*
|
|
4842
4867
|
* @return the projection of the point onto another point
|
|
4843
4868
|
*/
|
|
4844
|
-
project(point:
|
|
4869
|
+
project(point: PointLike): Point
|
|
4845
4870
|
|
|
4846
4871
|
/**
|
|
4847
4872
|
* Returns a new point with rounded {@link #x} and {@link #y} values. The
|
|
@@ -4875,7 +4900,7 @@ declare namespace paper {
|
|
|
4875
4900
|
*
|
|
4876
4901
|
* @return the newly created point object
|
|
4877
4902
|
*/
|
|
4878
|
-
static min(point1:
|
|
4903
|
+
static min(point1: PointLike, point2: PointLike): Point
|
|
4879
4904
|
|
|
4880
4905
|
/**
|
|
4881
4906
|
* Returns a new point object with the largest {@link #x} and
|
|
@@ -4883,7 +4908,7 @@ declare namespace paper {
|
|
|
4883
4908
|
*
|
|
4884
4909
|
* @return the newly created point object
|
|
4885
4910
|
*/
|
|
4886
|
-
static max(point1:
|
|
4911
|
+
static max(point1: PointLike, point2: PointLike): Point
|
|
4887
4912
|
|
|
4888
4913
|
/**
|
|
4889
4914
|
* Returns a point object with random {@link #x} and {@link #y} values
|
|
@@ -4912,7 +4937,7 @@ declare namespace paper {
|
|
|
4912
4937
|
*
|
|
4913
4938
|
* @param point - the position where the text will start
|
|
4914
4939
|
*/
|
|
4915
|
-
constructor(point:
|
|
4940
|
+
constructor(point: PointLike)
|
|
4916
4941
|
|
|
4917
4942
|
/**
|
|
4918
4943
|
* Creates a point text item from the properties described by an object
|
|
@@ -4995,7 +5020,7 @@ declare namespace paper {
|
|
|
4995
5020
|
* to find the element, or the size of the canvas to be created for usage in
|
|
4996
5021
|
* a web worker.
|
|
4997
5022
|
*/
|
|
4998
|
-
constructor(element: HTMLCanvasElement | string |
|
|
5023
|
+
constructor(element: HTMLCanvasElement | string | SizeLike)
|
|
4999
5024
|
|
|
5000
5025
|
/**
|
|
5001
5026
|
* Activates this project, so all newly created items will be placed
|
|
@@ -5093,7 +5118,7 @@ declare namespace paper {
|
|
|
5093
5118
|
* @return a hit result object that contains more information
|
|
5094
5119
|
* about what exactly was hit or `null` if nothing was hit
|
|
5095
5120
|
*/
|
|
5096
|
-
hitTest(point:
|
|
5121
|
+
hitTest(point: PointLike, options?: object): HitResult
|
|
5097
5122
|
|
|
5098
5123
|
/**
|
|
5099
5124
|
* Performs a hit-test on the item and its children (if it is a {@link
|
|
@@ -5110,7 +5135,7 @@ declare namespace paper {
|
|
|
5110
5135
|
* @return hit result objects for all hits, describing what
|
|
5111
5136
|
* exactly was hit or `null` if nothing was hit
|
|
5112
5137
|
*/
|
|
5113
|
-
hitTestAll(point:
|
|
5138
|
+
hitTestAll(point: PointLike, options?: object): HitResult[]
|
|
5114
5139
|
|
|
5115
5140
|
/**
|
|
5116
5141
|
* Fetch items contained within the project whose properties match the
|
|
@@ -5214,6 +5239,9 @@ declare namespace paper {
|
|
|
5214
5239
|
* @option [options.embedImages=true] {Boolean} whether raster images should
|
|
5215
5240
|
* be embedded as base64 data inlined in the xlink:href attribute, or
|
|
5216
5241
|
* kept as a link to their external URL.
|
|
5242
|
+
* @option [options.reduceAttributes=true] {Boolean} wether to only include
|
|
5243
|
+
* style attributes in the SVG output that differ from their parents,
|
|
5244
|
+
* or to always include them (much faster but leading to redundancies).
|
|
5217
5245
|
*
|
|
5218
5246
|
* @param options - the export options
|
|
5219
5247
|
*
|
|
@@ -5386,7 +5414,7 @@ declare namespace paper {
|
|
|
5386
5414
|
* @param position - the center position at which the raster item is
|
|
5387
5415
|
* placed
|
|
5388
5416
|
*/
|
|
5389
|
-
constructor(source?: HTMLImageElement | HTMLCanvasElement | string, position?:
|
|
5417
|
+
constructor(source?: HTMLImageElement | HTMLCanvasElement | string, position?: PointLike)
|
|
5390
5418
|
|
|
5391
5419
|
/**
|
|
5392
5420
|
* Creates a new empty raster of the given size, and places it in the
|
|
@@ -5396,7 +5424,7 @@ declare namespace paper {
|
|
|
5396
5424
|
* @param position - the center position at which the raster item is
|
|
5397
5425
|
* placed
|
|
5398
5426
|
*/
|
|
5399
|
-
constructor(size:
|
|
5427
|
+
constructor(size: SizeLike, position?: PointLike)
|
|
5400
5428
|
|
|
5401
5429
|
/**
|
|
5402
5430
|
* Creates a new raster from an object description, and places it in the
|
|
@@ -5416,7 +5444,7 @@ declare namespace paper {
|
|
|
5416
5444
|
*
|
|
5417
5445
|
* @return the sub image as a Canvas object
|
|
5418
5446
|
*/
|
|
5419
|
-
getSubCanvas(rect:
|
|
5447
|
+
getSubCanvas(rect: RectangleLike): HTMLCanvasElement
|
|
5420
5448
|
|
|
5421
5449
|
/**
|
|
5422
5450
|
* Extracts a part of the raster item's content as a new raster item, placed
|
|
@@ -5427,7 +5455,7 @@ declare namespace paper {
|
|
|
5427
5455
|
*
|
|
5428
5456
|
* @return the sub raster as a newly created raster item
|
|
5429
5457
|
*/
|
|
5430
|
-
getSubRaster(rect:
|
|
5458
|
+
getSubRaster(rect: RectangleLike): Raster
|
|
5431
5459
|
|
|
5432
5460
|
/**
|
|
5433
5461
|
* Returns a Base 64 encoded `data:` URL representation of the raster.
|
|
@@ -5440,7 +5468,7 @@ declare namespace paper {
|
|
|
5440
5468
|
* @param point - the offset of the image as a point in pixel
|
|
5441
5469
|
* coordinates
|
|
5442
5470
|
*/
|
|
5443
|
-
drawImage(image: CanvasImageSource, point:
|
|
5471
|
+
drawImage(image: CanvasImageSource, point: PointLike): void
|
|
5444
5472
|
|
|
5445
5473
|
/**
|
|
5446
5474
|
* Calculates the average color of the image within the given path,
|
|
@@ -5450,7 +5478,7 @@ declare namespace paper {
|
|
|
5450
5478
|
* @return the average color contained in the area covered by the
|
|
5451
5479
|
* specified path, rectangle or point
|
|
5452
5480
|
*/
|
|
5453
|
-
getAverageColor(object: Path |
|
|
5481
|
+
getAverageColor(object: Path | RectangleLike | PointLike): Color
|
|
5454
5482
|
|
|
5455
5483
|
/**
|
|
5456
5484
|
* Gets the color of a pixel in the raster.
|
|
@@ -5470,7 +5498,7 @@ declare namespace paper {
|
|
|
5470
5498
|
*
|
|
5471
5499
|
* @return the color of the pixel
|
|
5472
5500
|
*/
|
|
5473
|
-
getPixel(point:
|
|
5501
|
+
getPixel(point: PointLike): Color
|
|
5474
5502
|
|
|
5475
5503
|
/**
|
|
5476
5504
|
* Sets the color of the specified pixel to the specified color.
|
|
@@ -5488,7 +5516,7 @@ declare namespace paper {
|
|
|
5488
5516
|
* coordinates
|
|
5489
5517
|
* @param color - the color that the pixel will be set to
|
|
5490
5518
|
*/
|
|
5491
|
-
setPixel(point:
|
|
5519
|
+
setPixel(point: PointLike, color: Color): void
|
|
5492
5520
|
|
|
5493
5521
|
/**
|
|
5494
5522
|
* Clears the image, if it is backed by a canvas.
|
|
@@ -5496,13 +5524,13 @@ declare namespace paper {
|
|
|
5496
5524
|
clear(): void
|
|
5497
5525
|
|
|
5498
5526
|
|
|
5499
|
-
createImageData(size:
|
|
5527
|
+
createImageData(size: SizeLike): ImageData
|
|
5500
5528
|
|
|
5501
5529
|
|
|
5502
|
-
getImageData(rect:
|
|
5530
|
+
getImageData(rect: RectangleLike): ImageData
|
|
5503
5531
|
|
|
5504
5532
|
|
|
5505
|
-
putImageData(data: ImageData, point:
|
|
5533
|
+
putImageData(data: ImageData, point: PointLike): void
|
|
5506
5534
|
|
|
5507
5535
|
|
|
5508
5536
|
setImageData(data: ImageData): void
|
|
@@ -5634,7 +5662,7 @@ declare namespace paper {
|
|
|
5634
5662
|
* @param point - the top-left point of the rectangle
|
|
5635
5663
|
* @param size - the size of the rectangle
|
|
5636
5664
|
*/
|
|
5637
|
-
constructor(point:
|
|
5665
|
+
constructor(point: PointLike, size: SizeLike)
|
|
5638
5666
|
|
|
5639
5667
|
/**
|
|
5640
5668
|
* Creates a rectangle object.
|
|
@@ -5652,12 +5680,12 @@ declare namespace paper {
|
|
|
5652
5680
|
* @param from - the first point defining the rectangle
|
|
5653
5681
|
* @param to - the second point defining the rectangle
|
|
5654
5682
|
*/
|
|
5655
|
-
constructor(from:
|
|
5683
|
+
constructor(from: PointLike, to: PointLike)
|
|
5656
5684
|
|
|
5657
5685
|
/**
|
|
5658
5686
|
* Creates a new rectangle object from the passed rectangle object.
|
|
5659
5687
|
*/
|
|
5660
|
-
constructor(rectangle:
|
|
5688
|
+
constructor(rectangle: RectangleLike)
|
|
5661
5689
|
|
|
5662
5690
|
/**
|
|
5663
5691
|
* Creates a Rectangle object.
|
|
@@ -5685,7 +5713,7 @@ declare namespace paper {
|
|
|
5685
5713
|
*
|
|
5686
5714
|
* @return true if the rectangles are equal
|
|
5687
5715
|
*/
|
|
5688
|
-
equals(rect:
|
|
5716
|
+
equals(rect: RectangleLike): boolean
|
|
5689
5717
|
|
|
5690
5718
|
/**
|
|
5691
5719
|
* @return a string representation of this rectangle
|
|
@@ -5704,7 +5732,7 @@ declare namespace paper {
|
|
|
5704
5732
|
*
|
|
5705
5733
|
* @return true if the point is inside the rectangle's boundary
|
|
5706
5734
|
*/
|
|
5707
|
-
contains(point:
|
|
5735
|
+
contains(point: PointLike): boolean
|
|
5708
5736
|
|
|
5709
5737
|
/**
|
|
5710
5738
|
* Tests if the interior of the rectangle entirely contains the specified
|
|
@@ -5715,7 +5743,7 @@ declare namespace paper {
|
|
|
5715
5743
|
* @return true if the rectangle entirely contains the specified
|
|
5716
5744
|
* rectangle
|
|
5717
5745
|
*/
|
|
5718
|
-
contains(rect:
|
|
5746
|
+
contains(rect: RectangleLike): boolean
|
|
5719
5747
|
|
|
5720
5748
|
/**
|
|
5721
5749
|
* Tests if the interior of this rectangle intersects the interior of
|
|
@@ -5730,7 +5758,7 @@ declare namespace paper {
|
|
|
5730
5758
|
* @return true if the rectangle and the specified rectangle
|
|
5731
5759
|
* intersect each other
|
|
5732
5760
|
*/
|
|
5733
|
-
intersects(rect:
|
|
5761
|
+
intersects(rect: RectangleLike, epsilon?: number): boolean
|
|
5734
5762
|
|
|
5735
5763
|
/**
|
|
5736
5764
|
* Returns a new rectangle representing the intersection of this rectangle
|
|
@@ -5742,7 +5770,7 @@ declare namespace paper {
|
|
|
5742
5770
|
* @return the largest rectangle contained in both the specified
|
|
5743
5771
|
* rectangle and in this rectangle
|
|
5744
5772
|
*/
|
|
5745
|
-
intersect(rect:
|
|
5773
|
+
intersect(rect: RectangleLike): Rectangle
|
|
5746
5774
|
|
|
5747
5775
|
/**
|
|
5748
5776
|
* Returns a new rectangle representing the union of this rectangle with the
|
|
@@ -5753,7 +5781,7 @@ declare namespace paper {
|
|
|
5753
5781
|
* @return the smallest rectangle containing both the specified
|
|
5754
5782
|
* rectangle and this rectangle
|
|
5755
5783
|
*/
|
|
5756
|
-
unite(rect:
|
|
5784
|
+
unite(rect: RectangleLike): Rectangle
|
|
5757
5785
|
|
|
5758
5786
|
/**
|
|
5759
5787
|
* Adds a point to this rectangle. The resulting rectangle is the smallest
|
|
@@ -5770,7 +5798,7 @@ declare namespace paper {
|
|
|
5770
5798
|
* @return the smallest rectangle that contains both the
|
|
5771
5799
|
* original rectangle and the specified point
|
|
5772
5800
|
*/
|
|
5773
|
-
include(point:
|
|
5801
|
+
include(point: PointLike): Rectangle
|
|
5774
5802
|
|
|
5775
5803
|
/**
|
|
5776
5804
|
* Returns a new rectangle expanded by the specified amount in horizontal
|
|
@@ -5781,7 +5809,7 @@ declare namespace paper {
|
|
|
5781
5809
|
*
|
|
5782
5810
|
* @return the expanded rectangle
|
|
5783
5811
|
*/
|
|
5784
|
-
expand(amount: number |
|
|
5812
|
+
expand(amount: number | SizeLike | PointLike): Rectangle
|
|
5785
5813
|
|
|
5786
5814
|
/**
|
|
5787
5815
|
* Returns a new rectangle expanded by the specified amounts in horizontal
|
|
@@ -5895,7 +5923,7 @@ declare namespace paper {
|
|
|
5895
5923
|
* anchor point of the segment that describes the out tangent of the
|
|
5896
5924
|
* segment
|
|
5897
5925
|
*/
|
|
5898
|
-
constructor(point?:
|
|
5926
|
+
constructor(point?: PointLike, handleIn?: PointLike, handleOut?: PointLike)
|
|
5899
5927
|
|
|
5900
5928
|
/**
|
|
5901
5929
|
* Creates a new Segment object.
|
|
@@ -6083,7 +6111,7 @@ declare namespace paper {
|
|
|
6083
6111
|
* @param center - the center point of the circle
|
|
6084
6112
|
* @param radius - the radius of the circle
|
|
6085
6113
|
*/
|
|
6086
|
-
constructor(center:
|
|
6114
|
+
constructor(center: PointLike, radius: number)
|
|
6087
6115
|
|
|
6088
6116
|
/**
|
|
6089
6117
|
* Creates a circular shape item from the properties described by an
|
|
@@ -6104,7 +6132,7 @@ declare namespace paper {
|
|
|
6104
6132
|
* geometry of the rectangular shape to be created
|
|
6105
6133
|
* @param radius - the size of the rounded corners
|
|
6106
6134
|
*/
|
|
6107
|
-
constructor(rectangle:
|
|
6135
|
+
constructor(rectangle: RectangleLike, radius?: SizeLike)
|
|
6108
6136
|
|
|
6109
6137
|
/**
|
|
6110
6138
|
* Creates a rectangular shape item from a point and a size object.
|
|
@@ -6112,7 +6140,7 @@ declare namespace paper {
|
|
|
6112
6140
|
* @param point - the rectangle's top-left corner.
|
|
6113
6141
|
* @param size - the rectangle's size.
|
|
6114
6142
|
*/
|
|
6115
|
-
constructor(point:
|
|
6143
|
+
constructor(point: PointLike, size: SizeLike)
|
|
6116
6144
|
|
|
6117
6145
|
/**
|
|
6118
6146
|
* Creates a rectangular shape item from the passed points. These do not
|
|
@@ -6122,7 +6150,7 @@ declare namespace paper {
|
|
|
6122
6150
|
* @param from - the first point defining the rectangle
|
|
6123
6151
|
* @param to - the second point defining the rectangle
|
|
6124
6152
|
*/
|
|
6125
|
-
constructor(from:
|
|
6153
|
+
constructor(from: PointLike, to: PointLike)
|
|
6126
6154
|
|
|
6127
6155
|
/**
|
|
6128
6156
|
* Creates a rectangular shape item from the properties described by an
|
|
@@ -6141,7 +6169,7 @@ declare namespace paper {
|
|
|
6141
6169
|
*
|
|
6142
6170
|
* @param rectangle - the rectangle circumscribing the ellipse
|
|
6143
6171
|
*/
|
|
6144
|
-
constructor(rectangle:
|
|
6172
|
+
constructor(rectangle: RectangleLike)
|
|
6145
6173
|
|
|
6146
6174
|
/**
|
|
6147
6175
|
* Creates an elliptical shape item from the properties described by an
|
|
@@ -6188,13 +6216,13 @@ declare namespace paper {
|
|
|
6188
6216
|
/**
|
|
6189
6217
|
* Creates a Size object using the coordinates of the given Size object.
|
|
6190
6218
|
*/
|
|
6191
|
-
constructor(size:
|
|
6219
|
+
constructor(size: SizeLike)
|
|
6192
6220
|
|
|
6193
6221
|
/**
|
|
6194
6222
|
* Creates a Size object using the {@link Point#x} and {@link Point#y}
|
|
6195
6223
|
* values of the given Point object.
|
|
6196
6224
|
*/
|
|
6197
|
-
constructor(point:
|
|
6225
|
+
constructor(point: PointLike)
|
|
6198
6226
|
|
|
6199
6227
|
/**
|
|
6200
6228
|
* Creates a Size object using the properties in the given object.
|
|
@@ -6214,7 +6242,7 @@ declare namespace paper {
|
|
|
6214
6242
|
*
|
|
6215
6243
|
* @param size - the size to compare to
|
|
6216
6244
|
*/
|
|
6217
|
-
equals(size:
|
|
6245
|
+
equals(size: SizeLike): boolean
|
|
6218
6246
|
|
|
6219
6247
|
/**
|
|
6220
6248
|
* Returns a copy of the size.
|
|
@@ -6244,7 +6272,7 @@ declare namespace paper {
|
|
|
6244
6272
|
*
|
|
6245
6273
|
* @return the addition of the two sizes as a new size
|
|
6246
6274
|
*/
|
|
6247
|
-
add(size:
|
|
6275
|
+
add(size: SizeLike): Size
|
|
6248
6276
|
|
|
6249
6277
|
/**
|
|
6250
6278
|
* Returns the subtraction of the supplied value from the width and height
|
|
@@ -6265,7 +6293,7 @@ declare namespace paper {
|
|
|
6265
6293
|
*
|
|
6266
6294
|
* @return the subtraction of the two sizes as a new size
|
|
6267
6295
|
*/
|
|
6268
|
-
subtract(size:
|
|
6296
|
+
subtract(size: SizeLike): Size
|
|
6269
6297
|
|
|
6270
6298
|
/**
|
|
6271
6299
|
* Returns the multiplication of the supplied value with the width and
|
|
@@ -6285,7 +6313,7 @@ declare namespace paper {
|
|
|
6285
6313
|
*
|
|
6286
6314
|
* @return the multiplication of the two sizes as a new size
|
|
6287
6315
|
*/
|
|
6288
|
-
multiply(size:
|
|
6316
|
+
multiply(size: SizeLike): Size
|
|
6289
6317
|
|
|
6290
6318
|
/**
|
|
6291
6319
|
* Returns the division of the supplied value by the width and height of the
|
|
@@ -6305,7 +6333,7 @@ declare namespace paper {
|
|
|
6305
6333
|
*
|
|
6306
6334
|
* @return the division of the two sizes as a new size
|
|
6307
6335
|
*/
|
|
6308
|
-
divide(size:
|
|
6336
|
+
divide(size: SizeLike): Size
|
|
6309
6337
|
|
|
6310
6338
|
/**
|
|
6311
6339
|
* The modulo operator returns the integer remainders of dividing the size
|
|
@@ -6323,7 +6351,7 @@ declare namespace paper {
|
|
|
6323
6351
|
* @return the integer remainders of dividing the sizes by each
|
|
6324
6352
|
* other as a new size
|
|
6325
6353
|
*/
|
|
6326
|
-
modulo(size:
|
|
6354
|
+
modulo(size: SizeLike): Size
|
|
6327
6355
|
|
|
6328
6356
|
/**
|
|
6329
6357
|
* Checks if this size has both the width and height set to 0.
|
|
@@ -6372,7 +6400,7 @@ declare namespace paper {
|
|
|
6372
6400
|
*
|
|
6373
6401
|
* @return the newly created size object
|
|
6374
6402
|
*/
|
|
6375
|
-
static min(size1:
|
|
6403
|
+
static min(size1: SizeLike, size2: SizeLike): Size
|
|
6376
6404
|
|
|
6377
6405
|
/**
|
|
6378
6406
|
* Returns a new size object with the largest {@link #width} and
|
|
@@ -6380,7 +6408,7 @@ declare namespace paper {
|
|
|
6380
6408
|
*
|
|
6381
6409
|
* @return the newly created size object
|
|
6382
6410
|
*/
|
|
6383
|
-
static max(size1:
|
|
6411
|
+
static max(size1: SizeLike, size2: SizeLike): Size
|
|
6384
6412
|
|
|
6385
6413
|
/**
|
|
6386
6414
|
* Returns a size object with random {@link #width} and {@link #height}
|
|
@@ -6558,7 +6586,7 @@ declare namespace paper {
|
|
|
6558
6586
|
*
|
|
6559
6587
|
* @param position - the position of the placed symbol
|
|
6560
6588
|
*/
|
|
6561
|
-
place(position?:
|
|
6589
|
+
place(position?: PointLike): SymbolItem
|
|
6562
6590
|
|
|
6563
6591
|
/**
|
|
6564
6592
|
* Returns a copy of the symbol.
|
|
@@ -6592,7 +6620,7 @@ declare namespace paper {
|
|
|
6592
6620
|
* item to place as a symbol
|
|
6593
6621
|
* @param point - the center point of the placed symbol
|
|
6594
6622
|
*/
|
|
6595
|
-
constructor(definition: SymbolDefinition | Item, point?:
|
|
6623
|
+
constructor(definition: SymbolDefinition | Item, point?: PointLike)
|
|
6596
6624
|
|
|
6597
6625
|
}
|
|
6598
6626
|
|
|
@@ -6950,7 +6978,7 @@ declare namespace paper {
|
|
|
6950
6978
|
readonly pixelRatio: number
|
|
6951
6979
|
|
|
6952
6980
|
/**
|
|
6953
|
-
* The
|
|
6981
|
+
* The resolution of the underlying canvas / device in pixel per inch (DPI).
|
|
6954
6982
|
* It is `72` for normal displays, and `144` for high-resolution
|
|
6955
6983
|
* displays with a pixel-ratio of `2`.
|
|
6956
6984
|
*/
|
|
@@ -7174,7 +7202,7 @@ declare namespace paper {
|
|
|
7174
7202
|
*
|
|
7175
7203
|
* @param delta - the offset to translate the view by
|
|
7176
7204
|
*/
|
|
7177
|
-
translate(delta:
|
|
7205
|
+
translate(delta: PointLike): void
|
|
7178
7206
|
|
|
7179
7207
|
/**
|
|
7180
7208
|
* Rotates the view by a given angle around the given center point.
|
|
@@ -7185,7 +7213,7 @@ declare namespace paper {
|
|
|
7185
7213
|
*
|
|
7186
7214
|
* @param angle - the rotation angle
|
|
7187
7215
|
*/
|
|
7188
|
-
rotate(angle: number, center?:
|
|
7216
|
+
rotate(angle: number, center?: PointLike): void
|
|
7189
7217
|
|
|
7190
7218
|
/**
|
|
7191
7219
|
* Scales the view by the given value from its center point, or optionally
|
|
@@ -7193,7 +7221,7 @@ declare namespace paper {
|
|
|
7193
7221
|
*
|
|
7194
7222
|
* @param scale - the scale factor
|
|
7195
7223
|
*/
|
|
7196
|
-
scale(scale: number, center?:
|
|
7224
|
+
scale(scale: number, center?: PointLike): void
|
|
7197
7225
|
|
|
7198
7226
|
/**
|
|
7199
7227
|
* Scales the view by the given values from its center point, or optionally
|
|
@@ -7202,7 +7230,7 @@ declare namespace paper {
|
|
|
7202
7230
|
* @param hor - the horizontal scale factor
|
|
7203
7231
|
* @param ver - the vertical scale factor
|
|
7204
7232
|
*/
|
|
7205
|
-
scale(hor: number, ver: number, center?:
|
|
7233
|
+
scale(hor: number, ver: number, center?: PointLike): void
|
|
7206
7234
|
|
|
7207
7235
|
/**
|
|
7208
7236
|
* Shears the view by the given value from its center point, or optionally
|
|
@@ -7212,7 +7240,7 @@ declare namespace paper {
|
|
|
7212
7240
|
*
|
|
7213
7241
|
* @param shear - the horizontal and vertical shear factors as a point
|
|
7214
7242
|
*/
|
|
7215
|
-
shear(shear:
|
|
7243
|
+
shear(shear: PointLike, center?: PointLike): void
|
|
7216
7244
|
|
|
7217
7245
|
/**
|
|
7218
7246
|
* Shears the view by the given values from its center point, or optionally
|
|
@@ -7223,7 +7251,7 @@ declare namespace paper {
|
|
|
7223
7251
|
* @param hor - the horizontal shear factor
|
|
7224
7252
|
* @param ver - the vertical shear factor
|
|
7225
7253
|
*/
|
|
7226
|
-
shear(hor: number, ver: number, center?:
|
|
7254
|
+
shear(hor: number, ver: number, center?: PointLike): void
|
|
7227
7255
|
|
|
7228
7256
|
/**
|
|
7229
7257
|
* Skews the view by the given angles from its center point, or optionally
|
|
@@ -7233,7 +7261,7 @@ declare namespace paper {
|
|
|
7233
7261
|
*
|
|
7234
7262
|
* @param skew - the horizontal and vertical skew angles in degrees
|
|
7235
7263
|
*/
|
|
7236
|
-
skew(skew:
|
|
7264
|
+
skew(skew: PointLike, center?: PointLike): void
|
|
7237
7265
|
|
|
7238
7266
|
/**
|
|
7239
7267
|
* Skews the view by the given angles from its center point, or optionally
|
|
@@ -7244,7 +7272,7 @@ declare namespace paper {
|
|
|
7244
7272
|
* @param hor - the horizontal skew angle in degrees
|
|
7245
7273
|
* @param ver - the vertical sskew angle in degrees
|
|
7246
7274
|
*/
|
|
7247
|
-
skew(hor: number, ver: number, center?:
|
|
7275
|
+
skew(hor: number, ver: number, center?: PointLike): void
|
|
7248
7276
|
|
|
7249
7277
|
/**
|
|
7250
7278
|
* Transform the view.
|
|
@@ -7262,7 +7290,7 @@ declare namespace paper {
|
|
|
7262
7290
|
*
|
|
7263
7291
|
* @return the point converted into view coordinates
|
|
7264
7292
|
*/
|
|
7265
|
-
projectToView(point:
|
|
7293
|
+
projectToView(point: PointLike): Point
|
|
7266
7294
|
|
|
7267
7295
|
/**
|
|
7268
7296
|
* Converts the passed point from view coordinate space to project
|
|
@@ -7272,7 +7300,7 @@ declare namespace paper {
|
|
|
7272
7300
|
*
|
|
7273
7301
|
* @return the point converted into project coordinates
|
|
7274
7302
|
*/
|
|
7275
|
-
viewToProject(point:
|
|
7303
|
+
viewToProject(point: PointLike): Point
|
|
7276
7304
|
|
|
7277
7305
|
/**
|
|
7278
7306
|
* Determines and returns the event location in project coordinate space.
|