This commit is contained in:
2025-01-04 00:34:03 +01:00
parent 41829408dc
commit 0ca14bbc19
18111 changed files with 1871397 additions and 0 deletions

21
resources/app/node_modules/@pixi/math/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License
Copyright (c) 2013-2023 Mathew Groves, Chad Engler
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

2
resources/app/node_modules/@pixi/math/lib/IPoint.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
"use strict";
//# sourceMappingURL=IPoint.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"IPoint.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}

2
resources/app/node_modules/@pixi/math/lib/IPoint.mjs generated vendored Normal file
View File

@@ -0,0 +1,2 @@
//# sourceMappingURL=IPoint.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"IPoint.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}

View File

@@ -0,0 +1,2 @@
"use strict";
//# sourceMappingURL=IPointData.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"IPointData.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}

View File

@@ -0,0 +1,2 @@
//# sourceMappingURL=IPointData.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"IPointData.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}

209
resources/app/node_modules/@pixi/math/lib/Matrix.js generated vendored Normal file
View File

@@ -0,0 +1,209 @@
"use strict";
var _const = require("./const.js"), Point = require("./Point.js");
class Matrix {
/**
* @param a - x scale
* @param b - y skew
* @param c - x skew
* @param d - y scale
* @param tx - x translation
* @param ty - y translation
*/
constructor(a = 1, b = 0, c = 0, d = 1, tx = 0, ty = 0) {
this.array = null, this.a = a, this.b = b, this.c = c, this.d = d, this.tx = tx, this.ty = ty;
}
/**
* Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows:
*
* a = array[0]
* b = array[1]
* c = array[3]
* d = array[4]
* tx = array[2]
* ty = array[5]
* @param array - The array that the matrix will be populated from.
*/
fromArray(array) {
this.a = array[0], this.b = array[1], this.c = array[3], this.d = array[4], this.tx = array[2], this.ty = array[5];
}
/**
* Sets the matrix properties.
* @param a - Matrix component
* @param b - Matrix component
* @param c - Matrix component
* @param d - Matrix component
* @param tx - Matrix component
* @param ty - Matrix component
* @returns This matrix. Good for chaining method calls.
*/
set(a, b, c, d, tx, ty) {
return this.a = a, this.b = b, this.c = c, this.d = d, this.tx = tx, this.ty = ty, this;
}
/**
* Creates an array from the current Matrix object.
* @param transpose - Whether we need to transpose the matrix or not
* @param [out=new Float32Array(9)] - If provided the array will be assigned to out
* @returns The newly created array which contains the matrix
*/
toArray(transpose, out) {
this.array || (this.array = new Float32Array(9));
const array = out || this.array;
return transpose ? (array[0] = this.a, array[1] = this.b, array[2] = 0, array[3] = this.c, array[4] = this.d, array[5] = 0, array[6] = this.tx, array[7] = this.ty, array[8] = 1) : (array[0] = this.a, array[1] = this.c, array[2] = this.tx, array[3] = this.b, array[4] = this.d, array[5] = this.ty, array[6] = 0, array[7] = 0, array[8] = 1), array;
}
/**
* Get a new position with the current transformation applied.
* Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering)
* @param pos - The origin
* @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)
* @returns {PIXI.Point} The new point, transformed through this matrix
*/
apply(pos, newPos) {
newPos = newPos || new Point.Point();
const x = pos.x, y = pos.y;
return newPos.x = this.a * x + this.c * y + this.tx, newPos.y = this.b * x + this.d * y + this.ty, newPos;
}
/**
* Get a new position with the inverse of the current transformation applied.
* Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input)
* @param pos - The origin
* @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)
* @returns {PIXI.Point} The new point, inverse-transformed through this matrix
*/
applyInverse(pos, newPos) {
newPos = newPos || new Point.Point();
const id = 1 / (this.a * this.d + this.c * -this.b), x = pos.x, y = pos.y;
return newPos.x = this.d * id * x + -this.c * id * y + (this.ty * this.c - this.tx * this.d) * id, newPos.y = this.a * id * y + -this.b * id * x + (-this.ty * this.a + this.tx * this.b) * id, newPos;
}
/**
* Translates the matrix on the x and y.
* @param x - How much to translate x by
* @param y - How much to translate y by
* @returns This matrix. Good for chaining method calls.
*/
translate(x, y) {
return this.tx += x, this.ty += y, this;
}
/**
* Applies a scale transformation to the matrix.
* @param x - The amount to scale horizontally
* @param y - The amount to scale vertically
* @returns This matrix. Good for chaining method calls.
*/
scale(x, y) {
return this.a *= x, this.d *= y, this.c *= x, this.b *= y, this.tx *= x, this.ty *= y, this;
}
/**
* Applies a rotation transformation to the matrix.
* @param angle - The angle in radians.
* @returns This matrix. Good for chaining method calls.
*/
rotate(angle) {
const cos = Math.cos(angle), sin = Math.sin(angle), a1 = this.a, c1 = this.c, tx1 = this.tx;
return this.a = a1 * cos - this.b * sin, this.b = a1 * sin + this.b * cos, this.c = c1 * cos - this.d * sin, this.d = c1 * sin + this.d * cos, this.tx = tx1 * cos - this.ty * sin, this.ty = tx1 * sin + this.ty * cos, this;
}
/**
* Appends the given Matrix to this Matrix.
* @param matrix - The matrix to append.
* @returns This matrix. Good for chaining method calls.
*/
append(matrix) {
const a1 = this.a, b1 = this.b, c1 = this.c, d1 = this.d;
return this.a = matrix.a * a1 + matrix.b * c1, this.b = matrix.a * b1 + matrix.b * d1, this.c = matrix.c * a1 + matrix.d * c1, this.d = matrix.c * b1 + matrix.d * d1, this.tx = matrix.tx * a1 + matrix.ty * c1 + this.tx, this.ty = matrix.tx * b1 + matrix.ty * d1 + this.ty, this;
}
/**
* Sets the matrix based on all the available properties
* @param x - Position on the x axis
* @param y - Position on the y axis
* @param pivotX - Pivot on the x axis
* @param pivotY - Pivot on the y axis
* @param scaleX - Scale on the x axis
* @param scaleY - Scale on the y axis
* @param rotation - Rotation in radians
* @param skewX - Skew on the x axis
* @param skewY - Skew on the y axis
* @returns This matrix. Good for chaining method calls.
*/
setTransform(x, y, pivotX, pivotY, scaleX, scaleY, rotation, skewX, skewY) {
return this.a = Math.cos(rotation + skewY) * scaleX, this.b = Math.sin(rotation + skewY) * scaleX, this.c = -Math.sin(rotation - skewX) * scaleY, this.d = Math.cos(rotation - skewX) * scaleY, this.tx = x - (pivotX * this.a + pivotY * this.c), this.ty = y - (pivotX * this.b + pivotY * this.d), this;
}
/**
* Prepends the given Matrix to this Matrix.
* @param matrix - The matrix to prepend
* @returns This matrix. Good for chaining method calls.
*/
prepend(matrix) {
const tx1 = this.tx;
if (matrix.a !== 1 || matrix.b !== 0 || matrix.c !== 0 || matrix.d !== 1) {
const a1 = this.a, c1 = this.c;
this.a = a1 * matrix.a + this.b * matrix.c, this.b = a1 * matrix.b + this.b * matrix.d, this.c = c1 * matrix.a + this.d * matrix.c, this.d = c1 * matrix.b + this.d * matrix.d;
}
return this.tx = tx1 * matrix.a + this.ty * matrix.c + matrix.tx, this.ty = tx1 * matrix.b + this.ty * matrix.d + matrix.ty, this;
}
/**
* Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform.
* @param transform - The transform to apply the properties to.
* @returns The transform with the newly applied properties
*/
decompose(transform) {
const a = this.a, b = this.b, c = this.c, d = this.d, pivot = transform.pivot, skewX = -Math.atan2(-c, d), skewY = Math.atan2(b, a), delta = Math.abs(skewX + skewY);
return delta < 1e-5 || Math.abs(_const.PI_2 - delta) < 1e-5 ? (transform.rotation = skewY, transform.skew.x = transform.skew.y = 0) : (transform.rotation = 0, transform.skew.x = skewX, transform.skew.y = skewY), transform.scale.x = Math.sqrt(a * a + b * b), transform.scale.y = Math.sqrt(c * c + d * d), transform.position.x = this.tx + (pivot.x * a + pivot.y * c), transform.position.y = this.ty + (pivot.x * b + pivot.y * d), transform;
}
/**
* Inverts this matrix
* @returns This matrix. Good for chaining method calls.
*/
invert() {
const a1 = this.a, b1 = this.b, c1 = this.c, d1 = this.d, tx1 = this.tx, n = a1 * d1 - b1 * c1;
return this.a = d1 / n, this.b = -b1 / n, this.c = -c1 / n, this.d = a1 / n, this.tx = (c1 * this.ty - d1 * tx1) / n, this.ty = -(a1 * this.ty - b1 * tx1) / n, this;
}
/**
* Resets this Matrix to an identity (default) matrix.
* @returns This matrix. Good for chaining method calls.
*/
identity() {
return this.a = 1, this.b = 0, this.c = 0, this.d = 1, this.tx = 0, this.ty = 0, this;
}
/**
* Creates a new Matrix object with the same values as this one.
* @returns A copy of this matrix. Good for chaining method calls.
*/
clone() {
const matrix = new Matrix();
return matrix.a = this.a, matrix.b = this.b, matrix.c = this.c, matrix.d = this.d, matrix.tx = this.tx, matrix.ty = this.ty, matrix;
}
/**
* Changes the values of the given matrix to be the same as the ones in this matrix
* @param matrix - The matrix to copy to.
* @returns The matrix given in parameter with its values updated.
*/
copyTo(matrix) {
return matrix.a = this.a, matrix.b = this.b, matrix.c = this.c, matrix.d = this.d, matrix.tx = this.tx, matrix.ty = this.ty, matrix;
}
/**
* Changes the values of the matrix to be the same as the ones in given matrix
* @param {PIXI.Matrix} matrix - The matrix to copy from.
* @returns {PIXI.Matrix} this
*/
copyFrom(matrix) {
return this.a = matrix.a, this.b = matrix.b, this.c = matrix.c, this.d = matrix.d, this.tx = matrix.tx, this.ty = matrix.ty, this;
}
/**
* A default (identity) matrix
* @readonly
*/
static get IDENTITY() {
return new Matrix();
}
/**
* A temp matrix
* @readonly
*/
static get TEMP_MATRIX() {
return new Matrix();
}
}
Matrix.prototype.toString = function() {
return `[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`;
};
exports.Matrix = Matrix;
//# sourceMappingURL=Matrix.js.map

File diff suppressed because one or more lines are too long

211
resources/app/node_modules/@pixi/math/lib/Matrix.mjs generated vendored Normal file
View File

