mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Prebuilt module for develop
This commit is contained in:
parent
740eb03ca4
commit
23a64bc118
8 changed files with 6046 additions and 4240 deletions
2
dist/docs/assets/js/paper.js
vendored
2
dist/docs/assets/js/paper.js
vendored
|
@ -9,7 +9,7 @@
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Date: Mon Apr 22 06:57:55 2024 +0000
|
* Date: Wed Apr 24 14:48:57 2024 -0700
|
||||||
*
|
*
|
||||||
***
|
***
|
||||||
*
|
*
|
||||||
|
|
2
dist/paper-core.js
vendored
2
dist/paper-core.js
vendored
|
@ -9,7 +9,7 @@
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Date: Mon Apr 22 06:57:55 2024 +0000
|
* Date: Wed Apr 24 14:48:57 2024 -0700
|
||||||
*
|
*
|
||||||
***
|
***
|
||||||
*
|
*
|
||||||
|
|
4
dist/paper-core.min.js
vendored
4
dist/paper-core.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/paper-full.js
vendored
2
dist/paper-full.js
vendored
|
@ -9,7 +9,7 @@
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Date: Mon Apr 22 06:57:55 2024 +0000
|
* Date: Wed Apr 24 14:48:57 2024 -0700
|
||||||
*
|
*
|
||||||
***
|
***
|
||||||
*
|
*
|
||||||
|
|
4
dist/paper-full.min.js
vendored
4
dist/paper-full.min.js
vendored
File diff suppressed because one or more lines are too long
554
dist/paper.d.ts
vendored
554
dist/paper.d.ts
vendored
|
@ -9,7 +9,7 @@
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Date: Mon Apr 22 06:57:55 2024 +0000
|
* Date: Wed Apr 24 14:48:57 2024 -0700
|
||||||
*
|
*
|
||||||
* This is an auto-generated type definition.
|
* This is an auto-generated type definition.
|
||||||
*/
|
*/
|
||||||
|
@ -107,6 +107,16 @@ declare namespace paper {
|
||||||
*/
|
*/
|
||||||
constructor(red: number, green: number, blue: number, alpha?: number)
|
constructor(red: number, green: number, blue: number, alpha?: number)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a gray Color object.
|
||||||
|
*
|
||||||
|
* @param gray - the amount of gray in the color as a value
|
||||||
|
* between `0` and `1`
|
||||||
|
* @param alpha - the alpha of the color as a value between `0`
|
||||||
|
* and `1`
|
||||||
|
*/
|
||||||
|
constructor(gray: number, alpha?: number)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a Color object from a CSS string. All common CSS color string
|
* Creates a Color object from a CSS string. All common CSS color string
|
||||||
* formats are supported:
|
* formats are supported:
|
||||||
|
@ -125,16 +135,6 @@ declare namespace paper {
|
||||||
*/
|
*/
|
||||||
constructor(gradient: Gradient, origin: Point, destination: Point, highlight?: Point)
|
constructor(gradient: Gradient, origin: Point, destination: Point, highlight?: Point)
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a gray Color object.
|
|
||||||
*
|
|
||||||
* @param gray - the amount of gray in the color as a value
|
|
||||||
* between `0` and `1`
|
|
||||||
* @param alpha - the alpha of the color as a value between `0`
|
|
||||||
* and `1`
|
|
||||||
*/
|
|
||||||
constructor(gray: number, alpha?: number)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a HSB, HSL or gradient Color object from the properties of
|
* Creates a HSB, HSL or gradient Color object from the properties of
|
||||||
* the provided object:
|
* the provided object:
|
||||||
|
@ -215,15 +215,14 @@ declare namespace paper {
|
||||||
toString(): string
|
toString(): string
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the division of the supplied color to the color as a new
|
* Returns the color as a CSS string.
|
||||||
* color.
|
|
||||||
* The object itself is not modified!
|
|
||||||
*
|
*
|
||||||
* @param color - the color to divide
|
* @param hex - whether to return the color in hexadecimal
|
||||||
|
* representation or as a CSS RGB / RGBA string.
|
||||||
*
|
*
|
||||||
* @return the division of the two colors as a new color
|
* @return a CSS string representation of the color
|
||||||
*/
|
*/
|
||||||
divide(color: Color): Color
|
toCSS(hex: boolean): string
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transform the gradient color by the specified matrix.
|
* Transform the gradient color by the specified matrix.
|
||||||
|
@ -322,14 +321,15 @@ declare namespace paper {
|
||||||
divide(number: number): Color
|
divide(number: number): Color
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the color as a CSS string.
|
* Returns the division of the supplied color to the color as a new
|
||||||
|
* color.
|
||||||
|
* The object itself is not modified!
|
||||||
*
|
*
|
||||||
* @param hex - whether to return the color in hexadecimal
|
* @param color - the color to divide
|
||||||
* representation or as a CSS RGB / RGBA string.
|
|
||||||
*
|
*
|
||||||
* @return a CSS string representation of the color
|
* @return the division of the two colors as a new color
|
||||||
*/
|
*/
|
||||||
toCSS(hex: boolean): string
|
divide(color: Color): Color
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -739,17 +739,13 @@ declare namespace paper {
|
||||||
isVertical(): boolean
|
isVertical(): boolean
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns all intersections between two {@link Curve} objects as an
|
* Calculates the curve location at the specified offset on the curve.
|
||||||
* array of {@link CurveLocation} objects.
|
|
||||||
*
|
*
|
||||||
* @param curve - the other curve to find the intersections with
|
* @param offset - the offset on the curve
|
||||||
* (if the curve itself or `null` is passed, the self intersection
|
|
||||||
* of the curve is returned, if it exists)
|
|
||||||
*
|
*
|
||||||
* @return the locations of all intersections between
|
* @return the curve location at the specified the offset
|
||||||
* the curves
|
|
||||||
*/
|
*/
|
||||||
getIntersections(curve: Curve): CurveLocation[]
|
getLocationAt(offset: number): CurveLocation
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates the curve location at the specified curve-time parameter on
|
* Calculates the curve location at the specified curve-time parameter on
|
||||||
|
@ -977,13 +973,17 @@ declare namespace paper {
|
||||||
getCurvatureAtTime(time: number): number
|
getCurvatureAtTime(time: number): number
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates the curve location at the specified offset on the curve.
|
* Returns all intersections between two {@link Curve} objects as an
|
||||||
|
* array of {@link CurveLocation} objects.
|
||||||
*
|
*
|
||||||
* @param offset - the offset on the curve
|
* @param curve - the other curve to find the intersections with
|
||||||
|
* (if the curve itself or `null` is passed, the self intersection
|
||||||
|
* of the curve is returned, if it exists)
|
||||||
*
|
*
|
||||||
* @return the curve location at the specified the offset
|
* @return the locations of all intersections between
|
||||||
|
* the curves
|
||||||
*/
|
*/
|
||||||
getLocationAt(offset: number): CurveLocation
|
getIntersections(curve: Curve): CurveLocation[]
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1747,13 +1747,6 @@ declare namespace paper {
|
||||||
onMouseLeave: Function | null
|
onMouseLeave: Function | null
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if the item contains any children items.
|
|
||||||
*
|
|
||||||
* @return true it has one or more children
|
|
||||||
*/
|
|
||||||
hasChildren(): boolean
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the properties of the passed object literal on this item to the
|
* Sets the properties of the passed object literal on this item to the
|
||||||
* values defined in the object literal, if the item has property of the
|
* values defined in the object literal, if the item has property of the
|
||||||
|
@ -1763,6 +1756,20 @@ declare namespace paper {
|
||||||
*/
|
*/
|
||||||
set(props: object): Item
|
set(props: object): Item
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clones the item within the same project and places the copy above the
|
||||||
|
* item.
|
||||||
|
*
|
||||||
|
* @option [insert=true] specifies whether the copy should be
|
||||||
|
* inserted into the scene graph. When set to `true`, it is inserted
|
||||||
|
* above the original
|
||||||
|
* @option [deep=true] specifies whether the item's children should also be
|
||||||
|
* cloned
|
||||||
|
*
|
||||||
|
* @return the newly cloned item
|
||||||
|
*/
|
||||||
|
clone(options?: object): Item
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copies the content of the specified item over to this item.
|
* Copies the content of the specified item over to this item.
|
||||||
*
|
*
|
||||||
|
@ -2256,18 +2263,11 @@ declare namespace paper {
|
||||||
hasShadow(): boolean
|
hasShadow(): boolean
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clones the item within the same project and places the copy above the
|
* Checks if the item contains any children items.
|
||||||
* item.
|
|
||||||
*
|
*
|
||||||
* @option [insert=true] specifies whether the copy should be
|
* @return true it has one or more children
|
||||||
* inserted into the scene graph. When set to `true`, it is inserted
|
|
||||||
* above the original
|
|
||||||
* @option [deep=true] specifies whether the item's children should also be
|
|
||||||
* cloned
|
|
||||||
*
|
|
||||||
* @return the newly cloned item
|
|
||||||
*/
|
*/
|
||||||
clone(options?: object): Item
|
hasChildren(): boolean
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether the item and all its parents are inserted into scene graph
|
* Checks whether the item and all its parents are inserted into scene graph
|
||||||
|
@ -2845,6 +2845,18 @@ declare namespace paper {
|
||||||
*/
|
*/
|
||||||
constructor()
|
constructor()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a 2D affine transformation matrix.
|
||||||
|
*
|
||||||
|
* @param a - the a property of the transform
|
||||||
|
* @param b - the b property of the transform
|
||||||
|
* @param c - the c property of the transform
|
||||||
|
* @param d - the d property of the transform
|
||||||
|
* @param tx - the tx property of the transform
|
||||||
|
* @param ty - the ty property of the transform
|
||||||
|
*/
|
||||||
|
constructor(a: number, b: number, c: number, d: number, tx: number, ty: number)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a 2D affine transformation matrix.
|
* Creates a 2D affine transformation matrix.
|
||||||
*
|
*
|
||||||
|
@ -2859,18 +2871,6 @@ declare namespace paper {
|
||||||
*/
|
*/
|
||||||
constructor(matrix: Matrix)
|
constructor(matrix: Matrix)
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a 2D affine transformation matrix.
|
|
||||||
*
|
|
||||||
* @param a - the a property of the transform
|
|
||||||
* @param b - the b property of the transform
|
|
||||||
* @param c - the c property of the transform
|
|
||||||
* @param d - the d property of the transform
|
|
||||||
* @param tx - the tx property of the transform
|
|
||||||
* @param ty - the ty property of the transform
|
|
||||||
*/
|
|
||||||
constructor(a: number, b: number, c: number, d: number, tx: number, ty: number)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the matrix to the passed values. Note that any sequence of
|
* Sets the matrix to the passed values. Note that any sequence of
|
||||||
* parameters that is supported by the various {@link Matrix} constructors
|
* parameters that is supported by the various {@link Matrix} constructors
|
||||||
|
@ -2988,9 +2988,15 @@ declare namespace paper {
|
||||||
shear(shear: Point, center?: Point): Matrix
|
shear(shear: Point, center?: Point): Matrix
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies this matrix to the specified Canvas Context.
|
* Concatenates this matrix with a shear transformation.
|
||||||
|
*
|
||||||
|
* @param hor - the horizontal shear factor
|
||||||
|
* @param ver - the vertical shear factor
|
||||||
|
* @param center - the center for the shear transformation
|
||||||
|
*
|
||||||
|
* @return this affine transform
|
||||||
*/
|
*/
|
||||||
applyToContext(ctx: CanvasRenderingContext2D): void
|
shear(hor: number, ver: number, center?: Point): Matrix
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Concatenates this matrix with a skew transformation.
|
* Concatenates this matrix with a skew transformation.
|
||||||
|
@ -3134,15 +3140,9 @@ declare namespace paper {
|
||||||
decompose(): object
|
decompose(): object
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Concatenates this matrix with a shear transformation.
|
* Applies this matrix to the specified Canvas Context.
|
||||||
*
|
|
||||||
* @param hor - the horizontal shear factor
|
|
||||||
* @param ver - the vertical shear factor
|
|
||||||
* @param center - the center for the shear transformation
|
|
||||||
*
|
|
||||||
* @return this affine transform
|
|
||||||
*/
|
*/
|
||||||
shear(hor: number, ver: number, center?: Point): Matrix
|
applyToContext(ctx: CanvasRenderingContext2D): void
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3694,6 +3694,16 @@ declare namespace paper {
|
||||||
*/
|
*/
|
||||||
getPointAt(offset: number): Point
|
getPointAt(offset: number): Point
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculates the normalized tangent vector of the path at the given offset.
|
||||||
|
*
|
||||||
|
* @param offset - the offset on the path, where `0` is at
|
||||||
|
* the beginning of the path and {@link Path#length} at the end
|
||||||
|
*
|
||||||
|
* @return the normalized tangent vector at the given offset
|
||||||
|
*/
|
||||||
|
getTangentAt(offset: number): Point
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates the normal vector of the path at the given offset.
|
* Calculates the normal vector of the path at the given offset.
|
||||||
*
|
*
|
||||||
|
@ -3750,43 +3760,9 @@ declare namespace paper {
|
||||||
*/
|
*/
|
||||||
getOffsetsWithTangent(tangent: Point): number[]
|
getOffsetsWithTangent(tangent: Point): number[]
|
||||||
|
|
||||||
/**
|
|
||||||
* Calculates the normalized tangent vector of the path at the given offset.
|
|
||||||
*
|
|
||||||
* @param offset - the offset on the path, where `0` is at
|
|
||||||
* the beginning of the path and {@link Path#length} at the end
|
|
||||||
*
|
|
||||||
* @return the normalized tangent vector at the given offset
|
|
||||||
*/
|
|
||||||
getTangentAt(offset: number): Point
|
|
||||||
|
|
||||||
}
|
}
|
||||||
namespace Path {
|
namespace Path {
|
||||||
|
|
||||||
class Star extends Path {
|
|
||||||
/**
|
|
||||||
* Creates a star shaped path item from the properties described by an
|
|
||||||
* object literal.
|
|
||||||
*
|
|
||||||
* @param object - an object containing properties describing the
|
|
||||||
* path's attributes
|
|
||||||
*/
|
|
||||||
constructor(object: object)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a star shaped path item.
|
|
||||||
*
|
|
||||||
* The largest of `radius1` and `radius2` will be the outer radius of
|
|
||||||
* the star. The smallest of radius1 and radius2 will be the inner
|
|
||||||
* radius.
|
|
||||||
*
|
|
||||||
* @param center - the center point of the star
|
|
||||||
* @param points - the number of points of the star
|
|
||||||
*/
|
|
||||||
constructor(center: Point, points: number, radius1: number, radius2: number)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
class Line extends Path {
|
class Line extends Path {
|
||||||
/**
|
/**
|
||||||
* Creates a linear path item from two points describing a line.
|
* Creates a linear path item from two points describing a line.
|
||||||
|
@ -3926,6 +3902,30 @@ declare namespace paper {
|
||||||
constructor(object: object)
|
constructor(object: object)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class Star extends Path {
|
||||||
|
/**
|
||||||
|
* Creates a star shaped path item.
|
||||||
|
*
|
||||||
|
* The largest of `radius1` and `radius2` will be the outer radius of
|
||||||
|
* the star. The smallest of radius1 and radius2 will be the inner
|
||||||
|
* radius.
|
||||||
|
*
|
||||||
|
* @param center - the center point of the star
|
||||||
|
* @param points - the number of points of the star
|
||||||
|
*/
|
||||||
|
constructor(center: Point, points: number, radius1: number, radius2: number)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a star shaped path item from the properties described by an
|
||||||
|
* object literal.
|
||||||
|
*
|
||||||
|
* @param object - an object containing properties describing the
|
||||||
|
* path's attributes
|
||||||
|
*/
|
||||||
|
constructor(object: object)
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3956,20 +3956,6 @@ declare namespace paper {
|
||||||
pathData: string
|
pathData: string
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Interpolates between the two specified path items and uses the result
|
|
||||||
* as the geometry for this path item. The number of children and
|
|
||||||
* segments in the two paths involved in the operation should be the same.
|
|
||||||
*
|
|
||||||
* @param from - the path item defining the geometry when `factor`
|
|
||||||
* is `0`
|
|
||||||
* @param to - the path item defining the geometry when `factor`
|
|
||||||
* is `1`
|
|
||||||
* @param factor - the interpolation coefficient, typically between
|
|
||||||
* `0` and `1`, but extrapolation is possible too
|
|
||||||
*/
|
|
||||||
interpolate(from: PathItem, to: PathItem, factor: number): void
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unites the geometry of the specified path with this path's geometry
|
* Unites the geometry of the specified path with this path's geometry
|
||||||
* and returns the result as a new path item.
|
* and returns the result as a new path item.
|
||||||
|
@ -3985,6 +3971,26 @@ declare namespace paper {
|
||||||
*/
|
*/
|
||||||
unite(path: PathItem, options?: object): PathItem
|
unite(path: PathItem, options?: object): PathItem
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Intersects the geometry of the specified path with this path's
|
||||||
|
* geometry and returns the result as a new path item.
|
||||||
|
*
|
||||||
|
* @option [options.insert=true] {Boolean} whether the resulting item
|
||||||
|
* should be inserted back into the scene graph, above both paths
|
||||||
|
* involved in the operation
|
||||||
|
* @option [options.trace=true] {Boolean} whether the tracing method is
|
||||||
|
* used, treating both paths as areas when determining which parts
|
||||||
|
* of the paths are to be kept in the result, or whether the first
|
||||||
|
* path is only to be split at intersections, keeping the parts of
|
||||||
|
* the curves that intersect with the area of the second path.
|
||||||
|
*
|
||||||
|
* @param path - the path to intersect with
|
||||||
|
* @param options - the boolean operation options
|
||||||
|
*
|
||||||
|
* @return the resulting path item
|
||||||
|
*/
|
||||||
|
intersect(path: PathItem, options?: object): PathItem
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Subtracts the geometry of the specified path from this path's
|
* Subtracts the geometry of the specified path from this path's
|
||||||
* geometry and returns the result as a new path item.
|
* geometry and returns the result as a new path item.
|
||||||
|
@ -4251,24 +4257,18 @@ declare namespace paper {
|
||||||
simplify(tolerance?: number): boolean
|
simplify(tolerance?: number): boolean
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Intersects the geometry of the specified path with this path's
|
* Interpolates between the two specified path items and uses the result
|
||||||
* geometry and returns the result as a new path item.
|
* as the geometry for this path item. The number of children and
|
||||||
|
* segments in the two paths involved in the operation should be the same.
|
||||||
*
|
*
|
||||||
* @option [options.insert=true] {Boolean} whether the resulting item
|
* @param from - the path item defining the geometry when `factor`
|
||||||
* should be inserted back into the scene graph, above both paths
|
* is `0`
|
||||||
* involved in the operation
|
* @param to - the path item defining the geometry when `factor`
|
||||||
* @option [options.trace=true] {Boolean} whether the tracing method is
|
* is `1`
|
||||||
* used, treating both paths as areas when determining which parts
|
* @param factor - the interpolation coefficient, typically between
|
||||||
* of the paths are to be kept in the result, or whether the first
|
* `0` and `1`, but extrapolation is possible too
|
||||||
* path is only to be split at intersections, keeping the parts of
|
|
||||||
* the curves that intersect with the area of the second path.
|
|
||||||
*
|
|
||||||
* @param path - the path to intersect with
|
|
||||||
* @param options - the boolean operation options
|
|
||||||
*
|
|
||||||
* @return the resulting path item
|
|
||||||
*/
|
*/
|
||||||
intersect(path: PathItem, options?: object): PathItem
|
interpolate(from: PathItem, to: PathItem, factor: number): void
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compares the geometry of two paths to see if they describe the same
|
* Compares the geometry of two paths to see if they describe the same
|
||||||
|
@ -4524,6 +4524,12 @@ declare namespace paper {
|
||||||
*/
|
*/
|
||||||
constructor(x: number, y: number)
|
constructor(x: number, y: number)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a Point object using the numbers in the given array as
|
||||||
|
* coordinates.
|
||||||
|
*/
|
||||||
|
constructor(array: any[])
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a Point object using the width and height values of the given
|
* Creates a Point object using the width and height values of the given
|
||||||
* Size object.
|
* Size object.
|
||||||
|
@ -4535,12 +4541,6 @@ declare namespace paper {
|
||||||
*/
|
*/
|
||||||
constructor(point: Point)
|
constructor(point: Point)
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a Point object using the numbers in the given array as
|
|
||||||
* coordinates.
|
|
||||||
*/
|
|
||||||
constructor(array: any[])
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a Point object using the properties in the given object.
|
* Creates a Point object using the properties in the given object.
|
||||||
*
|
*
|
||||||
|
@ -4702,12 +4702,15 @@ declare namespace paper {
|
||||||
multiply(number: number): Point
|
multiply(number: number): Point
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a point object with random {@link #x} and {@link #y} values
|
* Returns the multiplication of the supplied point to the point as a new
|
||||||
* between `0` and `1`.
|
* point.
|
||||||
|
* The object itself is not modified!
|
||||||
*
|
*
|
||||||
* @return the newly created point object
|
* @param point - the point to multiply by
|
||||||
|
*
|
||||||
|
* @return the multiplication of the two points as a new point
|
||||||
*/
|
*/
|
||||||
static random(): Point
|
multiply(point: Point): Point
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the division of the supplied value to both coordinates of
|
* Returns the division of the supplied value to both coordinates of
|
||||||
|
@ -4881,15 +4884,12 @@ declare namespace paper {
|
||||||
static max(point1: Point, point2: Point): Point
|
static max(point1: Point, point2: Point): Point
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the multiplication of the supplied point to the point as a new
|
* Returns a point object with random {@link #x} and {@link #y} values
|
||||||
* point.
|
* between `0` and `1`.
|
||||||
* The object itself is not modified!
|
|
||||||
*
|
*
|
||||||
* @param point - the point to multiply by
|
* @return the newly created point object
|
||||||
*
|
|
||||||
* @return the multiplication of the two points as a new point
|
|
||||||
*/
|
*/
|
||||||
multiply(point: Point): Point
|
static random(): Point
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4996,21 +4996,10 @@ declare namespace paper {
|
||||||
constructor(element: HTMLCanvasElement | string | Size)
|
constructor(element: HTMLCanvasElement | string | Size)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Imports the provided external SVG file, converts it into Paper.js items
|
* Activates this project, so all newly created items will be placed
|
||||||
* and adds them to the active layer of this project.
|
* in it.
|
||||||
* Note that the project is not cleared first. You can call
|
|
||||||
* {@link Project#clear} to do so.
|
|
||||||
*
|
|
||||||
* @param svg - the URL of the SVG file to fetch.
|
|
||||||
* @param onLoad - the callback function to call once the SVG
|
|
||||||
* content is loaded from the given URL receiving two arguments: the
|
|
||||||
* converted `item` and the original `svg` data as a string. Only
|
|
||||||
* required when loading from external files.
|
|
||||||
*
|
|
||||||
* @return the newly created Paper.js item containing the converted
|
|
||||||
* SVG content
|
|
||||||
*/
|
*/
|
||||||
importSVG(svg: SVGElement | string, onLoad: Function): Item
|
activate(): void
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clears the project by removing all {@link Project#layers}.
|
* Clears the project by removing all {@link Project#layers}.
|
||||||
|
@ -5060,10 +5049,49 @@ declare namespace paper {
|
||||||
insertLayer(index: number, layer: Layer): Layer
|
insertLayer(index: number, layer: Layer): Layer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Activates this project, so all newly created items will be placed
|
* Performs a hit-test on the items contained within the project at the
|
||||||
* in it.
|
* location of the specified point.
|
||||||
|
*
|
||||||
|
* The options object allows you to control the specifics of the hit-test
|
||||||
|
* and may contain a combination of the following values:
|
||||||
|
*
|
||||||
|
* @option [options.tolerance={@link PaperScope#settings}.hitTolerance]
|
||||||
|
* {Number} the tolerance of the hit-test
|
||||||
|
* @option options.class {Function} only hit-test against a specific item
|
||||||
|
* class, or any of its sub-classes, by providing the constructor
|
||||||
|
* function against which an `instanceof` check is performed:
|
||||||
|
* {@values Group, Layer, Path, CompoundPath, Shape, Raster,
|
||||||
|
* SymbolItem, PointText, ...}
|
||||||
|
* @option options.match {Function} a match function to be called for each
|
||||||
|
* found hit result: Return `true` to return the result, `false` to keep
|
||||||
|
* searching
|
||||||
|
* @option [options.fill=true] {Boolean} hit-test the fill of items
|
||||||
|
* @option [options.stroke=true] {Boolean} hit-test the stroke of path
|
||||||
|
* items, taking into account the setting of stroke color and width
|
||||||
|
* @option [options.segments=true] {Boolean} hit-test for {@link
|
||||||
|
* Segment#point} of {@link Path} items
|
||||||
|
* @option options.curves {Boolean} hit-test the curves of path items,
|
||||||
|
* without taking the stroke color or width into account
|
||||||
|
* @option options.handles {Boolean} hit-test for the handles ({@link
|
||||||
|
* Segment#handleIn} / {@link Segment#handleOut}) of path segments.
|
||||||
|
* @option options.ends {Boolean} only hit-test for the first or last
|
||||||
|
* segment points of open path items
|
||||||
|
* @option options.position {Boolean} hit-test the {@link Item#position} of
|
||||||
|
* of items, which depends on the setting of {@link Item#pivot}
|
||||||
|
* @option options.center {Boolean} hit-test the {@link Rectangle#center} of
|
||||||
|
* the bounding rectangle of items ({@link Item#bounds})
|
||||||
|
* @option options.bounds {Boolean} hit-test the corners and side-centers of
|
||||||
|
* the bounding rectangle of items ({@link Item#bounds})
|
||||||
|
* @option options.guides {Boolean} hit-test items that have {@link
|
||||||
|
* Item#guide} set to `true`
|
||||||
|
* @option options.selected {Boolean} only hit selected items
|
||||||
|
*
|
||||||
|
* @param point - the point where the hit-test should be performed
|
||||||
|
*
|
||||||
|
* @return a hit result object that contains more information
|
||||||
|
* about what exactly was hit or `null` if nothing was hit
|
||||||
*/
|
*/
|
||||||
activate(): void
|
hitTest(point: Point, options?: object): HitResult
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs a hit-test on the item and its children (if it is a {@link
|
* Performs a hit-test on the item and its children (if it is a {@link
|
||||||
|
@ -5224,49 +5252,21 @@ declare namespace paper {
|
||||||
importSVG(svg: SVGElement | string, options?: object): Item
|
importSVG(svg: SVGElement | string, options?: object): Item
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs a hit-test on the items contained within the project at the
|
* Imports the provided external SVG file, converts it into Paper.js items
|
||||||
* location of the specified point.
|
* and adds them to the active layer of this project.
|
||||||
|
* Note that the project is not cleared first. You can call
|
||||||
|
* {@link Project#clear} to do so.
|
||||||
*
|
*
|
||||||
* The options object allows you to control the specifics of the hit-test
|
* @param svg - the URL of the SVG file to fetch.
|
||||||
* and may contain a combination of the following values:
|
* @param onLoad - the callback function to call once the SVG
|
||||||
|
* content is loaded from the given URL receiving two arguments: the
|
||||||
|
* converted `item` and the original `svg` data as a string. Only
|
||||||
|
* required when loading from external files.
|
||||||
*
|
*
|
||||||
* @option [options.tolerance={@link PaperScope#settings}.hitTolerance]
|
* @return the newly created Paper.js item containing the converted
|
||||||
* {Number} the tolerance of the hit-test
|
* SVG content
|
||||||
* @option options.class {Function} only hit-test against a specific item
|
|
||||||
* class, or any of its sub-classes, by providing the constructor
|
|
||||||
* function against which an `instanceof` check is performed:
|
|
||||||
* {@values Group, Layer, Path, CompoundPath, Shape, Raster,
|
|
||||||
* SymbolItem, PointText, ...}
|
|
||||||
* @option options.match {Function} a match function to be called for each
|
|
||||||
* found hit result: Return `true` to return the result, `false` to keep
|
|
||||||
* searching
|
|
||||||
* @option [options.fill=true] {Boolean} hit-test the fill of items
|
|
||||||
* @option [options.stroke=true] {Boolean} hit-test the stroke of path
|
|
||||||
* items, taking into account the setting of stroke color and width
|
|
||||||
* @option [options.segments=true] {Boolean} hit-test for {@link
|
|
||||||
* Segment#point} of {@link Path} items
|
|
||||||
* @option options.curves {Boolean} hit-test the curves of path items,
|
|
||||||
* without taking the stroke color or width into account
|
|
||||||
* @option options.handles {Boolean} hit-test for the handles ({@link
|
|
||||||
* Segment#handleIn} / {@link Segment#handleOut}) of path segments.
|
|
||||||
* @option options.ends {Boolean} only hit-test for the first or last
|
|
||||||
* segment points of open path items
|
|
||||||
* @option options.position {Boolean} hit-test the {@link Item#position} of
|
|
||||||
* of items, which depends on the setting of {@link Item#pivot}
|
|
||||||
* @option options.center {Boolean} hit-test the {@link Rectangle#center} of
|
|
||||||
* the bounding rectangle of items ({@link Item#bounds})
|
|
||||||
* @option options.bounds {Boolean} hit-test the corners and side-centers of
|
|
||||||
* the bounding rectangle of items ({@link Item#bounds})
|
|
||||||
* @option options.guides {Boolean} hit-test items that have {@link
|
|
||||||
* Item#guide} set to `true`
|
|
||||||
* @option options.selected {Boolean} only hit selected items
|
|
||||||
*
|
|
||||||
* @param point - the point where the hit-test should be performed
|
|
||||||
*
|
|
||||||
* @return a hit result object that contains more information
|
|
||||||
* about what exactly was hit or `null` if nothing was hit
|
|
||||||
*/
|
*/
|
||||||
hitTest(point: Point, options?: object): HitResult
|
importSVG(svg: SVGElement | string, onLoad: Function): Item
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5430,8 +5430,15 @@ declare namespace paper {
|
||||||
*/
|
*/
|
||||||
getAverageColor(object: Path | Rectangle | Point): Color
|
getAverageColor(object: Path | Rectangle | Point): Color
|
||||||
|
|
||||||
|
/**
|
||||||
setImageData(data: ImageData, point: Point): void
|
* Gets the color of a pixel in the raster.
|
||||||
|
*
|
||||||
|
* @param x - the x offset of the pixel in pixel coordinates
|
||||||
|
* @param y - the y offset of the pixel in pixel coordinates
|
||||||
|
*
|
||||||
|
* @return the color of the pixel
|
||||||
|
*/
|
||||||
|
getPixel(x: number, y: number): Color
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the color of a pixel in the raster.
|
* Gets the color of a pixel in the raster.
|
||||||
|
@ -5472,15 +5479,8 @@ declare namespace paper {
|
||||||
|
|
||||||
getImageData(rect: Rectangle): ImageData
|
getImageData(rect: Rectangle): ImageData
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the color of a pixel in the raster.
|
setImageData(data: ImageData, point: Point): void
|
||||||
*
|
|
||||||
* @param x - the x offset of the pixel in pixel coordinates
|
|
||||||
* @param y - the y offset of the pixel in pixel coordinates
|
|
||||||
*
|
|
||||||
* @return the color of the pixel
|
|
||||||
*/
|
|
||||||
getPixel(x: number, y: number): Color
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5673,13 +5673,13 @@ declare namespace paper {
|
||||||
isEmpty(): boolean
|
isEmpty(): boolean
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a new rectangle scaled in horizontal direction by the specified
|
* Tests if the specified point is inside the boundary of the rectangle.
|
||||||
* `hor` amount and in vertical direction by the specified `ver` amount
|
|
||||||
* from its center.
|
|
||||||
*
|
*
|
||||||
* @return the scaled rectangle
|
* @param point - the specified point
|
||||||
|
*
|
||||||
|
* @return true if the point is inside the rectangle's boundary
|
||||||
*/
|
*/
|
||||||
scale(hor: number, ver: number): Rectangle
|
contains(point: Point): boolean
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests if the interior of the rectangle entirely contains the specified
|
* Tests if the interior of the rectangle entirely contains the specified
|
||||||
|
@ -5779,13 +5779,13 @@ declare namespace paper {
|
||||||
scale(amount: number): Rectangle
|
scale(amount: number): Rectangle
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests if the specified point is inside the boundary of the rectangle.
|
* Returns a new rectangle scaled in horizontal direction by the specified
|
||||||
|
* `hor` amount and in vertical direction by the specified `ver` amount
|
||||||
|
* from its center.
|
||||||
*
|
*
|
||||||
* @param point - the specified point
|
* @return the scaled rectangle
|
||||||
*
|
|
||||||
* @return true if the point is inside the rectangle's boundary
|
|
||||||
*/
|
*/
|
||||||
contains(point: Point): boolean
|
scale(hor: number, ver: number): Rectangle
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5955,17 +5955,12 @@ declare namespace paper {
|
||||||
isFirst(): boolean
|
isFirst(): boolean
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interpolates between the two specified segments and sets the point and
|
* Checks if the this is the last segment in the {@link Path#segments}
|
||||||
* handles of this segment accordingly.
|
* array.
|
||||||
*
|
*
|
||||||
* @param from - the segment defining the geometry when `factor` is
|
* @return true if this is the last segment
|
||||||
* `0`
|
|
||||||
* @param to - the segment defining the geometry when `factor` is
|
|
||||||
* `1`
|
|
||||||
* @param factor - the interpolation coefficient, typically between
|
|
||||||
* `0` and `1`, but extrapolation is possible too
|
|
||||||
*/
|
*/
|
||||||
interpolate(from: Segment, to: Segment, factor: number): void
|
isLast(): boolean
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reverses the {@link #handleIn} and {@link #handleOut} vectors of this
|
* Reverses the {@link #handleIn} and {@link #handleOut} vectors of this
|
||||||
|
@ -6005,12 +6000,17 @@ declare namespace paper {
|
||||||
transform(matrix: Matrix): void
|
transform(matrix: Matrix): void
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the this is the last segment in the {@link Path#segments}
|
* Interpolates between the two specified segments and sets the point and
|
||||||
* array.
|
* handles of this segment accordingly.
|
||||||
*
|
*
|
||||||
* @return true if this is the last segment
|
* @param from - the segment defining the geometry when `factor` is
|
||||||
|
* `0`
|
||||||
|
* @param to - the segment defining the geometry when `factor` is
|
||||||
|
* `1`
|
||||||
|
* @param factor - the interpolation coefficient, typically between
|
||||||
|
* `0` and `1`, but extrapolation is possible too
|
||||||
*/
|
*/
|
||||||
isLast(): boolean
|
interpolate(from: Segment, to: Segment, factor: number): void
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6154,6 +6154,12 @@ declare namespace paper {
|
||||||
*/
|
*/
|
||||||
constructor(width: number, height: number)
|
constructor(width: number, height: number)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a Size object using the numbers in the given array as
|
||||||
|
* dimensions.
|
||||||
|
*/
|
||||||
|
constructor(array: any[])
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a Size object using the coordinates of the given Size object.
|
* Creates a Size object using the coordinates of the given Size object.
|
||||||
*/
|
*/
|
||||||
|
@ -6165,12 +6171,6 @@ declare namespace paper {
|
||||||
*/
|
*/
|
||||||
constructor(point: Point)
|
constructor(point: Point)
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a Size object using the numbers in the given array as
|
|
||||||
* dimensions.
|
|
||||||
*/
|
|
||||||
constructor(array: any[])
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a Size object using the properties in the given object.
|
* Creates a Size object using the properties in the given object.
|
||||||
*/
|
*/
|
||||||
|
@ -6253,12 +6253,14 @@ declare namespace paper {
|
||||||
multiply(number: number): Size
|
multiply(number: number): Size
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a size object with random {@link #width} and {@link #height}
|
* Returns the multiplication of the width and height of the supplied size
|
||||||
* values between `0` and `1`.
|
* with the size as a new size. The object itself is not modified!
|
||||||
*
|
*
|
||||||
* @return the newly created size object
|
* @param size - the size to multiply by
|
||||||
|
*
|
||||||
|
* @return the multiplication of the two sizes as a new size
|
||||||
*/
|
*/
|
||||||
static random(): Size
|
multiply(size: Size): Size
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the division of the supplied value by the width and height of the
|
* Returns the division of the supplied value by the width and height of the
|
||||||
|
@ -6356,14 +6358,12 @@ declare namespace paper {
|
||||||
static max(size1: Size, size2: Size): Size
|
static max(size1: Size, size2: Size): Size
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the multiplication of the width and height of the supplied size
|
* Returns a size object with random {@link #width} and {@link #height}
|
||||||
* with the size as a new size. The object itself is not modified!
|
* values between `0` and `1`.
|
||||||
*
|
*
|
||||||
* @param size - the size to multiply by
|
* @return the newly created size object
|
||||||
*
|
|
||||||
* @return the multiplication of the two sizes as a new size
|
|
||||||
*/
|
*/
|
||||||
multiply(size: Size): Size
|
static random(): Size
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7095,22 +7095,20 @@ declare namespace paper {
|
||||||
onMouseLeave: Function | null
|
onMouseLeave: Function | null
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Shears the view by the given values from its center point, or optionally
|
|
||||||
* by a supplied point.
|
|
||||||
*
|
|
||||||
* @see Matrix#shear(hor, ver[, center])
|
|
||||||
*
|
|
||||||
* @param hor - the horizontal shear factor
|
|
||||||
* @param ver - the vertical shear factor
|
|
||||||
*/
|
|
||||||
shear(hor: number, ver: number, center?: Point): void
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes this view from the project and frees the associated element.
|
* Removes this view from the project and frees the associated element.
|
||||||
*/
|
*/
|
||||||
remove(): void
|
remove(): void
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the view if there are changes. Note that when using built-in
|
||||||
|
* event hanlders for interaction, animation and load events, this method is
|
||||||
|
* invoked for you automatically at the end.
|
||||||
|
*
|
||||||
|
* @return true if the view was updated
|
||||||
|
*/
|
||||||
|
update(): boolean
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Requests an update of the view if there are changes through the browser's
|
* Requests an update of the view if there are changes through the browser's
|
||||||
* requestAnimationFrame() mechanism for smooth animation. Note that when
|
* requestAnimationFrame() mechanism for smooth animation. Note that when
|
||||||
|
@ -7192,13 +7190,15 @@ declare namespace paper {
|
||||||
shear(shear: Point, center?: Point): void
|
shear(shear: Point, center?: Point): void
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the view if there are changes. Note that when using built-in
|
* Shears the view by the given values from its center point, or optionally
|
||||||
* event hanlders for interaction, animation and load events, this method is
|
* by a supplied point.
|
||||||
* invoked for you automatically at the end.
|
|
||||||
*
|
*
|
||||||
* @return true if the view was updated
|
* @see Matrix#shear(hor, ver[, center])
|
||||||
|
*
|
||||||
|
* @param hor - the horizontal shear factor
|
||||||
|
* @param ver - the vertical shear factor
|
||||||
*/
|
*/
|
||||||
update(): boolean
|
shear(hor: number, ver: number, center?: Point): void
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Skews the view by the given angles from its center point, or optionally
|
* Skews the view by the given angles from its center point, or optionally
|
||||||
|
|
9716
package-lock.json
generated
9716
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -64,9 +64,9 @@
|
||||||
"gulp-prepro": "2.4.0",
|
"gulp-prepro": "2.4.0",
|
||||||
"gulp-qunits": "2.1.2",
|
"gulp-qunits": "2.1.2",
|
||||||
"gulp-rename": "1.4.0",
|
"gulp-rename": "1.4.0",
|
||||||
"gulp-typescript": "5.0.1",
|
|
||||||
"gulp-shell": "0.8.0",
|
"gulp-shell": "0.8.0",
|
||||||
"gulp-symlink": "2.1.4",
|
"gulp-symlink": "2.1.4",
|
||||||
|
"gulp-typescript": "5.0.1",
|
||||||
"gulp-uglify": "1.5.4",
|
"gulp-uglify": "1.5.4",
|
||||||
"gulp-uncomment": "0.3.0",
|
"gulp-uncomment": "0.3.0",
|
||||||
"gulp-util": "3.0.8",
|
"gulp-util": "3.0.8",
|
||||||
|
|
Loading…
Reference in a new issue