@@ -0,0 +1,211 @@
import { PI_2 } from "./const.mjs";
import { Point } from "./Point.mjs";
class Matrix {
/**
* @param a - x scale
* @param b - y skew
* @param c - x skew
* @param d - y scale
* @param tx - x translation
* @param ty - y translation
*/
constructor(a = 1, b = 0, c = 0, d = 1, tx = 0, ty = 0) {
this.array = null, this.a = a, this.b = b, this.c = c, this.d = d, this.tx = tx, this.ty = ty;
}
/**
* Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows:
*
* a = array[0]
* b = array[1]
* c = array[3]
* d = array[4]
* tx = array[2]
* ty = array[5]
* @param array - The array that the matrix will be populated from.
*/
fromArray(array) {
this.a = array[0], this.b = array[1], this.c = array[3], this.d = array[4], this.tx = array[2], this.ty = array[5];
}
/**
* Sets the matrix properties.
* @param a - Matrix component
* @param b - Matrix component
* @param c - Matrix component
* @param d - Matrix component
* @param tx - Matrix component
* @param ty - Matrix component
* @returns This matrix. Good for chaining method calls.
*/
set(a, b, c, d, tx, ty) {
return this.a = a, this.b = b, this.c = c, this.d = d, this.tx = tx, this.ty = ty, this;
}
/**
* Creates an array from the current Matrix object.
* @param transpose - Whether we need to transpose the matrix or not
* @param [out=new Float32Array(9)] - If provided the array will be assigned to out
* @returns The newly created array which contains the matrix
*/
toArray(transpose, out) {
this.array || (this.array = new Float32Array(9));
const array = out || this.array;
return transpose ? (array[0] = this.a, array[1] = this.b, array[2] = 0, array[3] = this.c, array[4] = this.d, array[5] = 0, array[6] = this.tx, array[7] = this.ty, array[8] = 1) : (array[0] = this.a, array[1] = this.c, array[2] = this.tx, array[3] = this.b, array[4] = this.d, array[5] = this.ty, array[6] = 0, array[7] = 0, array[8] = 1), array;
}
/**
* Get a new position with the current transformation applied.
* Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering)
* @param pos - The origin
* @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)
* @returns {PIXI.Point} The new point, transformed through this matrix
*/
apply(pos, newPos) {
newPos = newPos || new Point();
const x = pos.x, y = pos.y;
return newPos.x = this.a * x + this.c * y + this.tx, newPos.y = this.b * x + this.d * y + this.ty, newPos;
}
/**
* Get a new position with the inverse of the current transformation applied.
* Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input)
* @param pos - The origin
* @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)
* @returns {PIXI.Point} The new point, inverse-transformed through this matrix
*/
applyInverse(pos, newPos) {
newPos = newPos || new Point();
const id = 1 / (this.a * this.d + this.c * -this.b), x = pos.x, y = pos.y;
return newPos.x = this.d * id * x + -this.c * id * y + (this.ty * this.c - this.tx * this.d) * id, newPos.y = this.a * id * y + -this.b * id * x + (-this.ty * this.a + this.tx * this.b) * id, newPos;
}
/**
* Translates the matrix on the x and y.
* @param x - How much to translate x by
* @param y - How much to translate y by
* @returns This matrix. Good for chaining method calls.
*/
translate(x, y) {
return this.tx += x, this.ty += y, this;
}
/**
* Applies a scale transformation to the matrix.
* @param x - The amount to scale horizontally
* @param y - The amount to scale vertically
* @returns This matrix. Good for chaining method calls.
*/
scale(x, y) {
return this.a *= x, this.d *= y, this.c *= x, this.b *= y, this.tx *= x, this.ty *= y, this;
}
/**
* Applies a rotation transformation to the matrix.
* @param angle - The angle in radians.
* @returns This matrix. Good for chaining method calls.
*/
rotate(angle) {
const cos = Math.cos(angle), sin = Math.sin(angle), a1 = this.a, c1 = this.c, tx1 = this.tx;
return this.a = a1 * cos - this.b * sin, this.b = a1 * sin + this.b * cos, this.c = c1 * cos - this.d * sin, this.d = c1 * sin + this.d * cos, this.tx = tx1 * cos - this.ty * sin, this.ty = tx1 * sin + this.ty * cos, this;
}
/**
* Appends the given Matrix to this Matrix.
* @param matrix - The matrix to append.
* @returns This matrix. Good for chaining method calls.
*/
append(matrix) {
const a1 = this.a, b1 = this.b, c1 = this.c, d1 = this.d;
return this.a = matrix.a * a1 + matrix.b * c1, this.b = matrix.a * b1 + matrix.b * d1, this.c = matrix.c * a1 + matrix.d * c1, this.d = matrix.c * b1 + matrix.d * d1, this.tx = matrix.tx * a1 + matrix.ty * c1 + this.tx, this.ty = matrix.tx * b1 + matrix.ty * d1 + this.ty, this;
}
/**
* Sets the matrix based on all the available properties
* @param x - Position on the x axis
* @param y - Position on the y axis
* @param pivotX - Pivot on the x axis
* @param pivotY - Pivot on the y axis
* @param scaleX - Scale on the x axis
* @param scaleY - Scale on the y axis
* @param rotation - Rotation in radians
* @param skewX - Skew on the x axis
* @param skewY - Skew on the y axis
* @returns This matrix. Good for chaining method calls.
*/
setTransform(x, y, pivotX, pivotY, scaleX, scaleY, rotation, skewX, skewY) {
return this.a = Math.cos(rotation + skewY) * scaleX, this.b = Math.sin(rotation + skewY) * scaleX, this.c = -Math.sin(rotation - skewX) * scaleY, this.d = Math.cos(rotation - skewX) * scaleY, this.tx = x - (pivotX * this.a + pivotY * this.c), this.ty = y - (pivotX * this.b + pivotY * this.d), this;
}
/**
* Prepends the given Matrix to this Matrix.
* @param matrix - The matrix to prepend
* @returns This matrix. Good for chaining method calls.
*/
prepend(matrix) {
const tx1 = this.tx;
if (matrix.a !== 1 || matrix.b !== 0 || matrix.c !== 0 || matrix.d !== 1) {
const a1 = this.a, c1 = this.c;
this.a = a1 * matrix.a + this.b * matrix.c, this.b = a1 * matrix.b + this.b * matrix.d, this.c = c1 * matrix.a + this.d * matrix.c, this.d = c1 * matrix.b + this.d * matrix.d;
}
return this.tx = tx1 * matrix.a + this.ty * matrix.c + matrix.tx, this.ty = tx1 * matrix.b + this.ty * matrix.d + matrix.ty, this;
}
/**
* Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform.
* @param transform - The transform to apply the properties to.
* @returns The transform with the newly applied properties
*/
decompose(transform) {
const a = this.a, b = this.b, c = this.c, d = this.d, pivot = transform.pivot, skewX = -Math.atan2(-c, d), skewY = Math.atan2(b, a), delta = Math.abs(skewX + skewY);
return delta < 1e-5 || Math.abs(PI_2 - delta) < 1e-5 ? (transform.rotation = skewY, transform.skew.x = transform.skew.y = 0) : (transform.rotation = 0, transform.skew.x = skewX, transform.skew.y = skewY), transform.scale.x = Math.sqrt(a * a + b * b), transform.scale.y = Math.sqrt(c * c + d * d), transform.position.x = this.tx + (pivot.x * a + pivot.y * c), transform.position.y = this.ty + (pivot.x * b + pivot.y * d), transform;
}
/**
* Inverts this matrix
* @returns This matrix. Good for chaining method calls.
*/
invert() {
const a1 = this.a, b1 = this.b, c1 = this.c, d1 = this.d, tx1 = this.tx, n = a1 * d1 - b1 * c1;
return this.a = d1 / n, this.b = -b1 / n, this.c = -c1 / n, this.d = a1 / n, this.tx = (c1 * this.ty - d1 * tx1) / n, this.ty = -(a1 * this.ty - b1 * tx1) / n, this;
}
/**
* Resets this Matrix to an identity (default) matrix.
* @returns This matrix. Good for chaining method calls.
*/
identity() {
return this.a = 1, this.b = 0, this.c = 0, this.d = 1, this.tx = 0, this.ty = 0, this;
}
/**
* Creates a new Matrix object with the same values as this one.
* @returns A copy of this matrix. Good for chaining method calls.
*/
clone() {
const matrix = new Matrix();
return matrix.a = this.a, matrix.b = this.b, matrix.c = this.c, matrix.d = this.d, matrix.tx = this.tx, matrix.ty = this.ty, matrix;
}
/**
* Changes the values of the given matrix to be the same as the ones in this matrix
* @param matrix - The matrix to copy to.
* @returns The matrix given in parameter with its values updated.
*/
copyTo(matrix) {
return matrix.a = this.a, matrix.b = this.b, matrix.c = this.c, matrix.d = this.d, matrix.tx = this.tx, matrix.ty = this.ty, matrix;
}
/**
* Changes the values of the matrix to be the same as the ones in given matrix
* @param {PIXI.Matrix} matrix - The matrix to copy from.
* @returns {PIXI.Matrix} this
*/
copyFrom(matrix) {
return this.a = matrix.a, this.b = matrix.b, this.c = matrix.c, this.d = matrix.d, this.tx = matrix.tx, this.ty = matrix.ty, this;
}
/**
* A default (identity) matrix
* @readonly
*/
static get IDENTITY() {
return new Matrix();
}
/**
* A temp matrix
* @readonly
*/
static get TEMP_MATRIX() {
return new Matrix();
}
}
Matrix.prototype.toString = function() {
return `[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`;
};
export {
Matrix
};
//# sourceMappingURL=Matrix.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,78 @@
"use strict";
class ObservablePoint {
/**
* Creates a new `ObservablePoint`
* @param cb - callback function triggered when `x` and/or `y` are changed
* @param scope - owner of callback
* @param {number} [x=0] - position of the point on the x axis
* @param {number} [y=0] - position of the point on the y axis
*/
constructor(cb, scope, x = 0, y = 0) {
this._x = x, this._y = y, this.cb = cb, this.scope = scope;
}
/**
* Creates a clone of this point.
* The callback and scope params can be overridden otherwise they will default
* to the clone object's values.
* @override
* @param cb - The callback function triggered when `x` and/or `y` are changed
* @param scope - The owner of the callback
* @returns a copy of this observable point
*/
clone(cb = this.cb, scope = this.scope) {
return new ObservablePoint(cb, scope, this._x, this._y);
}
/**
* Sets the point to a new `x` and `y` position.
* If `y` is omitted, both `x` and `y` will be set to `x`.
* @param {number} [x=0] - position of the point on the x axis
* @param {number} [y=x] - position of the point on the y axis
* @returns The observable point instance itself
*/
set(x = 0, y = x) {
return (this._x !== x || this._y !== y) && (this._x = x, this._y = y, this.cb.call(this.scope)), this;
}
/**
* Copies x and y from the given point (`p`)
* @param p - The point to copy from. Can be any of type that is or extends `IPointData`
* @returns The observable point instance itself
*/
copyFrom(p) {
return (this._x !== p.x || this._y !== p.y) && (this._x = p.x, this._y = p.y, this.cb.call(this.scope)), this;
}
/**
* Copies this point's x and y into that of the given point (`p`)
* @param p - The point to copy to. Can be any of type that is or extends `IPointData`
* @returns The point (`p`) with values updated
*/
copyTo(p) {
return p.set(this._x, this._y), p;
}
/**
* Accepts another point (`p`) and returns `true` if the given point is equal to this point
* @param p - The point to check
* @returns Returns `true` if both `x` and `y` are equal
*/
equals(p) {
return p.x === this._x && p.y === this._y;
}
/** Position of the observable point on the x axis. */
get x() {
return this._x;
}
set x(value) {
this._x !== value && (this._x = value, this.cb.call(this.scope));
}
/** Position of the observable point on the y axis. */
get y() {
return this._y;
}
set y(value) {
this._y !== value && (this._y = value, this.cb.call(this.scope));
}
}
ObservablePoint.prototype.toString = function() {
return `[@pixi/math:ObservablePoint x=${this.x} y=${this.y} scope=${this.scope}]`;
};
exports.ObservablePoint = ObservablePoint;
//# sourceMappingURL=ObservablePoint.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,79 @@
class ObservablePoint {
/**
* Creates a new `ObservablePoint`
* @param cb - callback function triggered when `x` and/or `y` are changed
* @param scope - owner of callback
* @param {number} [x=0] - position of the point on the x axis
* @param {number} [y=0] - position of the point on the y axis
*/
constructor(cb, scope, x = 0, y = 0) {
this._x = x, this._y = y, this.cb = cb, this.scope = scope;
}
/**
* Creates a clone of this point.
* The callback and scope params can be overridden otherwise they will default
* to the clone object's values.
* @override
* @param cb - The callback function triggered when `x` and/or `y` are changed
* @param scope - The owner of the callback
* @returns a copy of this observable point
*/
clone(cb = this.cb, scope = this.scope) {
return new ObservablePoint(cb, scope, this._x, this._y);
}
/**
* Sets the point to a new `x` and `y` position.
* If `y` is omitted, both `x` and `y` will be set to `x`.
* @param {number} [x=0] - position of the point on the x axis
* @param {number} [y=x] - position of the point on the y axis
* @returns The observable point instance itself
*/
set(x = 0, y = x) {
return (this._x !== x || this._y !== y) && (this._x = x, this._y = y, this.cb.call(this.scope)), this;
}
/**
* Copies x and y from the given point (`p`)
* @param p - The point to copy from. Can be any of type that is or extends `IPointData`
* @returns The observable point instance itself
*/
copyFrom(p) {
return (this._x !== p.x || this._y !== p.y) && (this._x = p.x, this._y = p.y, this.cb.call(this.scope)), this;
}
/**
* Copies this point's x and y into that of the given point (`p`)
* @param p - The point to copy to. Can be any of type that is or extends `IPointData`
* @returns The point (`p`) with values updated
*/
copyTo(p) {
return p.set(this._x, this._y), p;
}
/**
* Accepts another point (`p`) and returns `true` if the given point is equal to this point
* @param p - The point to check
* @returns Returns `true` if both `x` and `y` are equal
*/
equals(p) {
return p.x === this._x && p.y === this._y;
}
/** Position of the observable point on the x axis. */
get x() {
return this._x;
}
set x(value) {
this._x !== value && (this._x = value, this.cb.call(this.scope));
}
/** Position of the observable point on the y axis. */
get y() {
return this._y;
}
set y(value) {
this._y !== value && (this._y = value, this.cb.call(this.scope));
}
}
ObservablePoint.prototype.toString = function() {
return `[@pixi/math:ObservablePoint x=${this.x} y=${this.y} scope=${this.scope}]`;
};
export {
ObservablePoint
};
//# sourceMappingURL=ObservablePoint.mjs.map

File diff suppressed because one or more lines are too long

57
resources/app/node_modules/@pixi/math/lib/Point.js generated vendored Normal file
View File

@@ -0,0 +1,57 @@
"use strict";
class Point {
/**
* Creates a new `Point`
* @param {number} [x=0] - position of the point on the x axis
* @param {number} [y=0] - position of the point on the y axis
*/
constructor(x = 0, y = 0) {
this.x = 0, this.y = 0, this.x = x, this.y = y;
}
/**
* Creates a clone of this point
* @returns A clone of this point
*/
clone() {
return new Point(this.x, this.y);
}
/**
* Copies `x` and `y` from the given point into this point
* @param p - The point to copy from
* @returns The point instance itself
*/
copyFrom(p) {
return this.set(p.x, p.y), this;
}
/**
* Copies this point's x and y into the given point (`p`).
* @param p - The point to copy to. Can be any of type that is or extends `IPointData`
* @returns The point (`p`) with values updated
*/
copyTo(p) {
return p.set(this.x, this.y), p;
}
/**
* Accepts another point (`p`) and returns `true` if the given point is equal to this point
* @param p - The point to check
* @returns Returns `true` if both `x` and `y` are equal
*/
equals(p) {
return p.x === this.x && p.y === this.y;
}
/**
* Sets the point to a new `x` and `y` position.
* If `y` is omitted, both `x` and `y` will be set to `x`.
* @param {number} [x=0] - position of the point on the `x` axis
* @param {number} [y=x] - position of the point on the `y` axis
* @returns The point instance itself
*/
set(x = 0, y = x) {
return this.x = x, this.y = y, this;
}
}
Point.prototype.toString = function() {
return `[@pixi/math:Point x=${this.x} y=${this.y}]`;
};
exports.Point = Point;
//# sourceMappingURL=Point.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Point.js","sources":["../src/Point.ts"],"sourcesContent":["import type { IPoint } from './IPoint';\nimport type { IPointData } from './IPointData';\n\nexport interface Point extends GlobalMixins.Point, IPoint {}\n\n/**\n * The Point object represents a location in a two-dimensional coordinate system, where `x` represents\n * the position on the horizontal axis and `y` represents the position on the vertical axis\n * @class\n * @memberof PIXI\n * @implements {IPoint}\n */\nexport class Point implements IPoint\n{\n /** Position of the point on the x axis */\n public x = 0;\n /** Position of the point on the y axis */\n public y = 0;\n\n /**\n * Creates a new `Point`\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=0] - position of the point on the y axis\n */\n constructor(x = 0, y = 0)\n {\n this.x = x;\n this.y = y;\n }\n\n /**\n * Creates a clone of this point\n * @returns A clone of this point\n */\n clone(): Point\n {\n return new Point(this.x, this.y);\n }\n\n /**\n * Copies `x` and `y` from the given point into this point\n * @param p - The point to copy from\n * @returns The point instance itself\n */\n copyFrom(p: IPointData): this\n {\n this.set(p.x, p.y);\n\n return this;\n }\n\n /**\n * Copies this point's x and y into the given point (`p`).\n * @param p - The point to copy to. Can be any of type that is or extends `IPointData`\n * @returns The point (`p`) with values updated\n */\n copyTo<T extends IPoint>(p: T): T\n {\n p.set(this.x, this.y);\n\n return p;\n }\n\n /**\n * Accepts another point (`p`) and returns `true` if the given point is equal to this point\n * @param p - The point to check\n * @returns Returns `true` if both `x` and `y` are equal\n */\n equals(p: IPointData): boolean\n {\n return (p.x === this.x) && (p.y === this.y);\n }\n\n /**\n * Sets the point to a new `x` and `y` position.\n * If `y` is omitted, both `x` and `y` will be set to `x`.\n * @param {number} [x=0] - position of the point on the `x` axis\n * @param {number} [y=x] - position of the point on the `y` axis\n * @returns The point instance itself\n */\n set(x = 0, y = x): this\n {\n this.x = x;\n this.y = y;\n\n return this;\n }\n}\n\nif (process.env.DEBUG)\n{\n Point.prototype.toString = function toString(): string\n {\n return `[@pixi/math:Point x=${this.x} y=${this.y}]`;\n };\n}\n"],"names":[],"mappings":";AAYO,MAAM,MACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWI,YAAY,IAAI,GAAG,IAAI,GACvB;AAVA,SAAO,IAAI,GAEX,KAAO,IAAI,GASF,KAAA,IAAI,GACT,KAAK,IAAI;AAAA,EACb;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,QACA;AACI,WAAO,IAAI,MAAM,KAAK,GAAG,KAAK,CAAC;AAAA,EACnC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,SAAS,GACT;AACI,WAAA,KAAK,IAAI,EAAE,GAAG,EAAE,CAAC,GAEV;AAAA,EACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,OAAyB,GACzB;AACI,WAAA,EAAE,IAAI,KAAK,GAAG,KAAK,CAAC,GAEb;AAAA,EACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,OAAO,GACP;AACI,WAAQ,EAAE,MAAM,KAAK,KAAO,EAAE,MAAM,KAAK;AAAA,EAC7C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,IAAI,IAAI,GAAG,IAAI,GACf;AACI,WAAA,KAAK,IAAI,GACT,KAAK,IAAI,GAEF;AAAA,EACX;AACJ;AAII,MAAM,UAAU,WAAW,WAC3B;AACI,SAAO,uBAAuB,KAAK,CAAC,MAAM,KAAK,CAAC;AACpD;;"}

58
resources/app/node_modules/@pixi/math/lib/Point.mjs generated vendored Normal file
View File

@@ -0,0 +1,58 @@
class Point {
/**
* Creates a new `Point`
* @param {number} [x=0] - position of the point on the x axis
* @param {number} [y=0] - position of the point on the y axis
*/
constructor(x = 0, y = 0) {
this.x = 0, this.y = 0, this.x = x, this.y = y;
}
/**
* Creates a clone of this point
* @returns A clone of this point
*/
clone() {
return new Point(this.x, this.y);
}
/**
* Copies `x` and `y` from the given point into this point
* @param p - The point to copy from
* @returns The point instance itself
*/
copyFrom(p) {
return this.set(p.x, p.y), this;
}
/**
* Copies this point's x and y into the given point (`p`).
* @param p - The point to copy to. Can be any of type that is or extends `IPointData`
* @returns The point (`p`) with values updated
*/
copyTo(p) {
return p.set(this.x, this.y), p;
}
/**
* Accepts another point (`p`) and returns `true` if the given point is equal to this point
* @param p - The point to check
* @returns Returns `true` if both `x` and `y` are equal
*/
equals(p) {
return p.x === this.x && p.y === this.y;
}
/**
* Sets the point to a new `x` and `y` position.
* If `y` is omitted, both `x` and `y` will be set to `x`.
* @param {number} [x=0] - position of the point on the `x` axis
* @param {number} [y=x] - position of the point on the `y` axis
* @returns The point instance itself
*/
set(x = 0, y = x) {
return this.x = x, this.y = y, this;
}
}
Point.prototype.toString = function() {
return `[@pixi/math:Point x=${this.x} y=${this.y}]`;
};
export {
Point
};
//# sourceMappingURL=Point.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Point.mjs","sources":["../src/Point.ts"],"sourcesContent":["import type { IPoint } from './IPoint';\nimport type { IPointData } from './IPointData';\n\nexport interface Point extends GlobalMixins.Point, IPoint {}\n\n/**\n * The Point object represents a location in a two-dimensional coordinate system, where `x` represents\n * the position on the horizontal axis and `y` represents the position on the vertical axis\n * @class\n * @memberof PIXI\n * @implements {IPoint}\n */\nexport class Point implements IPoint\n{\n /** Position of the point on the x axis */\n public x = 0;\n /** Position of the point on the y axis */\n public y = 0;\n\n /**\n * Creates a new `Point`\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=0] - position of the point on the y axis\n */\n constructor(x = 0, y = 0)\n {\n this.x = x;\n this.y = y;\n }\n\n /**\n * Creates a clone of this point\n * @returns A clone of this point\n */\n clone(): Point\n {\n return new Point(this.x, this.y);\n }\n\n /**\n * Copies `x` and `y` from the given point into this point\n * @param p - The point to copy from\n * @returns The point instance itself\n */\n copyFrom(p: IPointData): this\n {\n this.set(p.x, p.y);\n\n return this;\n }\n\n /**\n * Copies this point's x and y into the given point (`p`).\n * @param p - The point to copy to. Can be any of type that is or extends `IPointData`\n * @returns The point (`p`) with values updated\n */\n copyTo<T extends IPoint>(p: T): T\n {\n p.set(this.x, this.y);\n\n return p;\n }\n\n /**\n * Accepts another point (`p`) and returns `true` if the given point is equal to this point\n * @param p - The point to check\n * @returns Returns `true` if both `x` and `y` are equal\n */\n equals(p: IPointData): boolean\n {\n return (p.x === this.x) && (p.y === this.y);\n }\n\n /**\n * Sets the point to a new `x` and `y` position.\n * If `y` is omitted, both `x` and `y` will be set to `x`.\n * @param {number} [x=0] - position of the point on the `x` axis\n * @param {number} [y=x] - position of the point on the `y` axis\n * @returns The point instance itself\n */\n set(x = 0, y = x): this\n {\n this.x = x;\n this.y = y;\n\n return this;\n }\n}\n\nif (process.env.DEBUG)\n{\n Point.prototype.toString = function toString(): string\n {\n return `[@pixi/math:Point x=${this.x} y=${this.y}]`;\n };\n}\n"],"names":[],"mappings":"AAYO,MAAM,MACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWI,YAAY,IAAI,GAAG,IAAI,GACvB;AAVA,SAAO,IAAI,GAEX,KAAO,IAAI,GASF,KAAA,IAAI,GACT,KAAK,IAAI;AAAA,EACb;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,QACA;AACI,WAAO,IAAI,MAAM,KAAK,GAAG,KAAK,CAAC;AAAA,EACnC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,SAAS,GACT;AACI,WAAA,KAAK,IAAI,EAAE,GAAG,EAAE,CAAC,GAEV;AAAA,EACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,OAAyB,GACzB;AACI,WAAA,EAAE,IAAI,KAAK,GAAG,KAAK,CAAC,GAEb;AAAA,EACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,OAAO,GACP;AACI,WAAQ,EAAE,MAAM,KAAK,KAAO,EAAE,MAAM,KAAK;AAAA,EAC7C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,IAAI,IAAI,GAAG,IAAI,GACf;AACI,WAAA,KAAK,IAAI,GACT,KAAK,IAAI,GAEF;AAAA,EACX;AACJ;AAII,MAAM,UAAU,WAAW,WAC3B;AACI,SAAO,uBAAuB,KAAK,CAAC,MAAM,KAAK,CAAC;AACpD;"}

52
resources/app/node_modules/@pixi/math/lib/Transform.js generated vendored Normal file
View File

@@ -0,0 +1,52 @@
"use strict";
var Matrix = require("./Matrix.js"), ObservablePoint = require("./ObservablePoint.js");
const _Transform = class {
constructor() {
this.worldTransform = new Matrix.Matrix(), this.localTransform = new Matrix.Matrix(), this.position = new ObservablePoint.ObservablePoint(this.onChange, this, 0, 0), this.scale = new ObservablePoint.ObservablePoint(this.onChange, this, 1, 1), this.pivot = new ObservablePoint.ObservablePoint(this.onChange, this, 0, 0), this.skew = new ObservablePoint.ObservablePoint(this.updateSkew, this, 0, 0), this._rotation = 0, this._cx = 1, this._sx = 0, this._cy = 0, this._sy = 1, this._localID = 0, this._currentLocalID = 0, this._worldID = 0, this._parentID = 0;
}
/** Called when a value changes. */
onChange() {
this._localID++;
}
/** Called when the skew or the rotation changes. */
updateSkew() {
this._cx = Math.cos(this._rotation + this.skew.y), this._sx = Math.sin(this._rotation + this.skew.y), this._cy = -Math.sin(this._rotation - this.skew.x), this._sy = Math.cos(this._rotation - this.skew.x), this._localID++;
}
/** Updates the local transformation matrix. */
updateLocalTransform() {
const lt = this.localTransform;
this._localID !== this._currentLocalID && (lt.a = this._cx * this.scale.x, lt.b = this._sx * this.scale.x, lt.c = this._cy * this.scale.y, lt.d = this._sy * this.scale.y, lt.tx = this.position.x - (this.pivot.x * lt.a + this.pivot.y * lt.c), lt.ty = this.position.y - (this.pivot.x * lt.b + this.pivot.y * lt.d), this._currentLocalID = this._localID, this._parentID = -1);
}
/**
* Updates the local and the world transformation matrices.
* @param parentTransform - The parent transform
*/
updateTransform(parentTransform) {
const lt = this.localTransform;
if (this._localID !== this._currentLocalID && (lt.a = this._cx * this.scale.x, lt.b = this._sx * this.scale.x, lt.c = this._cy * this.scale.y, lt.d = this._sy * this.scale.y, lt.tx = this.position.x - (this.pivot.x * lt.a + this.pivot.y * lt.c), lt.ty = this.position.y - (this.pivot.x * lt.b + this.pivot.y * lt.d), this._currentLocalID = this._localID, this._parentID = -1), this._parentID !== parentTransform._worldID) {
const pt = parentTransform.worldTransform, wt = this.worldTransform;
wt.a = lt.a * pt.a + lt.b * pt.c, wt.b = lt.a * pt.b + lt.b * pt.d, wt.c = lt.c * pt.a + lt.d * pt.c, wt.d = lt.c * pt.b + lt.d * pt.d, wt.tx = lt.tx * pt.a + lt.ty * pt.c + pt.tx, wt.ty = lt.tx * pt.b + lt.ty * pt.d + pt.ty, this._parentID = parentTransform._worldID, this._worldID++;
}
}
/**
* Decomposes a matrix and sets the transforms properties based on it.
* @param matrix - The matrix to decompose
*/
setFromMatrix(matrix) {
matrix.decompose(this), this._localID++;
}
/** The rotation of the object in radians. */
get rotation() {
return this._rotation;
}
set rotation(value) {
this._rotation !== value && (this._rotation = value, this.updateSkew());
}
};
_Transform.IDENTITY = new _Transform();
let Transform = _Transform;
Transform.prototype.toString = function() {
return `[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`;
};
exports.Transform = Transform;
//# sourceMappingURL=Transform.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,54 @@
import { Matrix } from "./Matrix.mjs";
import { ObservablePoint } from "./ObservablePoint.mjs";
const _Transform = class {
constructor() {
this.worldTransform = new Matrix(), this.localTransform = new Matrix(), this.position = new ObservablePoint(this.onChange, this, 0, 0), this.scale = new ObservablePoint(this.onChange, this, 1, 1), this.pivot = new ObservablePoint(this.onChange, this, 0, 0), this.skew = new ObservablePoint(this.updateSkew, this, 0, 0), this._rotation = 0, this._cx = 1, this._sx = 0, this._cy = 0, this._sy = 1, this._localID = 0, this._currentLocalID = 0, this._worldID = 0, this._parentID = 0;
}
/** Called when a value changes. */
onChange() {
this._localID++;
}
/** Called when the skew or the rotation changes. */
updateSkew() {
this._cx = Math.cos(this._rotation + this.skew.y), this._sx = Math.sin(this._rotation + this.skew.y), this._cy = -Math.sin(this._rotation - this.skew.x), this._sy = Math.cos(this._rotation - this.skew.x), this._localID++;
}
/** Updates the local transformation matrix. */
updateLocalTransform() {
const lt = this.localTransform;
this._localID !== this._currentLocalID && (lt.a = this._cx * this.scale.x, lt.b = this._sx * this.scale.x, lt.c = this._cy * this.scale.y, lt.d = this._sy * this.scale.y, lt.tx = this.position.x - (this.pivot.x * lt.a + this.pivot.y * lt.c), lt.ty = this.position.y - (this.pivot.x * lt.b + this.pivot.y * lt.d), this._currentLocalID = this._localID, this._parentID = -1);
}
/**
* Updates the local and the world transformation matrices.
* @param parentTransform - The parent transform
*/
updateTransform(parentTransform) {
const lt = this.localTransform;
if (this._localID !== this._currentLocalID && (lt.a = this._cx * this.scale.x, lt.b = this._sx * this.scale.x, lt.c = this._cy * this.scale.y, lt.d = this._sy * this.scale.y, lt.tx = this.position.x - (this.pivot.x * lt.a + this.pivot.y * lt.c), lt.ty = this.position.y - (this.pivot.x * lt.b + this.pivot.y * lt.d), this._currentLocalID = this._localID, this._parentID = -1), this._parentID !== parentTransform._worldID) {
const pt = parentTransform.worldTransform, wt = this.worldTransform;
wt.a = lt.a * pt.a + lt.b * pt.c, wt.b = lt.a * pt.b + lt.b * pt.d, wt.c = lt.c * pt.a + lt.d * pt.c, wt.d = lt.c * pt.b + lt.d * pt.d, wt.tx = lt.tx * pt.a + lt.ty * pt.c + pt.tx, wt.ty = lt.tx * pt.b + lt.ty * pt.d + pt.ty, this._parentID = parentTransform._worldID, this._worldID++;
}
}
/**
* Decomposes a matrix and sets the transforms properties based on it.
* @param matrix - The matrix to decompose
*/
setFromMatrix(matrix) {
matrix.decompose(this), this._localID++;
}
/** The rotation of the object in radians. */
get rotation() {
return this._rotation;
}
set rotation(value) {
this._rotation !== value && (this._rotation = value, this.updateSkew());
}
};
_Transform.IDENTITY = new _Transform();
let Transform = _Transform;
Transform.prototype.toString = function() {
return `[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`;
};
export {
Transform
};
//# sourceMappingURL=Transform.mjs.map

File diff suppressed because one or more lines are too long

8
resources/app/node_modules/@pixi/math/lib/const.js generated vendored Normal file
View File

@@ -0,0 +1,8 @@
"use strict";
const PI_2 = Math.PI * 2, RAD_TO_DEG = 180 / Math.PI, DEG_TO_RAD = Math.PI / 180;
var SHAPES = /* @__PURE__ */ ((SHAPES2) => (SHAPES2[SHAPES2.POLY = 0] = "POLY", SHAPES2[SHAPES2.RECT = 1] = "RECT", SHAPES2[SHAPES2.CIRC = 2] = "CIRC", SHAPES2[SHAPES2.ELIP = 3] = "ELIP", SHAPES2[SHAPES2.RREC = 4] = "RREC", SHAPES2))(SHAPES || {});
exports.DEG_TO_RAD = DEG_TO_RAD;
exports.PI_2 = PI_2;
exports.RAD_TO_DEG = RAD_TO_DEG;
exports.SHAPES = SHAPES;
//# sourceMappingURL=const.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"const.js","sources":["../src/const.ts"],"sourcesContent":["/**\n * Two Pi.\n * @static\n * @member {number}\n * @memberof PIXI\n */\nexport const PI_2 = Math.PI * 2;\n\n/**\n * Conversion factor for converting radians to degrees.\n * @static\n * @member {number} RAD_TO_DEG\n * @memberof PIXI\n */\nexport const RAD_TO_DEG = 180 / Math.PI;\n\n/**\n * Conversion factor for converting degrees to radians.\n * @static\n * @member {number}\n * @memberof PIXI\n */\nexport const DEG_TO_RAD = Math.PI / 180;\n\n/**\n * Constants that identify shapes, mainly to prevent `instanceof` calls.\n * @static\n * @memberof PIXI\n * @enum {number}\n */\nexport enum SHAPES\n// eslint-disable-next-line @typescript-eslint/indent\n{\n /**\n * @property {number} RECT Rectangle\n * @default 0\n */\n POLY = 0,\n /**\n * @property {number} POLY Polygon\n * @default 1\n */\n RECT = 1,\n /**\n * @property {number} CIRC Circle\n * @default 2\n */\n CIRC = 2,\n /**\n * @property {number} ELIP Ellipse\n * @default 3\n */\n ELIP = 3,\n /**\n * @property {number} RREC Rounded Rectangle\n * @default 4\n */\n RREC = 4,\n}\n"],"names":["SHAPES"],"mappings":";AAMa,MAAA,OAAO,KAAK,KAAK,GAQjB,aAAa,MAAM,KAAK,IAQxB,aAAa,KAAK,KAAK;AAQxB,IAAA,2BAAAA,aAORA,QAAAA,QAAA,OAAO,CAAP,IAAA,QAKAA,QAAA,QAAA,OAAO,CAAP,IAAA,QAKAA,gBAAA,OAAO,CAAA,IAAP,QAKAA,QAAAA,QAAA,OAAO,CAAA,IAAP,QAKAA,QAAA,QAAA,OAAO,CAAP,IAAA,QA3BQA,UAAA,UAAA,CAAA,CAAA;;;;;"}

9
resources/app/node_modules/@pixi/math/lib/const.mjs generated vendored Normal file
View File

@@ -0,0 +1,9 @@
const PI_2 = Math.PI * 2, RAD_TO_DEG = 180 / Math.PI, DEG_TO_RAD = Math.PI / 180;
var SHAPES = /* @__PURE__ */ ((SHAPES2) => (SHAPES2[SHAPES2.POLY = 0] = "POLY", SHAPES2[SHAPES2.RECT = 1] = "RECT", SHAPES2[SHAPES2.CIRC = 2] = "CIRC", SHAPES2[SHAPES2.ELIP = 3] = "ELIP", SHAPES2[SHAPES2.RREC = 4] = "RREC", SHAPES2))(SHAPES || {});
export {
DEG_TO_RAD,
PI_2,
RAD_TO_DEG,
SHAPES
};
//# sourceMappingURL=const.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"const.mjs","sources":["../src/const.ts"],"sourcesContent":["/**\n * Two Pi.\n * @static\n * @member {number}\n * @memberof PIXI\n */\nexport const PI_2 = Math.PI * 2;\n\n/**\n * Conversion factor for converting radians to degrees.\n * @static\n * @member {number} RAD_TO_DEG\n * @memberof PIXI\n */\nexport const RAD_TO_DEG = 180 / Math.PI;\n\n/**\n * Conversion factor for converting degrees to radians.\n * @static\n * @member {number}\n * @memberof PIXI\n */\nexport const DEG_TO_RAD = Math.PI / 180;\n\n/**\n * Constants that identify shapes, mainly to prevent `instanceof` calls.\n * @static\n * @memberof PIXI\n * @enum {number}\n */\nexport enum SHAPES\n// eslint-disable-next-line @typescript-eslint/indent\n{\n /**\n * @property {number} RECT Rectangle\n * @default 0\n */\n POLY = 0,\n /**\n * @property {number} POLY Polygon\n * @default 1\n */\n RECT = 1,\n /**\n * @property {number} CIRC Circle\n * @default 2\n */\n CIRC = 2,\n /**\n * @property {number} ELIP Ellipse\n * @default 3\n */\n ELIP = 3,\n /**\n * @property {number} RREC Rounded Rectangle\n * @default 4\n */\n RREC = 4,\n}\n"],"names":["SHAPES"],"mappings":"AAMa,MAAA,OAAO,KAAK,KAAK,GAQjB,aAAa,MAAM,KAAK,IAQxB,aAAa,KAAK,KAAK;AAQxB,IAAA,2BAAAA,aAORA,QAAAA,QAAA,OAAO,CAAP,IAAA,QAKAA,QAAA,QAAA,OAAO,CAAP,IAAA,QAKAA,gBAAA,OAAO,CAAA,IAAP,QAKAA,QAAAA,QAAA,OAAO,CAAA,IAAP,QAKAA,QAAA,QAAA,OAAO,CAAP,IAAA,QA3BQA,UAAA,UAAA,CAAA,CAAA;"}

199
resources/app/node_modules/@pixi/math/lib/groupD8.js generated vendored Normal file
View File

@@ -0,0 +1,199 @@
"use strict";
var Matrix = require("./Matrix.js");
const ux = [1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1, 0, 1], uy = [0, 1, 1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1], vx = [0, -1, -1, -1, 0, 1, 1, 1, 0, 1, 1, 1, 0, -1, -1, -1], vy = [1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, 1, 1, 1, 0, -1], rotationCayley = [], rotationMatrices = [], signum = Math.sign;
function init() {
for (let i = 0; i < 16; i++) {
const row = [];
rotationCayley.push(row);
for (let j = 0; j < 16; j++) {
const _ux = signum(ux[i] * ux[j] + vx[i] * uy[j]), _uy = signum(uy[i] * ux[j] + vy[i] * uy[j]), _vx = signum(ux[i] * vx[j] + vx[i] * vy[j]), _vy = signum(uy[i] * vx[j] + vy[i] * vy[j]);
for (let k = 0; k < 16; k++)
if (ux[k] === _ux && uy[k] === _uy && vx[k] === _vx && vy[k] === _vy) {
row.push(k);
break;
}
}
}
for (let i = 0; i < 16; i++) {
const mat = new Matrix.Matrix();
mat.set(ux[i], uy[i], vx[i], vy[i], 0, 0), rotationMatrices.push(mat);
}
}
init();
const groupD8 = {
/**
* | Rotation | Direction |
* |----------|-----------|
* | 0° | East |
* @readonly
*/
E: 0,
/**
* | Rotation | Direction |
* |----------|-----------|
* | 45°↻ | Southeast |
* @readonly
*/
SE: 1,
/**
* | Rotation | Direction |
* |----------|-----------|
* | 90°↻ | South |
* @readonly
*/
S: 2,
/**
* | Rotation | Direction |
* |----------|-----------|
* | 135°↻ | Southwest |
* @readonly
*/
SW: 3,
/**
* | Rotation | Direction |
* |----------|-----------|
* | 180° | West |
* @readonly
*/
W: 4,
/**
* | Rotation | Direction |
* |-------------|--------------|
* | -135°/225°↻ | Northwest |
* @readonly
*/
NW: 5,
/**
* | Rotation | Direction |
* |-------------|--------------|
* | -90°/270°↻ | North |
* @readonly
*/
N: 6,
/**
* | Rotation | Direction |
* |-------------|--------------|
* | -45°/315°↻ | Northeast |
* @readonly
*/
NE: 7,
/**
* Reflection about Y-axis.
* @readonly
*/
MIRROR_VERTICAL: 8,
/**
* Reflection about the main diagonal.
* @readonly
*/
MAIN_DIAGONAL: 10,
/**
* Reflection about X-axis.
* @readonly
*/
MIRROR_HORIZONTAL: 12,
/**
* Reflection about reverse diagonal.
* @readonly
*/
REVERSE_DIAGONAL: 14,
/**
* @param {PIXI.GD8Symmetry} ind - sprite rotation angle.
* @returns {PIXI.GD8Symmetry} The X-component of the U-axis
* after rotating the axes.
*/
uX: (ind) => ux[ind],
/**
* @param {PIXI.GD8Symmetry} ind - sprite rotation angle.
* @returns {PIXI.GD8Symmetry} The Y-component of the U-axis
* after rotating the axes.
*/
uY: (ind) => uy[ind],
/**
* @param {PIXI.GD8Symmetry} ind - sprite rotation angle.
* @returns {PIXI.GD8Symmetry} The X-component of the V-axis
* after rotating the axes.
*/
vX: (ind) => vx[ind],
/**
* @param {PIXI.GD8Symmetry} ind - sprite rotation angle.
* @returns {PIXI.GD8Symmetry} The Y-component of the V-axis
* after rotating the axes.
*/
vY: (ind) => vy[ind],
/**
* @param {PIXI.GD8Symmetry} rotation - symmetry whose opposite
* is needed. Only rotations have opposite symmetries while
* reflections don't.
* @returns {PIXI.GD8Symmetry} The opposite symmetry of `rotation`
*/
inv: (rotation) => rotation & 8 ? rotation & 15 : -rotation & 7,
/**
* Composes the two D8 operations.
*
* Taking `^` as reflection:
*
* | | E=0 | S=2 | W=4 | N=6 | E^=8 | S^=10 | W^=12 | N^=14 |
* |-------|-----|-----|-----|-----|------|-------|-------|-------|
* | E=0 | E | S | W | N | E^ | S^ | W^ | N^ |
* | S=2 | S | W | N | E | S^ | W^ | N^ | E^ |
* | W=4 | W | N | E | S | W^ | N^ | E^ | S^ |
* | N=6 | N | E | S | W | N^ | E^ | S^ | W^ |
* | E^=8 | E^ | N^ | W^ | S^ | E | N | W | S |
* | S^=10 | S^ | E^ | N^ | W^ | S | E | N | W |
* | W^=12 | W^ | S^ | E^ | N^ | W | S | E | N |
* | N^=14 | N^ | W^ | S^ | E^ | N | W | S | E |
*
* [This is a Cayley table]{@link https://en.wikipedia.org/wiki/Cayley_table}
* @param {PIXI.GD8Symmetry} rotationSecond - Second operation, which
* is the row in the above cayley table.
* @param {PIXI.GD8Symmetry} rotationFirst - First operation, which
* is the column in the above cayley table.
* @returns {PIXI.GD8Symmetry} Composed operation
*/
add: (rotationSecond, rotationFirst) => rotationCayley[rotationSecond][rotationFirst],
/**
* Reverse of `add`.
* @param {PIXI.GD8Symmetry} rotationSecond - Second operation
* @param {PIXI.GD8Symmetry} rotationFirst - First operation
* @returns {PIXI.GD8Symmetry} Result
*/
sub: (rotationSecond, rotationFirst) => rotationCayley[rotationSecond][groupD8.inv(rotationFirst)],
/**
* Adds 180 degrees to rotation, which is a commutative
* operation.
* @param {number} rotation - The number to rotate.
* @returns {number} Rotated number
*/
rotate180: (rotation) => rotation ^ 4,
/**
* Checks if the rotation angle is vertical, i.e. south
* or north. It doesn't work for reflections.
* @param {PIXI.GD8Symmetry} rotation - The number to check.
* @returns {boolean} Whether or not the direction is vertical
*/
isVertical: (rotation) => (rotation & 3) === 2,
// rotation % 4 === 2
/**
* Approximates the vector `V(dx,dy)` into one of the
* eight directions provided by `groupD8`.
* @param {number} dx - X-component of the vector
* @param {number} dy - Y-component of the vector
* @returns {PIXI.GD8Symmetry} Approximation of the vector into
* one of the eight symmetries.
*/
byDirection: (dx, dy) => Math.abs(dx) * 2 <= Math.abs(dy) ? dy >= 0 ? groupD8.S : groupD8.N : Math.abs(dy) * 2 <= Math.abs(dx) ? dx > 0 ? groupD8.E : groupD8.W : dy > 0 ? dx > 0 ? groupD8.SE : groupD8.SW : dx > 0 ? groupD8.NE : groupD8.NW,
/**
* Helps sprite to compensate texture packer rotation.
* @param {PIXI.Matrix} matrix - sprite world matrix
* @param {PIXI.GD8Symmetry} rotation - The rotation factor to use.
* @param {number} tx - sprite anchoring
* @param {number} ty - sprite anchoring
*/
matrixAppendRotationInv: (matrix, rotation, tx = 0, ty = 0) => {
const mat = rotationMatrices[groupD8.inv(rotation)];
mat.tx = tx, mat.ty = ty, matrix.append(mat);
}
};
exports.groupD8 = groupD8;
//# sourceMappingURL=groupD8.js.map

File diff suppressed because one or more lines are too long

200
resources/app/node_modules/@pixi/math/lib/groupD8.mjs generated vendored Normal file
View File

@@ -0,0 +1,200 @@
import { Matrix } from "./Matrix.mjs";
const ux = [1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1, 0, 1], uy = [0, 1, 1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1], vx = [0, -1, -1, -1, 0, 1, 1, 1, 0, 1, 1, 1, 0, -1, -1, -1], vy = [1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, 1, 1, 1, 0, -1], rotationCayley = [], rotationMatrices = [], signum = Math.sign;
function init() {
for (let i = 0; i < 16; i++) {
const row = [];
rotationCayley.push(row);
for (let j = 0; j < 16; j++) {
const _ux = signum(ux[i] * ux[j] + vx[i] * uy[j]), _uy = signum(uy[i] * ux[j] + vy[i] * uy[j]), _vx = signum(ux[i] * vx[j] + vx[i] * vy[j]), _vy = signum(uy[i] * vx[j] + vy[i] * vy[j]);
for (let k = 0; k < 16; k++)
if (ux[k] === _ux && uy[k] === _uy && vx[k] === _vx && vy[k] === _vy) {
row.push(k);
break;
}
}
}
for (let i = 0; i < 16; i++) {
const mat = new Matrix();
mat.set(ux[i], uy[i], vx[i], vy[i], 0, 0), rotationMatrices.push(mat);
}
}
init();
const groupD8 = {
/**
* | Rotation | Direction |
* |----------|-----------|
* | 0° | East |
* @readonly
*/
E: 0,
/**
* | Rotation | Direction |
* |----------|-----------|
* | 45°↻ | Southeast |
* @readonly
*/
SE: 1,
/**
* | Rotation | Direction |
* |----------|-----------|
* | 90°↻ | South |
* @readonly
*/
S: 2,
/**
* | Rotation | Direction |
* |----------|-----------|
* | 135°↻ | Southwest |
* @readonly
*/
SW: 3,
/**
* | Rotation | Direction |
* |----------|-----------|
* | 180° | West |
* @readonly
*/
W: 4,
/**
* | Rotation | Direction |
* |-------------|--------------|
* | -135°/225°↻ | Northwest |
* @readonly
*/
NW: 5,
/**
* | Rotation | Direction |
* |-------------|--------------|
* | -90°/270°↻ | North |
* @readonly
*/
N: 6,
/**
* | Rotation | Direction |
* |-------------|--------------|
* | -45°/315°↻ | Northeast |
* @readonly
*/
NE: 7,
/**
* Reflection about Y-axis.
* @readonly
*/
MIRROR_VERTICAL: 8,
/**
* Reflection about the main diagonal.
* @readonly
*/
MAIN_DIAGONAL: 10,
/**
* Reflection about X-axis.
* @readonly
*/
MIRROR_HORIZONTAL: 12,
/**
* Reflection about reverse diagonal.
* @readonly
*/
REVERSE_DIAGONAL: 14,
/**
* @param {PIXI.GD8Symmetry} ind - sprite rotation angle.
* @returns {PIXI.GD8Symmetry} The X-component of the U-axis
* after rotating the axes.
*/
uX: (ind) => ux[ind],
/**
* @param {PIXI.GD8Symmetry} ind - sprite rotation angle.
* @returns {PIXI.GD8Symmetry} The Y-component of the U-axis
* after rotating the axes.
*/
uY: (ind) => uy[ind],
/**
* @param {PIXI.GD8Symmetry} ind - sprite rotation angle.
* @returns {PIXI.GD8Symmetry} The X-component of the V-axis
* after rotating the axes.
*/
vX: (ind) => vx[ind],
/**
* @param {PIXI.GD8Symmetry} ind - sprite rotation angle.
* @returns {PIXI.GD8Symmetry} The Y-component of the V-axis
* after rotating the axes.
*/
vY: (ind) => vy[ind],
/**
* @param {PIXI.GD8Symmetry} rotation - symmetry whose opposite
* is needed. Only rotations have opposite symmetries while
* reflections don't.
* @returns {PIXI.GD8Symmetry} The opposite symmetry of `rotation`
*/
inv: (rotation) => rotation & 8 ? rotation & 15 : -rotation & 7,
/**
* Composes the two D8 operations.
*
* Taking `^` as reflection:
*
* | | E=0 | S=2 | W=4 | N=6 | E^=8 | S^=10 | W^=12 | N^=14 |
* |-------|-----|-----|-----|-----|------|-------|-------|-------|
* | E=0 | E | S | W | N | E^ | S^ | W^ | N^ |
* | S=2 | S | W | N | E | S^ | W^ | N^ | E^ |
* | W=4 | W | N | E | S | W^ | N^ | E^ | S^ |
* | N=6 | N | E | S | W | N^ | E^ | S^ | W^ |
* | E^=8 | E^ | N^ | W^ | S^ | E | N | W | S |
* | S^=10 | S^ | E^ | N^ | W^ | S | E | N | W |
* | W^=12 | W^ | S^ | E^ | N^ | W | S | E | N |
* | N^=14 | N^ | W^ | S^ | E^ | N | W | S | E |
*
* [This is a Cayley table]{@link https://en.wikipedia.org/wiki/Cayley_table}
* @param {PIXI.GD8Symmetry} rotationSecond - Second operation, which
* is the row in the above cayley table.
* @param {PIXI.GD8Symmetry} rotationFirst - First operation, which
* is the column in the above cayley table.
* @returns {PIXI.GD8Symmetry} Composed operation
*/
add: (rotationSecond, rotationFirst) => rotationCayley[rotationSecond][rotationFirst],
/**
* Reverse of `add`.
* @param {PIXI.GD8Symmetry} rotationSecond - Second operation
* @param {PIXI.GD8Symmetry} rotationFirst - First operation
* @returns {PIXI.GD8Symmetry} Result
*/
sub: (rotationSecond, rotationFirst) => rotationCayley[rotationSecond][groupD8.inv(rotationFirst)],
/**
* Adds 180 degrees to rotation, which is a commutative
* operation.
* @param {number} rotation - The number to rotate.
* @returns {number} Rotated number
*/
rotate180: (rotation) => rotation ^ 4,
/**
* Checks if the rotation angle is vertical, i.e. south
* or north. It doesn't work for reflections.
* @param {PIXI.GD8Symmetry} rotation - The number to check.
* @returns {boolean} Whether or not the direction is vertical
*/
isVertical: (rotation) => (rotation & 3) === 2,
// rotation % 4 === 2
/**
* Approximates the vector `V(dx,dy)` into one of the
* eight directions provided by `groupD8`.
* @param {number} dx - X-component of the vector
* @param {number} dy - Y-component of the vector
* @returns {PIXI.GD8Symmetry} Approximation of the vector into
* one of the eight symmetries.
*/
byDirection: (dx, dy) => Math.abs(dx) * 2 <= Math.abs(dy) ? dy >= 0 ? groupD8.S : groupD8.N : Math.abs(dy) * 2 <= Math.abs(dx) ? dx > 0 ? groupD8.E : groupD8.W : dy > 0 ? dx > 0 ? groupD8.SE : groupD8.SW : dx > 0 ? groupD8.NE : groupD8.NW,
/**
* Helps sprite to compensate texture packer rotation.
* @param {PIXI.Matrix} matrix - sprite world matrix
* @param {PIXI.GD8Symmetry} rotation - The rotation factor to use.
* @param {number} tx - sprite anchoring
* @param {number} ty - sprite anchoring
*/
matrixAppendRotationInv: (matrix, rotation, tx = 0, ty = 0) => {
const mat = rotationMatrices[groupD8.inv(rotation)];
mat.tx = tx, mat.ty = ty, matrix.append(mat);
}
};
export {
groupD8
};
//# sourceMappingURL=groupD8.mjs.map

File diff suppressed because one or more lines are too long

20
resources/app/node_modules/@pixi/math/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,20 @@
"use strict";
var Circle = require("./shapes/Circle.js"), Ellipse = require("./shapes/Ellipse.js"), Polygon = require("./shapes/Polygon.js"), Rectangle = require("./shapes/Rectangle.js"), RoundedRectangle = require("./shapes/RoundedRectangle.js"), groupD8 = require("./groupD8.js");
require("./IPoint.js");
require("./IPointData.js");
var Matrix = require("./Matrix.js"), ObservablePoint = require("./ObservablePoint.js"), Point = require("./Point.js"), Transform = require("./Transform.js"), _const = require("./const.js");
exports.Circle = Circle.Circle;
exports.Ellipse = Ellipse.Ellipse;
exports.Polygon = Polygon.Polygon;
exports.Rectangle = Rectangle.Rectangle;
exports.RoundedRectangle = RoundedRectangle.RoundedRectangle;
exports.groupD8 = groupD8.groupD8;
exports.Matrix = Matrix.Matrix;
exports.ObservablePoint = ObservablePoint.ObservablePoint;
exports.Point = Point.Point;
exports.Transform = Transform.Transform;
exports.DEG_TO_RAD = _const.DEG_TO_RAD;
exports.PI_2 = _const.PI_2;
exports.RAD_TO_DEG = _const.RAD_TO_DEG;
exports.SHAPES = _const.SHAPES;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}

30
resources/app/node_modules/@pixi/math/lib/index.mjs generated vendored Normal file
View File

@@ -0,0 +1,30 @@
import { Circle } from "./shapes/Circle.mjs";
import { Ellipse } from "./shapes/Ellipse.mjs";
import { Polygon } from "./shapes/Polygon.mjs";
import { Rectangle } from "./shapes/Rectangle.mjs";
import { RoundedRectangle } from "./shapes/RoundedRectangle.mjs";
import { groupD8 } from "./groupD8.mjs";
import "./IPoint.mjs";
import "./IPointData.mjs";
import { Matrix } from "./Matrix.mjs";
import { ObservablePoint } from "./ObservablePoint.mjs";
import { Point } from "./Point.mjs";
import { Transform } from "./Transform.mjs";
import { DEG_TO_RAD, PI_2, RAD_TO_DEG, SHAPES } from "./const.mjs";
export {
Circle,
DEG_TO_RAD,
Ellipse,
Matrix,
ObservablePoint,
PI_2,
Point,
Polygon,
RAD_TO_DEG,
Rectangle,
RoundedRectangle,
SHAPES,
Transform,
groupD8
};
//# sourceMappingURL=index.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}

View File

@@ -0,0 +1,44 @@
"use strict";
var _const = require("../const.js"), Rectangle = require("./Rectangle.js");
class Circle {
/**
* @param x - The X coordinate of the center of this circle
* @param y - The Y coordinate of the center of this circle
* @param radius - The radius of the circle
*/
constructor(x = 0, y = 0, radius = 0) {
this.x = x, this.y = y, this.radius = radius, this.type = _const.SHAPES.CIRC;
}
/**
* Creates a clone of this Circle instance
* @returns A copy of the Circle
*/
clone() {
return new Circle(this.x, this.y, this.radius);
}
/**
* Checks whether the x and y coordinates given are contained within this circle
* @param x - The X coordinate of the point to test
* @param y - The Y coordinate of the point to test
* @returns Whether the x/y coordinates are within this Circle
*/
contains(x, y) {
if (this.radius <= 0)
return !1;
const r2 = this.radius * this.radius;
let dx = this.x - x, dy = this.y - y;
return dx *= dx, dy *= dy, dx + dy <= r2;
}
/**
* Returns the framing rectangle of the circle as a Rectangle object
* @returns The framing rectangle
*/
getBounds() {
return new Rectangle.Rectangle(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2);
}
}
Circle.prototype.toString = function() {
return `[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`;
};
exports.Circle = Circle;
//# sourceMappingURL=Circle.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Circle.js","sources":["../../src/shapes/Circle.ts"],"sourcesContent":["import { SHAPES } from './../const';\nimport { Rectangle } from './Rectangle';\n\n/**\n * The Circle object is used to help draw graphics and can also be used to specify a hit area for displayObjects.\n * @memberof PIXI\n */\nexport class Circle\n{\n /** @default 0 */\n public x: number;\n\n /** @default 0 */\n public y: number;\n\n /** @default 0 */\n public radius: number;\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n * @default PIXI.SHAPES.CIRC\n * @see PIXI.SHAPES\n */\n public readonly type: SHAPES.CIRC;\n\n /**\n * @param x - The X coordinate of the center of this circle\n * @param y - The Y coordinate of the center of this circle\n * @param radius - The radius of the circle\n */\n constructor(x = 0, y = 0, radius = 0)\n {\n this.x = x;\n this.y = y;\n this.radius = radius;\n\n this.type = SHAPES.CIRC;\n }\n\n /**\n * Creates a clone of this Circle instance\n * @returns A copy of the Circle\n */\n clone(): Circle\n {\n return new Circle(this.x, this.y, this.radius);\n }\n\n /**\n * Checks whether the x and y coordinates given are contained within this circle\n * @param x - The X coordinate of the point to test\n * @param y - The Y coordinate of the point to test\n * @returns Whether the x/y coordinates are within this Circle\n */\n contains(x: number, y: number): boolean\n {\n if (this.radius <= 0)\n {\n return false;\n }\n\n const r2 = this.radius * this.radius;\n let dx = (this.x - x);\n let dy = (this.y - y);\n\n dx *= dx;\n dy *= dy;\n\n return (dx + dy <= r2);\n }\n\n /**\n * Returns the framing rectangle of the circle as a Rectangle object\n * @returns The framing rectangle\n */\n getBounds(): Rectangle\n {\n return new Rectangle(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2);\n }\n}\n\nif (process.env.DEBUG)\n{\n Circle.prototype.toString = function toString(): string\n {\n return `[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`;\n };\n}\n"],"names":["SHAPES","Rectangle"],"mappings":";;AAOO,MAAM,OACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAsBI,YAAY,IAAI,GAAG,IAAI,GAAG,SAAS,GACnC;AACS,SAAA,IAAI,GACT,KAAK,IAAI,GACT,KAAK,SAAS,QAEd,KAAK,OAAOA,OAAAA,OAAO;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,QACA;AACI,WAAO,IAAI,OAAO,KAAK,GAAG,KAAK,GAAG,KAAK,MAAM;AAAA,EACjD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,SAAS,GAAW,GACpB;AACI,QAAI,KAAK,UAAU;AAER,aAAA;AAGL,UAAA,KAAK,KAAK,SAAS,KAAK;AAC9B,QAAI,KAAM,KAAK,IAAI,GACf,KAAM,KAAK,IAAI;AAEnB,WAAA,MAAM,IACN,MAAM,IAEE,KAAK,MAAM;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,YACA;AACI,WAAO,IAAIC,UAAA,UAAU,KAAK,IAAI,KAAK,QAAQ,KAAK,IAAI,KAAK,QAAQ,KAAK,SAAS,GAAG,KAAK,SAAS,CAAC;AAAA,EACrG;AACJ;AAII,OAAO,UAAU,WAAW,WAC5B;AACW,SAAA,wBAAwB,KAAK,CAAC,MAAM,KAAK,CAAC,WAAW,KAAK,MAAM;AAC3E;;"}

View File

@@ -0,0 +1,46 @@
import { SHAPES } from "../const.mjs";
import { Rectangle } from "./Rectangle.mjs";
class Circle {
/**
* @param x - The X coordinate of the center of this circle
* @param y - The Y coordinate of the center of this circle
* @param radius - The radius of the circle
*/
constructor(x = 0, y = 0, radius = 0) {
this.x = x, this.y = y, this.radius = radius, this.type = SHAPES.CIRC;
}
/**
* Creates a clone of this Circle instance
* @returns A copy of the Circle
*/
clone() {
return new Circle(this.x, this.y, this.radius);
}
/**
* Checks whether the x and y coordinates given are contained within this circle
* @param x - The X coordinate of the point to test
* @param y - The Y coordinate of the point to test
* @returns Whether the x/y coordinates are within this Circle
*/
contains(x, y) {
if (this.radius <= 0)
return !1;
const r2 = this.radius * this.radius;
let dx = this.x - x, dy = this.y - y;
return dx *= dx, dy *= dy, dx + dy <= r2;
}
/**
* Returns the framing rectangle of the circle as a Rectangle object
* @returns The framing rectangle
*/
getBounds() {
return new Rectangle(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2);
}
}
Circle.prototype.toString = function() {
return `[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`;
};
export {
Circle
};
//# sourceMappingURL=Circle.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Circle.mjs","sources":["../../src/shapes/Circle.ts"],"sourcesContent":["import { SHAPES } from './../const';\nimport { Rectangle } from './Rectangle';\n\n/**\n * The Circle object is used to help draw graphics and can also be used to specify a hit area for displayObjects.\n * @memberof PIXI\n */\nexport class Circle\n{\n /** @default 0 */\n public x: number;\n\n /** @default 0 */\n public y: number;\n\n /** @default 0 */\n public radius: number;\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n * @default PIXI.SHAPES.CIRC\n * @see PIXI.SHAPES\n */\n public readonly type: SHAPES.CIRC;\n\n /**\n * @param x - The X coordinate of the center of this circle\n * @param y - The Y coordinate of the center of this circle\n * @param radius - The radius of the circle\n */\n constructor(x = 0, y = 0, radius = 0)\n {\n this.x = x;\n this.y = y;\n this.radius = radius;\n\n this.type = SHAPES.CIRC;\n }\n\n /**\n * Creates a clone of this Circle instance\n * @returns A copy of the Circle\n */\n clone(): Circle\n {\n return new Circle(this.x, this.y, this.radius);\n }\n\n /**\n * Checks whether the x and y coordinates given are contained within this circle\n * @param x - The X coordinate of the point to test\n * @param y - The Y coordinate of the point to test\n * @returns Whether the x/y coordinates are within this Circle\n */\n contains(x: number, y: number): boolean\n {\n if (this.radius <= 0)\n {\n return false;\n }\n\n const r2 = this.radius * this.radius;\n let dx = (this.x - x);\n let dy = (this.y - y);\n\n dx *= dx;\n dy *= dy;\n\n return (dx + dy <= r2);\n }\n\n /**\n * Returns the framing rectangle of the circle as a Rectangle object\n * @returns The framing rectangle\n */\n getBounds(): Rectangle\n {\n return new Rectangle(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2);\n }\n}\n\nif (process.env.DEBUG)\n{\n Circle.prototype.toString = function toString(): string\n {\n return `[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`;\n };\n}\n"],"names":[],"mappings":";;AAOO,MAAM,OACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAsBI,YAAY,IAAI,GAAG,IAAI,GAAG,SAAS,GACnC;AACS,SAAA,IAAI,GACT,KAAK,IAAI,GACT,KAAK,SAAS,QAEd,KAAK,OAAO,OAAO;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,QACA;AACI,WAAO,IAAI,OAAO,KAAK,GAAG,KAAK,GAAG,KAAK,MAAM;AAAA,EACjD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,SAAS,GAAW,GACpB;AACI,QAAI,KAAK,UAAU;AAER,aAAA;AAGL,UAAA,KAAK,KAAK,SAAS,KAAK;AAC9B,QAAI,KAAM,KAAK,IAAI,GACf,KAAM,KAAK,IAAI;AAEnB,WAAA,MAAM,IACN,MAAM,IAEE,KAAK,MAAM;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,YACA;AACI,WAAO,IAAI,UAAU,KAAK,IAAI,KAAK,QAAQ,KAAK,IAAI,KAAK,QAAQ,KAAK,SAAS,GAAG,KAAK,SAAS,CAAC;AAAA,EACrG;AACJ;AAII,OAAO,UAAU,WAAW,WAC5B;AACW,SAAA,wBAAwB,KAAK,CAAC,MAAM,KAAK,CAAC,WAAW,KAAK,MAAM;AAC3E;"}

View File

@@ -0,0 +1,44 @@
"use strict";
var _const = require("../const.js"), Rectangle = require("./Rectangle.js");
class Ellipse {
/**
* @param x - The X coordinate of the center of this ellipse
* @param y - The Y coordinate of the center of this ellipse
* @param halfWidth - The half width of this ellipse
* @param halfHeight - The half height of this ellipse
*/
constructor(x = 0, y = 0, halfWidth = 0, halfHeight = 0) {
this.x = x, this.y = y, this.width = halfWidth, this.height = halfHeight, this.type = _const.SHAPES.ELIP;
}
/**
* Creates a clone of this Ellipse instance
* @returns {PIXI.Ellipse} A copy of the ellipse
*/
clone() {
return new Ellipse(this.x, this.y, this.width, this.height);
}
/**
* Checks whether the x and y coordinates given are contained within this ellipse
* @param x - The X coordinate of the point to test
* @param y - The Y coordinate of the point to test
* @returns Whether the x/y coords are within this ellipse
*/
contains(x, y) {
if (this.width <= 0 || this.height <= 0)
return !1;
let normx = (x - this.x) / this.width, normy = (y - this.y) / this.height;
return normx *= normx, normy *= normy, normx + normy <= 1;
}
/**
* Returns the framing rectangle of the ellipse as a Rectangle object
* @returns The framing rectangle
*/
getBounds() {
return new Rectangle.Rectangle(this.x - this.width, this.y - this.height, this.width, this.height);
}
}
Ellipse.prototype.toString = function() {
return `[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`;
};
exports.Ellipse = Ellipse;
//# sourceMappingURL=Ellipse.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Ellipse.js","sources":["../../src/shapes/Ellipse.ts"],"sourcesContent":["import { SHAPES } from '../const';\nimport { Rectangle } from './Rectangle';\n\n/**\n * The Ellipse object is used to help draw graphics and can also be used to specify a hit area for displayObjects.\n * @memberof PIXI\n */\nexport class Ellipse\n{\n /** @default 0 */\n public x: number;\n\n /** @default 0 */\n public y: number;\n\n /** @default 0 */\n public width: number;\n\n /** @default 0 */\n public height: number;\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n * @default PIXI.SHAPES.ELIP\n * @see PIXI.SHAPES\n */\n public readonly type: SHAPES.ELIP;\n\n /**\n * @param x - The X coordinate of the center of this ellipse\n * @param y - The Y coordinate of the center of this ellipse\n * @param halfWidth - The half width of this ellipse\n * @param halfHeight - The half height of this ellipse\n */\n constructor(x = 0, y = 0, halfWidth = 0, halfHeight = 0)\n {\n this.x = x;\n this.y = y;\n this.width = halfWidth;\n this.height = halfHeight;\n\n this.type = SHAPES.ELIP;\n }\n\n /**\n * Creates a clone of this Ellipse instance\n * @returns {PIXI.Ellipse} A copy of the ellipse\n */\n clone(): Ellipse\n {\n return new Ellipse(this.x, this.y, this.width, this.height);\n }\n\n /**\n * Checks whether the x and y coordinates given are contained within this ellipse\n * @param x - The X coordinate of the point to test\n * @param y - The Y coordinate of the point to test\n * @returns Whether the x/y coords are within this ellipse\n */\n contains(x: number, y: number): boolean\n {\n if (this.width <= 0 || this.height <= 0)\n {\n return false;\n }\n\n // normalize the coords to an ellipse with center 0,0\n let normx = ((x - this.x) / this.width);\n let normy = ((y - this.y) / this.height);\n\n normx *= normx;\n normy *= normy;\n\n return (normx + normy <= 1);\n }\n\n /**\n * Returns the framing rectangle of the ellipse as a Rectangle object\n * @returns The framing rectangle\n */\n getBounds(): Rectangle\n {\n return new Rectangle(this.x - this.width, this.y - this.height, this.width, this.height);\n }\n}\n\nif (process.env.DEBUG)\n{\n Ellipse.prototype.toString = function toString(): string\n {\n return `[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`;\n };\n}\n"],"names":["SHAPES","Rectangle"],"mappings":";;AAOO,MAAM,QACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA0BI,YAAY,IAAI,GAAG,IAAI,GAAG,YAAY,GAAG,aAAa,GACtD;AACI,SAAK,IAAI,GACT,KAAK,IAAI,GACT,KAAK,QAAQ,WACb,KAAK,SAAS,YAEd,KAAK,OAAOA,OAAO,OAAA;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,QACA;AACW,WAAA,IAAI,QAAQ,KAAK,GAAG,KAAK,GAAG,KAAK,OAAO,KAAK,MAAM;AAAA,EAC9D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,SAAS,GAAW,GACpB;AACI,QAAI,KAAK,SAAS,KAAK,KAAK,UAAU;AAE3B,aAAA;AAIP,QAAA,SAAU,IAAI,KAAK,KAAK,KAAK,OAC7B,SAAU,IAAI,KAAK,KAAK,KAAK;AAEjC,WAAA,SAAS,OACT,SAAS,OAED,QAAQ,SAAS;AAAA,EAC7B;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,YACA;AACI,WAAO,IAAIC,UAAA,UAAU,KAAK,IAAI,KAAK,OAAO,KAAK,IAAI,KAAK,QAAQ,KAAK,OAAO,KAAK,MAAM;AAAA,EAC3F;AACJ;AAII,QAAQ,UAAU,WAAW,WAC7B;AACW,SAAA,yBAAyB,KAAK,CAAC,MAAM,KAAK,CAAC,UAAU,KAAK,KAAK,WAAW,KAAK,MAAM;AAChG;;"}

View File

@@ -0,0 +1,46 @@
import { SHAPES } from "../const.mjs";
import { Rectangle } from "./Rectangle.mjs";
class Ellipse {
/**
* @param x - The X coordinate of the center of this ellipse
* @param y - The Y coordinate of the center of this ellipse
* @param halfWidth - The half width of this ellipse
* @param halfHeight - The half height of this ellipse
*/
constructor(x = 0, y = 0, halfWidth = 0, halfHeight = 0) {
this.x = x, this.y = y, this.width = halfWidth, this.height = halfHeight, this.type = SHAPES.ELIP;
}
/**
* Creates a clone of this Ellipse instance
* @returns {PIXI.Ellipse} A copy of the ellipse
*/
clone() {
return new Ellipse(this.x, this.y, this.width, this.height);
}
/**
* Checks whether the x and y coordinates given are contained within this ellipse
* @param x - The X coordinate of the point to test
* @param y - The Y coordinate of the point to test
* @returns Whether the x/y coords are within this ellipse
*/
contains(x, y) {
if (this.width <= 0 || this.height <= 0)
return !1;
let normx = (x - this.x) / this.width, normy = (y - this.y) / this.height;
return normx *= normx, normy *= normy, normx + normy <= 1;
}
/**
* Returns the framing rectangle of the ellipse as a Rectangle object
* @returns The framing rectangle
*/
getBounds() {
return new Rectangle(this.x - this.width, this.y - this.height, this.width, this.height);
}
}
Ellipse.prototype.toString = function() {
return `[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`;
};
export {
Ellipse
};
//# sourceMappingURL=Ellipse.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Ellipse.mjs","sources":["../../src/shapes/Ellipse.ts"],"sourcesContent":["import { SHAPES } from '../const';\nimport { Rectangle } from './Rectangle';\n\n/**\n * The Ellipse object is used to help draw graphics and can also be used to specify a hit area for displayObjects.\n * @memberof PIXI\n */\nexport class Ellipse\n{\n /** @default 0 */\n public x: number;\n\n /** @default 0 */\n public y: number;\n\n /** @default 0 */\n public width: number;\n\n /** @default 0 */\n public height: number;\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n * @default PIXI.SHAPES.ELIP\n * @see PIXI.SHAPES\n */\n public readonly type: SHAPES.ELIP;\n\n /**\n * @param x - The X coordinate of the center of this ellipse\n * @param y - The Y coordinate of the center of this ellipse\n * @param halfWidth - The half width of this ellipse\n * @param halfHeight - The half height of this ellipse\n */\n constructor(x = 0, y = 0, halfWidth = 0, halfHeight = 0)\n {\n this.x = x;\n this.y = y;\n this.width = halfWidth;\n this.height = halfHeight;\n\n this.type = SHAPES.ELIP;\n }\n\n /**\n * Creates a clone of this Ellipse instance\n * @returns {PIXI.Ellipse} A copy of the ellipse\n */\n clone(): Ellipse\n {\n return new Ellipse(this.x, this.y, this.width, this.height);\n }\n\n /**\n * Checks whether the x and y coordinates given are contained within this ellipse\n * @param x - The X coordinate of the point to test\n * @param y - The Y coordinate of the point to test\n * @returns Whether the x/y coords are within this ellipse\n */\n contains(x: number, y: number): boolean\n {\n if (this.width <= 0 || this.height <= 0)\n {\n return false;\n }\n\n // normalize the coords to an ellipse with center 0,0\n let normx = ((x - this.x) / this.width);\n let normy = ((y - this.y) / this.height);\n\n normx *= normx;\n normy *= normy;\n\n return (normx + normy <= 1);\n }\n\n /**\n * Returns the framing rectangle of the ellipse as a Rectangle object\n * @returns The framing rectangle\n */\n getBounds(): Rectangle\n {\n return new Rectangle(this.x - this.width, this.y - this.height, this.width, this.height);\n }\n}\n\nif (process.env.DEBUG)\n{\n Ellipse.prototype.toString = function toString(): string\n {\n return `[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`;\n };\n}\n"],"names":[],"mappings":";;AAOO,MAAM,QACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA0BI,YAAY,IAAI,GAAG,IAAI,GAAG,YAAY,GAAG,aAAa,GACtD;AACI,SAAK,IAAI,GACT,KAAK,IAAI,GACT,KAAK,QAAQ,WACb,KAAK,SAAS,YAEd,KAAK,OAAO,OAAO;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,QACA;AACW,WAAA,IAAI,QAAQ,KAAK,GAAG,KAAK,GAAG,KAAK,OAAO,KAAK,MAAM;AAAA,EAC9D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,SAAS,GAAW,GACpB;AACI,QAAI,KAAK,SAAS,KAAK,KAAK,UAAU;AAE3B,aAAA;AAIP,QAAA,SAAU,IAAI,KAAK,KAAK,KAAK,OAC7B,SAAU,IAAI,KAAK,KAAK,KAAK;AAEjC,WAAA,SAAS,OACT,SAAS,OAED,QAAQ,SAAS;AAAA,EAC7B;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,YACA;AACI,WAAO,IAAI,UAAU,KAAK,IAAI,KAAK,OAAO,KAAK,IAAI,KAAK,QAAQ,KAAK,OAAO,KAAK,MAAM;AAAA,EAC3F;AACJ;AAII,QAAQ,UAAU,WAAW,WAC7B;AACW,SAAA,yBAAyB,KAAK,CAAC,MAAM,KAAK,CAAC,UAAU,KAAK,KAAK,WAAW,KAAK,MAAM;AAChG;"}

View File

@@ -0,0 +1,49 @@
"use strict";
var _const = require("../const.js");
class Polygon {
/**
* @param {PIXI.IPointData[]|number[]} points - This can be an array of Points
* that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], or
* the arguments passed can be all the points of the polygon e.g.
* `new Polygon(new Point(), new Point(), ...)`, or the arguments passed can be flat
* x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are Numbers.
*/
constructor(...points) {
let flat = Array.isArray(points[0]) ? points[0] : points;
if (typeof flat[0] != "number") {
const p = [];
for (let i = 0, il = flat.length; i < il; i++)
p.push(flat[i].x, flat[i].y);
flat = p;
}
this.points = flat, this.type = _const.SHAPES.POLY, this.closeStroke = !0;
}
/**
* Creates a clone of this polygon.
* @returns - A copy of the polygon.
*/
clone() {
const points = this.points.slice(), polygon = new Polygon(points);
return polygon.closeStroke = this.closeStroke, polygon;
}
/**
* Checks whether the x and y coordinates passed to this function are contained within this polygon.
* @param x - The X coordinate of the point to test.
* @param y - The Y coordinate of the point to test.
* @returns - Whether the x/y coordinates are within this polygon.
*/
contains(x, y) {
let inside = !1;
const length = this.points.length / 2;
for (let i = 0, j = length - 1; i < length; j = i++) {
const xi = this.points[i * 2], yi = this.points[i * 2 + 1], xj = this.points[j * 2], yj = this.points[j * 2 + 1];
yi > y != yj > y && x < (xj - xi) * ((y - yi) / (yj - yi)) + xi && (inside = !inside);
}
return inside;
}
}
Polygon.prototype.toString = function() {
return `[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((pointsDesc, currentPoint) => `${pointsDesc}, ${currentPoint}`, "")}]`;
};
exports.Polygon = Polygon;
//# sourceMappingURL=Polygon.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Polygon.js","sources":["../../src/shapes/Polygon.ts"],"sourcesContent":["import { SHAPES } from '../const';\n\nimport type { IPointData } from '../IPointData';\n\n/**\n * A class to define a shape via user defined coordinates.\n * @memberof PIXI\n */\nexport class Polygon\n{\n /** An array of the points of this polygon. */\n public points: number[];\n\n /** `false` after moveTo, `true` after `closePath`. In all other cases it is `true`. */\n public closeStroke: boolean;\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n * @default PIXI.SHAPES.POLY\n * @see PIXI.SHAPES\n */\n public readonly type: SHAPES.POLY;\n\n constructor(points: IPointData[] | number[]);\n constructor(...points: IPointData[] | number[]);\n\n /**\n * @param {PIXI.IPointData[]|number[]} points - This can be an array of Points\n * that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], or\n * the arguments passed can be all the points of the polygon e.g.\n * `new Polygon(new Point(), new Point(), ...)`, or the arguments passed can be flat\n * x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are Numbers.\n */\n constructor(...points: any[])\n {\n let flat: IPointData[] | number[] = Array.isArray(points[0]) ? points[0] : points;\n\n // if this is an array of points, convert it to a flat array of numbers\n if (typeof flat[0] !== 'number')\n {\n const p: number[] = [];\n\n for (let i = 0, il = flat.length; i < il; i++)\n {\n p.push((flat[i] as IPointData).x, (flat[i] as IPointData).y);\n }\n\n flat = p;\n }\n\n this.points = flat as number[];\n this.type = SHAPES.POLY;\n this.closeStroke = true;\n }\n\n /**\n * Creates a clone of this polygon.\n * @returns - A copy of the polygon.\n */\n clone(): Polygon\n {\n const points = this.points.slice();\n const polygon = new Polygon(points);\n\n polygon.closeStroke = this.closeStroke;\n\n return polygon;\n }\n\n /**\n * Checks whether the x and y coordinates passed to this function are contained within this polygon.\n * @param x - The X coordinate of the point to test.\n * @param y - The Y coordinate of the point to test.\n * @returns - Whether the x/y coordinates are within this polygon.\n */\n contains(x: number, y: number): boolean\n {\n let inside = false;\n\n // use some raycasting to test hits\n // https://github.com/substack/point-in-polygon/blob/master/index.js\n const length = this.points.length / 2;\n\n for (let i = 0, j = length - 1; i < length; j = i++)\n {\n const xi = this.points[i * 2];\n const yi = this.points[(i * 2) + 1];\n const xj = this.points[j * 2];\n const yj = this.points[(j * 2) + 1];\n const intersect = ((yi > y) !== (yj > y)) && (x < ((xj - xi) * ((y - yi) / (yj - yi))) + xi);\n\n if (intersect)\n {\n inside = !inside;\n }\n }\n\n return inside;\n }\n}\n\nif (process.env.DEBUG)\n{\n Polygon.prototype.toString = function toString(): string\n {\n return `[@pixi/math:Polygon`\n + `closeStroke=${this.closeStroke}`\n + `points=${this.points.reduce((pointsDesc, currentPoint) => `${pointsDesc}, ${currentPoint}`, '')}]`;\n };\n}\n"],"names":["SHAPES"],"mappings":";;AAQO,MAAM,QACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAwBI,eAAe,QACf;AACQ,QAAA,OAAgC,MAAM,QAAQ,OAAO,CAAC,CAAC,IAAI,OAAO,CAAC,IAAI;AAG3E,QAAI,OAAO,KAAK,CAAC,KAAM,UACvB;AACI,YAAM,IAAc,CAAA;AAEpB,eAAS,IAAI,GAAG,KAAK,KAAK,QAAQ,IAAI,IAAI;AAEpC,UAAA,KAAM,KAAK,CAAC,EAAiB,GAAI,KAAK,CAAC,EAAiB,CAAC;AAGxD,aAAA;AAAA,IACX;AAEA,SAAK,SAAS,MACd,KAAK,OAAOA,cAAO,MACnB,KAAK,cAAc;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,QACA;AACU,UAAA,SAAS,KAAK,OAAO,SACrB,UAAU,IAAI,QAAQ,MAAM;AAE1B,WAAA,QAAA,cAAc,KAAK,aAEpB;AAAA,EACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,SAAS,GAAW,GACpB;AACI,QAAI,SAAS;AAIP,UAAA,SAAS,KAAK,OAAO,SAAS;AAE3B,aAAA,IAAI,GAAG,IAAI,SAAS,GAAG,IAAI,QAAQ,IAAI,KAChD;AACU,YAAA,KAAK,KAAK,OAAO,IAAI,CAAC,GACtB,KAAK,KAAK,OAAQ,IAAI,IAAK,CAAC,GAC5B,KAAK,KAAK,OAAO,IAAI,CAAC,GACtB,KAAK,KAAK,OAAQ,IAAI,IAAK,CAAC;AACd,WAAK,KAAQ,KAAK,KAAQ,KAAM,KAAK,QAAQ,IAAI,OAAO,KAAK,OAAQ,OAIrF,SAAS,CAAC;AAAA,IAElB;AAEO,WAAA;AAAA,EACX;AACJ;AAII,QAAQ,UAAU,WAAW,WAC7B;AACI,SAAO,kCACc,KAAK,WAAW,UACrB,KAAK,OAAO,OAAO,CAAC,YAAY,iBAAiB,GAAG,UAAU,KAAK,YAAY,IAAI,EAAE,CAAC;AAC1G;;"}

View File

@@ -0,0 +1,50 @@
import { SHAPES } from "../const.mjs";
class Polygon {
/**
* @param {PIXI.IPointData[]|number[]} points - This can be an array of Points
* that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], or
* the arguments passed can be all the points of the polygon e.g.
* `new Polygon(new Point(), new Point(), ...)`, or the arguments passed can be flat
* x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are Numbers.
*/
constructor(...points) {
let flat = Array.isArray(points[0]) ? points[0] : points;
if (typeof flat[0] != "number") {
const p = [];
for (let i = 0, il = flat.length; i < il; i++)
p.push(flat[i].x, flat[i].y);
flat = p;
}
this.points = flat, this.type = SHAPES.POLY, this.closeStroke = !0;
}
/**
* Creates a clone of this polygon.
* @returns - A copy of the polygon.
*/
clone() {
const points = this.points.slice(), polygon = new Polygon(points);
return polygon.closeStroke = this.closeStroke, polygon;
}
/**
* Checks whether the x and y coordinates passed to this function are contained within this polygon.
* @param x - The X coordinate of the point to test.
* @param y - The Y coordinate of the point to test.
* @returns - Whether the x/y coordinates are within this polygon.
*/
contains(x, y) {
let inside = !1;
const length = this.points.length / 2;
for (let i = 0, j = length - 1; i < length; j = i++) {
const xi = this.points[i * 2], yi = this.points[i * 2 + 1], xj = this.points[j * 2], yj = this.points[j * 2 + 1];
yi > y != yj > y && x < (xj - xi) * ((y - yi) / (yj - yi)) + xi && (inside = !inside);
}
return inside;
}
}
Polygon.prototype.toString = function() {
return `[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((pointsDesc, currentPoint) => `${pointsDesc}, ${currentPoint}`, "")}]`;
};
export {
Polygon
};
//# sourceMappingURL=Polygon.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Polygon.mjs","sources":["../../src/shapes/Polygon.ts"],"sourcesContent":["import { SHAPES } from '../const';\n\nimport type { IPointData } from '../IPointData';\n\n/**\n * A class to define a shape via user defined coordinates.\n * @memberof PIXI\n */\nexport class Polygon\n{\n /** An array of the points of this polygon. */\n public points: number[];\n\n /** `false` after moveTo, `true` after `closePath`. In all other cases it is `true`. */\n public closeStroke: boolean;\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n * @default PIXI.SHAPES.POLY\n * @see PIXI.SHAPES\n */\n public readonly type: SHAPES.POLY;\n\n constructor(points: IPointData[] | number[]);\n constructor(...points: IPointData[] | number[]);\n\n /**\n * @param {PIXI.IPointData[]|number[]} points - This can be an array of Points\n * that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], or\n * the arguments passed can be all the points of the polygon e.g.\n * `new Polygon(new Point(), new Point(), ...)`, or the arguments passed can be flat\n * x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are Numbers.\n */\n constructor(...points: any[])\n {\n let flat: IPointData[] | number[] = Array.isArray(points[0]) ? points[0] : points;\n\n // if this is an array of points, convert it to a flat array of numbers\n if (typeof flat[0] !== 'number')\n {\n const p: number[] = [];\n\n for (let i = 0, il = flat.length; i < il; i++)\n {\n p.push((flat[i] as IPointData).x, (flat[i] as IPointData).y);\n }\n\n flat = p;\n }\n\n this.points = flat as number[];\n this.type = SHAPES.POLY;\n this.closeStroke = true;\n }\n\n /**\n * Creates a clone of this polygon.\n * @returns - A copy of the polygon.\n */\n clone(): Polygon\n {\n const points = this.points.slice();\n const polygon = new Polygon(points);\n\n polygon.closeStroke = this.closeStroke;\n\n return polygon;\n }\n\n /**\n * Checks whether the x and y coordinates passed to this function are contained within this polygon.\n * @param x - The X coordinate of the point to test.\n * @param y - The Y coordinate of the point to test.\n * @returns - Whether the x/y coordinates are within this polygon.\n */\n contains(x: number, y: number): boolean\n {\n let inside = false;\n\n // use some raycasting to test hits\n // https://github.com/substack/point-in-polygon/blob/master/index.js\n const length = this.points.length / 2;\n\n for (let i = 0, j = length - 1; i < length; j = i++)\n {\n const xi = this.points[i * 2];\n const yi = this.points[(i * 2) + 1];\n const xj = this.points[j * 2];\n const yj = this.points[(j * 2) + 1];\n const intersect = ((yi > y) !== (yj > y)) && (x < ((xj - xi) * ((y - yi) / (yj - yi))) + xi);\n\n if (intersect)\n {\n inside = !inside;\n }\n }\n\n return inside;\n }\n}\n\nif (process.env.DEBUG)\n{\n Polygon.prototype.toString = function toString(): string\n {\n return `[@pixi/math:Polygon`\n + `closeStroke=${this.closeStroke}`\n + `points=${this.points.reduce((pointsDesc, currentPoint) => `${pointsDesc}, ${currentPoint}`, '')}]`;\n };\n}\n"],"names":[],"mappings":";AAQO,MAAM,QACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAwBI,eAAe,QACf;AACQ,QAAA,OAAgC,MAAM,QAAQ,OAAO,CAAC,CAAC,IAAI,OAAO,CAAC,IAAI;AAG3E,QAAI,OAAO,KAAK,CAAC,KAAM,UACvB;AACI,YAAM,IAAc,CAAA;AAEpB,eAAS,IAAI,GAAG,KAAK,KAAK,QAAQ,IAAI,IAAI;AAEpC,UAAA,KAAM,KAAK,CAAC,EAAiB,GAAI,KAAK,CAAC,EAAiB,CAAC;AAGxD,aAAA;AAAA,IACX;AAEA,SAAK,SAAS,MACd,KAAK,OAAO,OAAO,MACnB,KAAK,cAAc;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,QACA;AACU,UAAA,SAAS,KAAK,OAAO,SACrB,UAAU,IAAI,QAAQ,MAAM;AAE1B,WAAA,QAAA,cAAc,KAAK,aAEpB;AAAA,EACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,SAAS,GAAW,GACpB;AACI,QAAI,SAAS;AAIP,UAAA,SAAS,KAAK,OAAO,SAAS;AAE3B,aAAA,IAAI,GAAG,IAAI,SAAS,GAAG,IAAI,QAAQ,IAAI,KAChD;AACU,YAAA,KAAK,KAAK,OAAO,IAAI,CAAC,GACtB,KAAK,KAAK,OAAQ,IAAI,IAAK,CAAC,GAC5B,KAAK,KAAK,OAAO,IAAI,CAAC,GACtB,KAAK,KAAK,OAAQ,IAAI,IAAK,CAAC;AACd,WAAK,KAAQ,KAAK,KAAQ,KAAM,KAAK,QAAQ,IAAI,OAAO,KAAK,OAAQ,OAIrF,SAAS,CAAC;AAAA,IAElB;AAEO,WAAA;AAAA,EACX;AACJ;AAII,QAAQ,UAAU,WAAW,WAC7B;AACI,SAAO,kCACc,KAAK,WAAW,UACrB,KAAK,OAAO,OAAO,CAAC,YAAY,iBAAiB,GAAG,UAAU,KAAK,YAAY,IAAI,EAAE,CAAC;AAC1G;"}

View File

@@ -0,0 +1,141 @@
"use strict";
var _const = require("../const.js"), Point = require("../Point.js");
const tempPoints = [new Point.Point(), new Point.Point(), new Point.Point(), new Point.Point()];
class Rectangle {
/**
* @param x - The X coordinate of the upper-left corner of the rectangle
* @param y - The Y coordinate of the upper-left corner of the rectangle
* @param width - The overall width of the rectangle
* @param height - The overall height of the rectangle
*/
constructor(x = 0, y = 0, width = 0, height = 0) {
this.x = Number(x), this.y = Number(y), this.width = Number(width), this.height = Number(height), this.type = _const.SHAPES.RECT;
}
/** Returns the left edge of the rectangle. */
get left() {
return this.x;
}
/** Returns the right edge of the rectangle. */
get right() {
return this.x + this.width;
}
/** Returns the top edge of the rectangle. */
get top() {
return this.y;
}
/** Returns the bottom edge of the rectangle. */
get bottom() {
return this.y + this.height;
}
/** A constant empty rectangle. */
static get EMPTY() {
return new Rectangle(0, 0, 0, 0);
}
/**
* Creates a clone of this Rectangle
* @returns a copy of the rectangle
*/
clone() {
return new Rectangle(this.x, this.y, this.width, this.height);
}
/**
* Copies another rectangle to this one.
* @param rectangle - The rectangle to copy from.
* @returns Returns itself.
*/
copyFrom(rectangle) {
return this.x = rectangle.x, this.y = rectangle.y, this.width = rectangle.width, this.height = rectangle.height, this;
}
/**
* Copies this rectangle to another one.
* @param rectangle - The rectangle to copy to.
* @returns Returns given parameter.
*/
copyTo(rectangle) {
return rectangle.x = this.x, rectangle.y = this.y, rectangle.width = this.width, rectangle.height = this.height, rectangle;
}
/**
* Checks whether the x and y coordinates given are contained within this Rectangle
* @param x - The X coordinate of the point to test
* @param y - The Y coordinate of the point to test
* @returns Whether the x/y coordinates are within this Rectangle
*/
contains(x, y) {
return this.width <= 0 || this.height <= 0 ? !1 : x >= this.x && x < this.x + this.width && y >= this.y && y < this.y + this.height;
}
/**
* Determines whether the `other` Rectangle transformed by `transform` intersects with `this` Rectangle object.
* Returns true only if the area of the intersection is >0, this means that Rectangles
* sharing a side are not overlapping. Another side effect is that an arealess rectangle
* (width or height equal to zero) can't intersect any other rectangle.
* @param {Rectangle} other - The Rectangle to intersect with `this`.
* @param {Matrix} transform - The transformation matrix of `other`.
* @returns {boolean} A value of `true` if the transformed `other` Rectangle intersects with `this`; otherwise `false`.
*/
intersects(other, transform) {
if (!transform) {
const x02 = this.x < other.x ? other.x : this.x;
if ((this.right > other.right ? other.right : this.right) <= x02)
return !1;
const y02 = this.y < other.y ? other.y : this.y;
return (this.bottom > other.bottom ? other.bottom : this.bottom) > y02;
}
const x0 = this.left, x1 = this.right, y0 = this.top, y1 = this.bottom;
if (x1 <= x0 || y1 <= y0)
return !1;
const lt = tempPoints[0].set(other.left, other.top), lb = tempPoints[1].set(other.left, other.bottom), rt = tempPoints[2].set(other.right, other.top), rb = tempPoints[3].set(other.right, other.bottom);
if (rt.x <= lt.x || lb.y <= lt.y)
return !1;
const s = Math.sign(transform.a * transform.d - transform.b * transform.c);
if (s === 0 || (transform.apply(lt, lt), transform.apply(lb, lb), transform.apply(rt, rt), transform.apply(rb, rb), Math.max(lt.x, lb.x, rt.x, rb.x) <= x0 || Math.min(lt.x, lb.x, rt.x, rb.x) >= x1 || Math.max(lt.y, lb.y, rt.y, rb.y) <= y0 || Math.min(lt.y, lb.y, rt.y, rb.y) >= y1))
return !1;
const nx = s * (lb.y - lt.y), ny = s * (lt.x - lb.x), n00 = nx * x0 + ny * y0, n10 = nx * x1 + ny * y0, n01 = nx * x0 + ny * y1, n11 = nx * x1 + ny * y1;
if (Math.max(n00, n10, n01, n11) <= nx * lt.x + ny * lt.y || Math.min(n00, n10, n01, n11) >= nx * rb.x + ny * rb.y)
return !1;
const mx = s * (lt.y - rt.y), my = s * (rt.x - lt.x), m00 = mx * x0 + my * y0, m10 = mx * x1 + my * y0, m01 = mx * x0 + my * y1, m11 = mx * x1 + my * y1;
return !(Math.max(m00, m10, m01, m11) <= mx * lt.x + my * lt.y || Math.min(m00, m10, m01, m11) >= mx * rb.x + my * rb.y);
}
/**
* Pads the rectangle making it grow in all directions.
* If paddingY is omitted, both paddingX and paddingY will be set to paddingX.
* @param paddingX - The horizontal padding amount.
* @param paddingY - The vertical padding amount.
* @returns Returns itself.
*/
pad(paddingX = 0, paddingY = paddingX) {
return this.x -= paddingX, this.y -= paddingY, this.width += paddingX * 2, this.height += paddingY * 2, this;
}
/**
* Fits this rectangle around the passed one.
* @param rectangle - The rectangle to fit.
* @returns Returns itself.
*/
fit(rectangle) {
const x1 = Math.max(this.x, rectangle.x), x2 = Math.min(this.x + this.width, rectangle.x + rectangle.width), y1 = Math.max(this.y, rectangle.y), y2 = Math.min(this.y + this.height, rectangle.y + rectangle.height);
return this.x = x1, this.width = Math.max(x2 - x1, 0), this.y = y1, this.height = Math.max(y2 - y1, 0), this;
}
/**
* Enlarges rectangle that way its corners lie on grid
* @param resolution - resolution
* @param eps - precision
* @returns Returns itself.
*/
ceil(resolution = 1, eps = 1e-3) {
const x2 = Math.ceil((this.x + this.width - eps) * resolution) / resolution, y2 = Math.ceil((this.y + this.height - eps) * resolution) / resolution;
return this.x = Math.floor((this.x + eps) * resolution) / resolution, this.y = Math.floor((this.y + eps) * resolution) / resolution, this.width = x2 - this.x, this.height = y2 - this.y, this;
}
/**
* Enlarges this rectangle to include the passed rectangle.
* @param rectangle - The rectangle to include.
* @returns Returns itself.
*/
enlarge(rectangle) {
const x1 = Math.min(this.x, rectangle.x), x2 = Math.max(this.x + this.width, rectangle.x + rectangle.width), y1 = Math.min(this.y, rectangle.y), y2 = Math.max(this.y + this.height, rectangle.y + rectangle.height);
return this.x = x1, this.width = x2 - x1, this.y = y1, this.height = y2 - y1, this;
}
}
Rectangle.prototype.toString = function() {
return `[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`;
};
exports.Rectangle = Rectangle;
//# sourceMappingURL=Rectangle.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,143 @@
import { SHAPES } from "../const.mjs";
import { Point } from "../Point.mjs";
const tempPoints = [new Point(), new Point(), new Point(), new Point()];
class Rectangle {
/**
* @param x - The X coordinate of the upper-left corner of the rectangle
* @param y - The Y coordinate of the upper-left corner of the rectangle
* @param width - The overall width of the rectangle
* @param height - The overall height of the rectangle
*/
constructor(x = 0, y = 0, width = 0, height = 0) {
this.x = Number(x), this.y = Number(y), this.width = Number(width), this.height = Number(height), this.type = SHAPES.RECT;
}
/** Returns the left edge of the rectangle. */
get left() {
return this.x;
}
/** Returns the right edge of the rectangle. */
get right() {
return this.x + this.width;
}
/** Returns the top edge of the rectangle. */
get top() {
return this.y;
}
/** Returns the bottom edge of the rectangle. */
get bottom() {
return this.y + this.height;
}
/** A constant empty rectangle. */
static get EMPTY() {
return new Rectangle(0, 0, 0, 0);
}
/**
* Creates a clone of this Rectangle
* @returns a copy of the rectangle
*/
clone() {
return new Rectangle(this.x, this.y, this.width, this.height);
}
/**
* Copies another rectangle to this one.
* @param rectangle - The rectangle to copy from.
* @returns Returns itself.
*/
copyFrom(rectangle) {
return this.x = rectangle.x, this.y = rectangle.y, this.width = rectangle.width, this.height = rectangle.height, this;
}
/**
* Copies this rectangle to another one.
* @param rectangle - The rectangle to copy to.
* @returns Returns given parameter.
*/
copyTo(rectangle) {
return rectangle.x = this.x, rectangle.y = this.y, rectangle.width = this.width, rectangle.height = this.height, rectangle;
}
/**
* Checks whether the x and y coordinates given are contained within this Rectangle
* @param x - The X coordinate of the point to test
* @param y - The Y coordinate of the point to test
* @returns Whether the x/y coordinates are within this Rectangle
*/
contains(x, y) {
return this.width <= 0 || this.height <= 0 ? !1 : x >= this.x && x < this.x + this.width && y >= this.y && y < this.y + this.height;
}
/**
* Determines whether the `other` Rectangle transformed by `transform` intersects with `this` Rectangle object.
* Returns true only if the area of the intersection is >0, this means that Rectangles
* sharing a side are not overlapping. Another side effect is that an arealess rectangle
* (width or height equal to zero) can't intersect any other rectangle.
* @param {Rectangle} other - The Rectangle to intersect with `this`.
* @param {Matrix} transform - The transformation matrix of `other`.
* @returns {boolean} A value of `true` if the transformed `other` Rectangle intersects with `this`; otherwise `false`.
*/
intersects(other, transform) {
if (!transform) {
const x02 = this.x < other.x ? other.x : this.x;
if ((this.right > other.right ? other.right : this.right) <= x02)
return !1;
const y02 = this.y < other.y ? other.y : this.y;
return (this.bottom > other.bottom ? other.bottom : this.bottom) > y02;
}
const x0 = this.left, x1 = this.right, y0 = this.top, y1 = this.bottom;
if (x1 <= x0 || y1 <= y0)
return !1;
const lt = tempPoints[0].set(other.left, other.top), lb = tempPoints[1].set(other.left, other.bottom), rt = tempPoints[2].set(other.right, other.top), rb = tempPoints[3].set(other.right, other.bottom);
if (rt.x <= lt.x || lb.y <= lt.y)
return !1;
const s = Math.sign(transform.a * transform.d - transform.b * transform.c);
if (s === 0 || (transform.apply(lt, lt), transform.apply(lb, lb), transform.apply(rt, rt), transform.apply(rb, rb), Math.max(lt.x, lb.x, rt.x, rb.x) <= x0 || Math.min(lt.x, lb.x, rt.x, rb.x) >= x1 || Math.max(lt.y, lb.y, rt.y, rb.y) <= y0 || Math.min(lt.y, lb.y, rt.y, rb.y) >= y1))
return !1;
const nx = s * (lb.y - lt.y), ny = s * (lt.x - lb.x), n00 = nx * x0 + ny * y0, n10 = nx * x1 + ny * y0, n01 = nx * x0 + ny * y1, n11 = nx * x1 + ny * y1;
if (Math.max(n00, n10, n01, n11) <= nx * lt.x + ny * lt.y || Math.min(n00, n10, n01, n11) >= nx * rb.x + ny * rb.y)
return !1;
const mx = s * (lt.y - rt.y), my = s * (rt.x - lt.x), m00 = mx * x0 + my * y0, m10 = mx * x1 + my * y0, m01 = mx * x0 + my * y1, m11 = mx * x1 + my * y1;
return !(Math.max(m00, m10, m01, m11) <= mx * lt.x + my * lt.y || Math.min(m00, m10, m01, m11) >= mx * rb.x + my * rb.y);
}
/**
* Pads the rectangle making it grow in all directions.
* If paddingY is omitted, both paddingX and paddingY will be set to paddingX.
* @param paddingX - The horizontal padding amount.
* @param paddingY - The vertical padding amount.
* @returns Returns itself.
*/
pad(paddingX = 0, paddingY = paddingX) {
return this.x -= paddingX, this.y -= paddingY, this.width += paddingX * 2, this.height += paddingY * 2, this;
}
/**
* Fits this rectangle around the passed one.
* @param rectangle - The rectangle to fit.
* @returns Returns itself.
*/
fit(rectangle) {
const x1 = Math.max(this.x, rectangle.x), x2 = Math.min(this.x + this.width, rectangle.x + rectangle.width), y1 = Math.max(this.y, rectangle.y), y2 = Math.min(this.y + this.height, rectangle.y + rectangle.height);
return this.x = x1, this.width = Math.max(x2 - x1, 0), this.y = y1, this.height = Math.max(y2 - y1, 0), this;
}
/**
* Enlarges rectangle that way its corners lie on grid
* @param resolution - resolution
* @param eps - precision
* @returns Returns itself.
*/
ceil(resolution = 1, eps = 1e-3) {
const x2 = Math.ceil((this.x + this.width - eps) * resolution) / resolution, y2 = Math.ceil((this.y + this.height - eps) * resolution) / resolution;
return this.x = Math.floor((this.x + eps) * resolution) / resolution, this.y = Math.floor((this.y + eps) * resolution) / resolution, this.width = x2 - this.x, this.height = y2 - this.y, this;
}
/**
* Enlarges this rectangle to include the passed rectangle.
* @param rectangle - The rectangle to include.
* @returns Returns itself.
*/
enlarge(rectangle) {
const x1 = Math.min(this.x, rectangle.x), x2 = Math.max(this.x + this.width, rectangle.x + rectangle.width), y1 = Math.min(this.y, rectangle.y), y2 = Math.max(this.y + this.height, rectangle.y + rectangle.height);
return this.x = x1, this.width = x2 - x1, this.y = y1, this.height = y2 - y1, this;
}
}
Rectangle.prototype.toString = function() {
return `[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`;
};
export {
Rectangle
};
//# sourceMappingURL=Rectangle.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,46 @@
"use strict";
var _const = require("../const.js");
class RoundedRectangle {
/**
* @param x - The X coordinate of the upper-left corner of the rounded rectangle
* @param y - The Y coordinate of the upper-left corner of the rounded rectangle
* @param width - The overall width of this rounded rectangle
* @param height - The overall height of this rounded rectangle
* @param radius - Controls the radius of the rounded corners
*/
constructor(x = 0, y = 0, width = 0, height = 0, radius = 20) {
this.x = x, this.y = y, this.width = width, this.height = height, this.radius = radius, this.type = _const.SHAPES.RREC;
}
/**
* Creates a clone of this Rounded Rectangle.
* @returns - A copy of the rounded rectangle.
*/
clone() {
return new RoundedRectangle(this.x, this.y, this.width, this.height, this.radius);
}
/**
* Checks whether the x and y coordinates given are contained within this Rounded Rectangle
* @param x - The X coordinate of the point to test.
* @param y - The Y coordinate of the point to test.
* @returns - Whether the x/y coordinates are within this Rounded Rectangle.
*/
contains(x, y) {
if (this.width <= 0 || this.height <= 0)
return !1;
if (x >= this.x && x <= this.x + this.width && y >= this.y && y <= this.y + this.height) {
const radius = Math.max(0, Math.min(this.radius, Math.min(this.width, this.height) / 2));
if (y >= this.y + radius && y <= this.y + this.height - radius || x >= this.x + radius && x <= this.x + this.width - radius)
return !0;
let dx = x - (this.x + radius), dy = y - (this.y + radius);
const radius2 = radius * radius;
if (dx * dx + dy * dy <= radius2 || (dx = x - (this.x + this.width - radius), dx * dx + dy * dy <= radius2) || (dy = y - (this.y + this.height - radius), dx * dx + dy * dy <= radius2) || (dx = x - (this.x + radius), dx * dx + dy * dy <= radius2))
return !0;
}
return !1;
}
}
RoundedRectangle.prototype.toString = function() {
return `[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`;
};
exports.RoundedRectangle = RoundedRectangle;
//# sourceMappingURL=RoundedRectangle.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,47 @@
import { SHAPES } from "../const.mjs";
class RoundedRectangle {
/**
* @param x - The X coordinate of the upper-left corner of the rounded rectangle
* @param y - The Y coordinate of the upper-left corner of the rounded rectangle
* @param width - The overall width of this rounded rectangle
* @param height - The overall height of this rounded rectangle
* @param radius - Controls the radius of the rounded corners
*/
constructor(x = 0, y = 0, width = 0, height = 0, radius = 20) {
this.x = x, this.y = y, this.width = width, this.height = height, this.radius = radius, this.type = SHAPES.RREC;
}
/**
* Creates a clone of this Rounded Rectangle.
* @returns - A copy of the rounded rectangle.
*/
clone() {
return new RoundedRectangle(this.x, this.y, this.width, this.height, this.radius);
}
/**
* Checks whether the x and y coordinates given are contained within this Rounded Rectangle
* @param x - The X coordinate of the point to test.
* @param y - The Y coordinate of the point to test.
* @returns - Whether the x/y coordinates are within this Rounded Rectangle.
*/
contains(x, y) {
if (this.width <= 0 || this.height <= 0)
return !1;
if (x >= this.x && x <= this.x + this.width && y >= this.y && y <= this.y + this.height) {
const radius = Math.max(0, Math.min(this.radius, Math.min(this.width, this.height) / 2));
if (y >= this.y + radius && y <= this.y + this.height - radius || x >= this.x + radius && x <= this.x + this.width - radius)
return !0;
let dx = x - (this.x + radius), dy = y - (this.y + radius);
const radius2 = radius * radius;
if (dx * dx + dy * dy <= radius2 || (dx = x - (this.x + this.width - radius), dx * dx + dy * dy <= radius2) || (dy = y - (this.y + this.height - radius), dx * dx + dy * dy <= radius2) || (dx = x - (this.x + radius), dx * dx + dy * dy <= radius2))
return !0;
}
return !1;
}
}
RoundedRectangle.prototype.toString = function() {
return `[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`;
};
export {
RoundedRectangle
};
//# sourceMappingURL=RoundedRectangle.mjs.map

File diff suppressed because one or more lines are too long

34
resources/app/node_modules/@pixi/math/package.json generated vendored Normal file
View File

@@ -0,0 +1,34 @@
{
"name": "@pixi/math",
"version": "7.4.2",
"main": "lib/index.js",
"module": "lib/index.mjs",
"types": "lib/index.d.ts",
"exports": {
".": {
"import": {
"types": "./lib/index.d.ts",
"default": "./lib/index.mjs"
},
"require": {
"types": "./lib/index.d.ts",
"default": "./lib/index.js"
}
}
},
"description": "Collection of math utilities",
"author": "Mat Groves",
"homepage": "http://pixijs.com/",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/pixijs/pixijs.git"
},
"publishConfig": {
"access": "public"
},
"files": [
"lib",
"*.d.ts"
]
}