Initial
This commit is contained in:
60
resources/app/node_modules/@pixi/graphics/lib/utils/ArcUtils.js
generated
vendored
Normal file
60
resources/app/node_modules/@pixi/graphics/lib/utils/ArcUtils.js
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
"use strict";
|
||||
var core = require("@pixi/core"), _const = require("../const.js");
|
||||
class ArcUtils {
|
||||
/**
|
||||
* Calculate information of the arc for {@link PIXI.Graphics.arcTo}.
|
||||
* @private
|
||||
* @param x1 - The x-coordinate of the first control point of the arc
|
||||
* @param y1 - The y-coordinate of the first control point of the arc
|
||||
* @param x2 - The x-coordinate of the second control point of the arc
|
||||
* @param y2 - The y-coordinate of the second control point of the arc
|
||||
* @param radius - The radius of the arc
|
||||
* @param points - Collection of points to add to
|
||||
* @returns - If the arc length is valid, return center of circle, radius and other info otherwise `null`.
|
||||
*/
|
||||
static curveTo(x1, y1, x2, y2, radius, points) {
|
||||
const fromX = points[points.length - 2], a1 = points[points.length - 1] - y1, b1 = fromX - x1, a2 = y2 - y1, b2 = x2 - x1, mm = Math.abs(a1 * b2 - b1 * a2);
|
||||
if (mm < 1e-8 || radius === 0)
|
||||
return (points[points.length - 2] !== x1 || points[points.length - 1] !== y1) && points.push(x1, y1), null;
|
||||
const dd = a1 * a1 + b1 * b1, cc = a2 * a2 + b2 * b2, tt = a1 * a2 + b1 * b2, k1 = radius * Math.sqrt(dd) / mm, k2 = radius * Math.sqrt(cc) / mm, j1 = k1 * tt / dd, j2 = k2 * tt / cc, cx = k1 * b2 + k2 * b1, cy = k1 * a2 + k2 * a1, px = b1 * (k2 + j1), py = a1 * (k2 + j1), qx = b2 * (k1 + j2), qy = a2 * (k1 + j2), startAngle = Math.atan2(py - cy, px - cx), endAngle = Math.atan2(qy - cy, qx - cx);
|
||||
return {
|
||||
cx: cx + x1,
|
||||
cy: cy + y1,
|
||||
radius,
|
||||
startAngle,
|
||||
endAngle,
|
||||
anticlockwise: b1 * a2 > b2 * a1
|
||||
};
|
||||
}
|
||||
/**
|
||||
* The arc method creates an arc/curve (used to create circles, or parts of circles).
|
||||
* @private
|
||||
* @param _startX - Start x location of arc
|
||||
* @param _startY - Start y location of arc
|
||||
* @param cx - The x-coordinate of the center of the circle
|
||||
* @param cy - The y-coordinate of the center of the circle
|
||||
* @param radius - The radius of the circle
|
||||
* @param startAngle - The starting angle, in radians (0 is at the 3 o'clock position
|
||||
* of the arc's circle)
|
||||
* @param endAngle - The ending angle, in radians
|
||||
* @param _anticlockwise - Specifies whether the drawing should be
|
||||
* counter-clockwise or clockwise. False is default, and indicates clockwise, while true
|
||||
* indicates counter-clockwise.
|
||||
* @param points - Collection of points to add to
|
||||
*/
|
||||
static arc(_startX, _startY, cx, cy, radius, startAngle, endAngle, _anticlockwise, points) {
|
||||
const sweep = endAngle - startAngle, n = _const.curves._segmentsCount(
|
||||
Math.abs(sweep) * radius,
|
||||
Math.ceil(Math.abs(sweep) / core.PI_2) * 40
|
||||
), theta = sweep / (n * 2), theta2 = theta * 2, cTheta = Math.cos(theta), sTheta = Math.sin(theta), segMinus = n - 1, remainder = segMinus % 1 / segMinus;
|
||||
for (let i = 0; i <= segMinus; ++i) {
|
||||
const real = i + remainder * i, angle = theta + startAngle + theta2 * real, c = Math.cos(angle), s = -Math.sin(angle);
|
||||
points.push(
|
||||
(cTheta * c + sTheta * s) * radius + cx,
|
||||
(cTheta * -s + sTheta * c) * radius + cy
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.ArcUtils = ArcUtils;
|
||||
//# sourceMappingURL=ArcUtils.js.map
|
||||
1
resources/app/node_modules/@pixi/graphics/lib/utils/ArcUtils.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/graphics/lib/utils/ArcUtils.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
62
resources/app/node_modules/@pixi/graphics/lib/utils/ArcUtils.mjs
generated
vendored
Normal file
62
resources/app/node_modules/@pixi/graphics/lib/utils/ArcUtils.mjs
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
import { PI_2 } from "@pixi/core";
|
||||
import { curves } from "../const.mjs";
|
||||
class ArcUtils {
|
||||
/**
|
||||
* Calculate information of the arc for {@link PIXI.Graphics.arcTo}.
|
||||
* @private
|
||||
* @param x1 - The x-coordinate of the first control point of the arc
|
||||
* @param y1 - The y-coordinate of the first control point of the arc
|
||||
* @param x2 - The x-coordinate of the second control point of the arc
|
||||
* @param y2 - The y-coordinate of the second control point of the arc
|
||||
* @param radius - The radius of the arc
|
||||
* @param points - Collection of points to add to
|
||||
* @returns - If the arc length is valid, return center of circle, radius and other info otherwise `null`.
|
||||
*/
|
||||
static curveTo(x1, y1, x2, y2, radius, points) {
|
||||
const fromX = points[points.length - 2], a1 = points[points.length - 1] - y1, b1 = fromX - x1, a2 = y2 - y1, b2 = x2 - x1, mm = Math.abs(a1 * b2 - b1 * a2);
|
||||
if (mm < 1e-8 || radius === 0)
|
||||
return (points[points.length - 2] !== x1 || points[points.length - 1] !== y1) && points.push(x1, y1), null;
|
||||
const dd = a1 * a1 + b1 * b1, cc = a2 * a2 + b2 * b2, tt = a1 * a2 + b1 * b2, k1 = radius * Math.sqrt(dd) / mm, k2 = radius * Math.sqrt(cc) / mm, j1 = k1 * tt / dd, j2 = k2 * tt / cc, cx = k1 * b2 + k2 * b1, cy = k1 * a2 + k2 * a1, px = b1 * (k2 + j1), py = a1 * (k2 + j1), qx = b2 * (k1 + j2), qy = a2 * (k1 + j2), startAngle = Math.atan2(py - cy, px - cx), endAngle = Math.atan2(qy - cy, qx - cx);
|
||||
return {
|
||||
cx: cx + x1,
|
||||
cy: cy + y1,
|
||||
radius,
|
||||
startAngle,
|
||||
endAngle,
|
||||
anticlockwise: b1 * a2 > b2 * a1
|
||||
};
|
||||
}
|
||||
/**
|
||||
* The arc method creates an arc/curve (used to create circles, or parts of circles).
|
||||
* @private
|
||||
* @param _startX - Start x location of arc
|
||||
* @param _startY - Start y location of arc
|
||||
* @param cx - The x-coordinate of the center of the circle
|
||||
* @param cy - The y-coordinate of the center of the circle
|
||||
* @param radius - The radius of the circle
|
||||
* @param startAngle - The starting angle, in radians (0 is at the 3 o'clock position
|
||||
* of the arc's circle)
|
||||
* @param endAngle - The ending angle, in radians
|
||||
* @param _anticlockwise - Specifies whether the drawing should be
|
||||
* counter-clockwise or clockwise. False is default, and indicates clockwise, while true
|
||||
* indicates counter-clockwise.
|
||||
* @param points - Collection of points to add to
|
||||
*/
|
||||
static arc(_startX, _startY, cx, cy, radius, startAngle, endAngle, _anticlockwise, points) {
|
||||
const sweep = endAngle - startAngle, n = curves._segmentsCount(
|
||||
Math.abs(sweep) * radius,
|
||||
Math.ceil(Math.abs(sweep) / PI_2) * 40
|
||||
), theta = sweep / (n * 2), theta2 = theta * 2, cTheta = Math.cos(theta), sTheta = Math.sin(theta), segMinus = n - 1, remainder = segMinus % 1 / segMinus;
|
||||
for (let i = 0; i <= segMinus; ++i) {
|
||||
const real = i + remainder * i, angle = theta + startAngle + theta2 * real, c = Math.cos(angle), s = -Math.sin(angle);
|
||||
points.push(
|
||||
(cTheta * c + sTheta * s) * radius + cx,
|
||||
(cTheta * -s + sTheta * c) * radius + cy
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
export {
|
||||
ArcUtils
|
||||
};
|
||||
//# sourceMappingURL=ArcUtils.mjs.map
|
||||
1
resources/app/node_modules/@pixi/graphics/lib/utils/ArcUtils.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/graphics/lib/utils/ArcUtils.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
28
resources/app/node_modules/@pixi/graphics/lib/utils/BatchPart.js
generated
vendored
Normal file
28
resources/app/node_modules/@pixi/graphics/lib/utils/BatchPart.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
class BatchPart {
|
||||
constructor() {
|
||||
this.reset();
|
||||
}
|
||||
/**
|
||||
* Begin batch part.
|
||||
* @param style
|
||||
* @param startIndex
|
||||
* @param attribStart
|
||||
*/
|
||||
begin(style, startIndex, attribStart) {
|
||||
this.reset(), this.style = style, this.start = startIndex, this.attribStart = attribStart;
|
||||
}
|
||||
/**
|
||||
* End batch part.
|
||||
* @param endIndex
|
||||
* @param endAttrib
|
||||
*/
|
||||
end(endIndex, endAttrib) {
|
||||
this.attribSize = endAttrib - this.attribStart, this.size = endIndex - this.start;
|
||||
}
|
||||
reset() {
|
||||
this.style = null, this.size = 0, this.start = 0, this.attribStart = 0, this.attribSize = 0;
|
||||
}
|
||||
}
|
||||
exports.BatchPart = BatchPart;
|
||||
//# sourceMappingURL=BatchPart.js.map
|
||||
1
resources/app/node_modules/@pixi/graphics/lib/utils/BatchPart.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/graphics/lib/utils/BatchPart.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"BatchPart.js","sources":["../../src/utils/BatchPart.ts"],"sourcesContent":["import type { FillStyle } from '../styles/FillStyle';\nimport type { LineStyle } from '../styles/LineStyle';\n\n/**\n * A structure to hold interim batch objects for Graphics.\n * @memberof PIXI.graphicsUtils\n */\nexport class BatchPart\n{\n public style: LineStyle | FillStyle;\n public start: number;\n public size: number;\n public attribStart: number;\n public attribSize: number;\n\n constructor()\n {\n this.reset();\n }\n\n /**\n * Begin batch part.\n * @param style\n * @param startIndex\n * @param attribStart\n */\n public begin(style: LineStyle | FillStyle, startIndex: number, attribStart: number): void\n {\n this.reset();\n this.style = style;\n this.start = startIndex;\n this.attribStart = attribStart;\n }\n\n /**\n * End batch part.\n * @param endIndex\n * @param endAttrib\n */\n public end(endIndex: number, endAttrib: number): void\n {\n this.attribSize = endAttrib - this.attribStart;\n this.size = endIndex - this.start;\n }\n\n public reset(): void\n {\n this.style = null;\n this.size = 0;\n this.start = 0;\n this.attribStart = 0;\n this.attribSize = 0;\n }\n}\n"],"names":[],"mappings":";AAOO,MAAM,UACb;AAAA,EAOI,cACA;AACI,SAAK,MAAM;AAAA,EACf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQO,MAAM,OAA8B,YAAoB,aAC/D;AACS,SAAA,MAAA,GACL,KAAK,QAAQ,OACb,KAAK,QAAQ,YACb,KAAK,cAAc;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,IAAI,UAAkB,WAC7B;AACI,SAAK,aAAa,YAAY,KAAK,aACnC,KAAK,OAAO,WAAW,KAAK;AAAA,EAChC;AAAA,EAEO,QACP;AACI,SAAK,QAAQ,MACb,KAAK,OAAO,GACZ,KAAK,QAAQ,GACb,KAAK,cAAc,GACnB,KAAK,aAAa;AAAA,EACtB;AACJ;;"}
|
||||
29
resources/app/node_modules/@pixi/graphics/lib/utils/BatchPart.mjs
generated
vendored
Normal file
29
resources/app/node_modules/@pixi/graphics/lib/utils/BatchPart.mjs
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
class BatchPart {
|
||||
constructor() {
|
||||
this.reset();
|
||||
}
|
||||
/**
|
||||
* Begin batch part.
|
||||
* @param style
|
||||
* @param startIndex
|
||||
* @param attribStart
|
||||
*/
|
||||
begin(style, startIndex, attribStart) {
|
||||
this.reset(), this.style = style, this.start = startIndex, this.attribStart = attribStart;
|
||||
}
|
||||
/**
|
||||
* End batch part.
|
||||
* @param endIndex
|
||||
* @param endAttrib
|
||||
*/
|
||||
end(endIndex, endAttrib) {
|
||||
this.attribSize = endAttrib - this.attribStart, this.size = endIndex - this.start;
|
||||
}
|
||||
reset() {
|
||||
this.style = null, this.size = 0, this.start = 0, this.attribStart = 0, this.attribSize = 0;
|
||||
}
|
||||
}
|
||||
export {
|
||||
BatchPart
|
||||
};
|
||||
//# sourceMappingURL=BatchPart.mjs.map
|
||||
1
resources/app/node_modules/@pixi/graphics/lib/utils/BatchPart.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/graphics/lib/utils/BatchPart.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"BatchPart.mjs","sources":["../../src/utils/BatchPart.ts"],"sourcesContent":["import type { FillStyle } from '../styles/FillStyle';\nimport type { LineStyle } from '../styles/LineStyle';\n\n/**\n * A structure to hold interim batch objects for Graphics.\n * @memberof PIXI.graphicsUtils\n */\nexport class BatchPart\n{\n public style: LineStyle | FillStyle;\n public start: number;\n public size: number;\n public attribStart: number;\n public attribSize: number;\n\n constructor()\n {\n this.reset();\n }\n\n /**\n * Begin batch part.\n * @param style\n * @param startIndex\n * @param attribStart\n */\n public begin(style: LineStyle | FillStyle, startIndex: number, attribStart: number): void\n {\n this.reset();\n this.style = style;\n this.start = startIndex;\n this.attribStart = attribStart;\n }\n\n /**\n * End batch part.\n * @param endIndex\n * @param endAttrib\n */\n public end(endIndex: number, endAttrib: number): void\n {\n this.attribSize = endAttrib - this.attribStart;\n this.size = endIndex - this.start;\n }\n\n public reset(): void\n {\n this.style = null;\n this.size = 0;\n this.start = 0;\n this.attribStart = 0;\n this.attribSize = 0;\n }\n}\n"],"names":[],"mappings":"AAOO,MAAM,UACb;AAAA,EAOI,cACA;AACI,SAAK,MAAM;AAAA,EACf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQO,MAAM,OAA8B,YAAoB,aAC/D;AACS,SAAA,MAAA,GACL,KAAK,QAAQ,OACb,KAAK,QAAQ,YACb,KAAK,cAAc;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,IAAI,UAAkB,WAC7B;AACI,SAAK,aAAa,YAAY,KAAK,aACnC,KAAK,OAAO,WAAW,KAAK;AAAA,EAChC;AAAA,EAEO,QACP;AACI,SAAK,QAAQ,MACb,KAAK,OAAO,GACZ,KAAK,QAAQ,GACb,KAAK,cAAc,GACnB,KAAK,aAAa;AAAA,EACtB;AACJ;"}
|
||||
54
resources/app/node_modules/@pixi/graphics/lib/utils/BezierUtils.js
generated
vendored
Normal file
54
resources/app/node_modules/@pixi/graphics/lib/utils/BezierUtils.js
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
"use strict";
|
||||
var _const = require("../const.js");
|
||||
class BezierUtils {
|
||||
/**
|
||||
* Calculate length of bezier curve.
|
||||
* Analytical solution is impossible, since it involves an integral that does not integrate in general.
|
||||
* Therefore numerical solution is used.
|
||||
* @private
|
||||
* @param fromX - Starting point x
|
||||
* @param fromY - Starting point y
|
||||
* @param cpX - Control point x
|
||||
* @param cpY - Control point y
|
||||
* @param cpX2 - Second Control point x
|
||||
* @param cpY2 - Second Control point y
|
||||
* @param toX - Destination point x
|
||||
* @param toY - Destination point y
|
||||
* @returns - Length of bezier curve
|
||||
*/
|
||||
static curveLength(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY) {
|
||||
let result = 0, t = 0, t2 = 0, t3 = 0, nt = 0, nt2 = 0, nt3 = 0, x = 0, y = 0, dx = 0, dy = 0, prevX = fromX, prevY = fromY;
|
||||
for (let i = 1; i <= 10; ++i)
|
||||
t = i / 10, t2 = t * t, t3 = t2 * t, nt = 1 - t, nt2 = nt * nt, nt3 = nt2 * nt, x = nt3 * fromX + 3 * nt2 * t * cpX + 3 * nt * t2 * cpX2 + t3 * toX, y = nt3 * fromY + 3 * nt2 * t * cpY + 3 * nt * t2 * cpY2 + t3 * toY, dx = prevX - x, dy = prevY - y, prevX = x, prevY = y, result += Math.sqrt(dx * dx + dy * dy);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* Calculate the points for a bezier curve and then draws it.
|
||||
*
|
||||
* Ignored from docs since it is not directly exposed.
|
||||
* @ignore
|
||||
* @param cpX - Control point x
|
||||
* @param cpY - Control point y
|
||||
* @param cpX2 - Second Control point x
|
||||
* @param cpY2 - Second Control point y
|
||||
* @param toX - Destination point x
|
||||
* @param toY - Destination point y
|
||||
* @param points - Path array to push points into
|
||||
*/
|
||||
static curveTo(cpX, cpY, cpX2, cpY2, toX, toY, points) {
|
||||
const fromX = points[points.length - 2], fromY = points[points.length - 1];
|
||||
points.length -= 2;
|
||||
const n = _const.curves._segmentsCount(
|
||||
BezierUtils.curveLength(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY)
|
||||
);
|
||||
let dt = 0, dt2 = 0, dt3 = 0, t2 = 0, t3 = 0;
|
||||
points.push(fromX, fromY);
|
||||
for (let i = 1, j = 0; i <= n; ++i)
|
||||
j = i / n, dt = 1 - j, dt2 = dt * dt, dt3 = dt2 * dt, t2 = j * j, t3 = t2 * j, points.push(
|
||||
dt3 * fromX + 3 * dt2 * j * cpX + 3 * dt * t2 * cpX2 + t3 * toX,
|
||||
dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY
|
||||
);
|
||||
}
|
||||
}
|
||||
exports.BezierUtils = BezierUtils;
|
||||
//# sourceMappingURL=BezierUtils.js.map
|
||||
1
resources/app/node_modules/@pixi/graphics/lib/utils/BezierUtils.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/graphics/lib/utils/BezierUtils.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"BezierUtils.js","sources":["../../src/utils/BezierUtils.ts"],"sourcesContent":["import { curves } from '../const';\n\n/**\n * Utilities for bezier curves\n * @private\n */\nexport class BezierUtils\n{\n /**\n * Calculate length of bezier curve.\n * Analytical solution is impossible, since it involves an integral that does not integrate in general.\n * Therefore numerical solution is used.\n * @private\n * @param fromX - Starting point x\n * @param fromY - Starting point y\n * @param cpX - Control point x\n * @param cpY - Control point y\n * @param cpX2 - Second Control point x\n * @param cpY2 - Second Control point y\n * @param toX - Destination point x\n * @param toY - Destination point y\n * @returns - Length of bezier curve\n */\n static curveLength(\n fromX: number, fromY: number,\n cpX: number, cpY: number,\n cpX2: number, cpY2: number,\n toX: number, toY: number): number\n {\n const n = 10;\n let result = 0.0;\n let t = 0.0;\n let t2 = 0.0;\n let t3 = 0.0;\n let nt = 0.0;\n let nt2 = 0.0;\n let nt3 = 0.0;\n let x = 0.0;\n let y = 0.0;\n let dx = 0.0;\n let dy = 0.0;\n let prevX = fromX;\n let prevY = fromY;\n\n for (let i = 1; i <= n; ++i)\n {\n t = i / n;\n t2 = t * t;\n t3 = t2 * t;\n nt = (1.0 - t);\n nt2 = nt * nt;\n nt3 = nt2 * nt;\n\n x = (nt3 * fromX) + (3.0 * nt2 * t * cpX) + (3.0 * nt * t2 * cpX2) + (t3 * toX);\n y = (nt3 * fromY) + (3.0 * nt2 * t * cpY) + (3 * nt * t2 * cpY2) + (t3 * toY);\n dx = prevX - x;\n dy = prevY - y;\n prevX = x;\n prevY = y;\n\n result += Math.sqrt((dx * dx) + (dy * dy));\n }\n\n return result;\n }\n\n /**\n * Calculate the points for a bezier curve and then draws it.\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @param cpX - Control point x\n * @param cpY - Control point y\n * @param cpX2 - Second Control point x\n * @param cpY2 - Second Control point y\n * @param toX - Destination point x\n * @param toY - Destination point y\n * @param points - Path array to push points into\n */\n static curveTo(\n cpX: number, cpY: number,\n cpX2: number, cpY2: number,\n toX: number, toY: number,\n points: Array<number>): void\n {\n const fromX = points[points.length - 2];\n const fromY = points[points.length - 1];\n\n points.length -= 2;\n\n const n = curves._segmentsCount(\n BezierUtils.curveLength(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY)\n );\n\n let dt = 0;\n let dt2 = 0;\n let dt3 = 0;\n let t2 = 0;\n let t3 = 0;\n\n points.push(fromX, fromY);\n\n for (let i = 1, j = 0; i <= n; ++i)\n {\n j = i / n;\n\n dt = (1 - j);\n dt2 = dt * dt;\n dt3 = dt2 * dt;\n\n t2 = j * j;\n t3 = t2 * j;\n\n points.push(\n (dt3 * fromX) + (3 * dt2 * j * cpX) + (3 * dt * t2 * cpX2) + (t3 * toX),\n (dt3 * fromY) + (3 * dt2 * j * cpY) + (3 * dt * t2 * cpY2) + (t3 * toY)\n );\n }\n }\n}\n"],"names":["curves"],"mappings":";;AAMO,MAAM,YACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBI,OAAO,YACH,OAAe,OACf,KAAa,KACb,MAAc,MACd,KAAa,KACjB;AAEQ,QAAA,SAAS,GACT,IAAI,GACJ,KAAK,GACL,KAAK,GACL,KAAK,GACL,MAAM,GACN,MAAM,GACN,IAAI,GACJ,IAAI,GACJ,KAAK,GACL,KAAK,GACL,QAAQ,OACR,QAAQ;AAEZ,aAAS,IAAI,GAAG,KAAK,IAAG,EAAE;AAElB,UAAA,IAAI,IACR,KAAK,IAAI,GACT,KAAK,KAAK,GACV,KAAM,IAAM,GACZ,MAAM,KAAK,IACX,MAAM,MAAM,IAEZ,IAAK,MAAM,QAAU,IAAM,MAAM,IAAI,MAAQ,IAAM,KAAK,KAAK,OAAS,KAAK,KAC3E,IAAK,MAAM,QAAU,IAAM,MAAM,IAAI,MAAQ,IAAI,KAAK,KAAK,OAAS,KAAK,KACzE,KAAK,QAAQ,GACb,KAAK,QAAQ,GACb,QAAQ,GACR,QAAQ,GAER,UAAU,KAAK,KAAM,KAAK,KAAO,KAAK,EAAG;AAGtC,WAAA;AAAA,EACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAeA,OAAO,QACH,KAAa,KACb,MAAc,MACd,KAAa,KACb,QACJ;AACU,UAAA,QAAQ,OAAO,OAAO,SAAS,CAAC,GAChC,QAAQ,OAAO,OAAO,SAAS,CAAC;AAEtC,WAAO,UAAU;AAEjB,UAAM,IAAIA,OAAAA,OAAO;AAAA,MACb,YAAY,YAAY,OAAO,OAAO,KAAK,KAAK,MAAM,MAAM,KAAK,GAAG;AAAA,IAAA;AAGpE,QAAA,KAAK,GACL,MAAM,GACN,MAAM,GACN,KAAK,GACL,KAAK;AAEF,WAAA,KAAK,OAAO,KAAK;AAExB,aAAS,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,EAAE;AAE7B,UAAI,IAAI,GAER,KAAM,IAAI,GACV,MAAM,KAAK,IACX,MAAM,MAAM,IAEZ,KAAK,IAAI,GACT,KAAK,KAAK,GAEV,OAAO;AAAA,QACF,MAAM,QAAU,IAAI,MAAM,IAAI,MAAQ,IAAI,KAAK,KAAK,OAAS,KAAK;AAAA,QAClE,MAAM,QAAU,IAAI,MAAM,IAAI,MAAQ,IAAI,KAAK,KAAK,OAAS,KAAK;AAAA,MAAA;AAAA,EAG/E;AACJ;;"}
|
||||
55
resources/app/node_modules/@pixi/graphics/lib/utils/BezierUtils.mjs
generated
vendored
Normal file
55
resources/app/node_modules/@pixi/graphics/lib/utils/BezierUtils.mjs
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
import { curves } from "../const.mjs";
|
||||
class BezierUtils {
|
||||
/**
|
||||
* Calculate length of bezier curve.
|
||||
* Analytical solution is impossible, since it involves an integral that does not integrate in general.
|
||||
* Therefore numerical solution is used.
|
||||
* @private
|
||||
* @param fromX - Starting point x
|
||||
* @param fromY - Starting point y
|
||||
* @param cpX - Control point x
|
||||
* @param cpY - Control point y
|
||||
* @param cpX2 - Second Control point x
|
||||
* @param cpY2 - Second Control point y
|
||||
* @param toX - Destination point x
|
||||
* @param toY - Destination point y
|
||||
* @returns - Length of bezier curve
|
||||
*/
|
||||
static curveLength(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY) {
|
||||
let result = 0, t = 0, t2 = 0, t3 = 0, nt = 0, nt2 = 0, nt3 = 0, x = 0, y = 0, dx = 0, dy = 0, prevX = fromX, prevY = fromY;
|
||||
for (let i = 1; i <= 10; ++i)
|
||||
t = i / 10, t2 = t * t, t3 = t2 * t, nt = 1 - t, nt2 = nt * nt, nt3 = nt2 * nt, x = nt3 * fromX + 3 * nt2 * t * cpX + 3 * nt * t2 * cpX2 + t3 * toX, y = nt3 * fromY + 3 * nt2 * t * cpY + 3 * nt * t2 * cpY2 + t3 * toY, dx = prevX - x, dy = prevY - y, prevX = x, prevY = y, result += Math.sqrt(dx * dx + dy * dy);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* Calculate the points for a bezier curve and then draws it.
|
||||
*
|
||||
* Ignored from docs since it is not directly exposed.
|
||||
* @ignore
|
||||
* @param cpX - Control point x
|
||||
* @param cpY - Control point y
|
||||
* @param cpX2 - Second Control point x
|
||||
* @param cpY2 - Second Control point y
|
||||
* @param toX - Destination point x
|
||||
* @param toY - Destination point y
|
||||
* @param points - Path array to push points into
|
||||
*/
|
||||
static curveTo(cpX, cpY, cpX2, cpY2, toX, toY, points) {
|
||||
const fromX = points[points.length - 2], fromY = points[points.length - 1];
|
||||
points.length -= 2;
|
||||
const n = curves._segmentsCount(
|
||||
BezierUtils.curveLength(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY)
|
||||
);
|
||||
let dt = 0, dt2 = 0, dt3 = 0, t2 = 0, t3 = 0;
|
||||
points.push(fromX, fromY);
|
||||
for (let i = 1, j = 0; i <= n; ++i)
|
||||
j = i / n, dt = 1 - j, dt2 = dt * dt, dt3 = dt2 * dt, t2 = j * j, t3 = t2 * j, points.push(
|
||||
dt3 * fromX + 3 * dt2 * j * cpX + 3 * dt * t2 * cpX2 + t3 * toX,
|
||||
dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY
|
||||
);
|
||||
}
|
||||
}
|
||||
export {
|
||||
BezierUtils
|
||||
};
|
||||
//# sourceMappingURL=BezierUtils.mjs.map
|
||||
1
resources/app/node_modules/@pixi/graphics/lib/utils/BezierUtils.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/graphics/lib/utils/BezierUtils.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"BezierUtils.mjs","sources":["../../src/utils/BezierUtils.ts"],"sourcesContent":["import { curves } from '../const';\n\n/**\n * Utilities for bezier curves\n * @private\n */\nexport class BezierUtils\n{\n /**\n * Calculate length of bezier curve.\n * Analytical solution is impossible, since it involves an integral that does not integrate in general.\n * Therefore numerical solution is used.\n * @private\n * @param fromX - Starting point x\n * @param fromY - Starting point y\n * @param cpX - Control point x\n * @param cpY - Control point y\n * @param cpX2 - Second Control point x\n * @param cpY2 - Second Control point y\n * @param toX - Destination point x\n * @param toY - Destination point y\n * @returns - Length of bezier curve\n */\n static curveLength(\n fromX: number, fromY: number,\n cpX: number, cpY: number,\n cpX2: number, cpY2: number,\n toX: number, toY: number): number\n {\n const n = 10;\n let result = 0.0;\n let t = 0.0;\n let t2 = 0.0;\n let t3 = 0.0;\n let nt = 0.0;\n let nt2 = 0.0;\n let nt3 = 0.0;\n let x = 0.0;\n let y = 0.0;\n let dx = 0.0;\n let dy = 0.0;\n let prevX = fromX;\n let prevY = fromY;\n\n for (let i = 1; i <= n; ++i)\n {\n t = i / n;\n t2 = t * t;\n t3 = t2 * t;\n nt = (1.0 - t);\n nt2 = nt * nt;\n nt3 = nt2 * nt;\n\n x = (nt3 * fromX) + (3.0 * nt2 * t * cpX) + (3.0 * nt * t2 * cpX2) + (t3 * toX);\n y = (nt3 * fromY) + (3.0 * nt2 * t * cpY) + (3 * nt * t2 * cpY2) + (t3 * toY);\n dx = prevX - x;\n dy = prevY - y;\n prevX = x;\n prevY = y;\n\n result += Math.sqrt((dx * dx) + (dy * dy));\n }\n\n return result;\n }\n\n /**\n * Calculate the points for a bezier curve and then draws it.\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @param cpX - Control point x\n * @param cpY - Control point y\n * @param cpX2 - Second Control point x\n * @param cpY2 - Second Control point y\n * @param toX - Destination point x\n * @param toY - Destination point y\n * @param points - Path array to push points into\n */\n static curveTo(\n cpX: number, cpY: number,\n cpX2: number, cpY2: number,\n toX: number, toY: number,\n points: Array<number>): void\n {\n const fromX = points[points.length - 2];\n const fromY = points[points.length - 1];\n\n points.length -= 2;\n\n const n = curves._segmentsCount(\n BezierUtils.curveLength(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY)\n );\n\n let dt = 0;\n let dt2 = 0;\n let dt3 = 0;\n let t2 = 0;\n let t3 = 0;\n\n points.push(fromX, fromY);\n\n for (let i = 1, j = 0; i <= n; ++i)\n {\n j = i / n;\n\n dt = (1 - j);\n dt2 = dt * dt;\n dt3 = dt2 * dt;\n\n t2 = j * j;\n t3 = t2 * j;\n\n points.push(\n (dt3 * fromX) + (3 * dt2 * j * cpX) + (3 * dt * t2 * cpX2) + (t3 * toX),\n (dt3 * fromY) + (3 * dt2 * j * cpY) + (3 * dt * t2 * cpY2) + (t3 * toY)\n );\n }\n }\n}\n"],"names":[],"mappings":";AAMO,MAAM,YACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBI,OAAO,YACH,OAAe,OACf,KAAa,KACb,MAAc,MACd,KAAa,KACjB;AAEQ,QAAA,SAAS,GACT,IAAI,GACJ,KAAK,GACL,KAAK,GACL,KAAK,GACL,MAAM,GACN,MAAM,GACN,IAAI,GACJ,IAAI,GACJ,KAAK,GACL,KAAK,GACL,QAAQ,OACR,QAAQ;AAEZ,aAAS,IAAI,GAAG,KAAK,IAAG,EAAE;AAElB,UAAA,IAAI,IACR,KAAK,IAAI,GACT,KAAK,KAAK,GACV,KAAM,IAAM,GACZ,MAAM,KAAK,IACX,MAAM,MAAM,IAEZ,IAAK,MAAM,QAAU,IAAM,MAAM,IAAI,MAAQ,IAAM,KAAK,KAAK,OAAS,KAAK,KAC3E,IAAK,MAAM,QAAU,IAAM,MAAM,IAAI,MAAQ,IAAI,KAAK,KAAK,OAAS,KAAK,KACzE,KAAK,QAAQ,GACb,KAAK,QAAQ,GACb,QAAQ,GACR,QAAQ,GAER,UAAU,KAAK,KAAM,KAAK,KAAO,KAAK,EAAG;AAGtC,WAAA;AAAA,EACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAeA,OAAO,QACH,KAAa,KACb,MAAc,MACd,KAAa,KACb,QACJ;AACU,UAAA,QAAQ,OAAO,OAAO,SAAS,CAAC,GAChC,QAAQ,OAAO,OAAO,SAAS,CAAC;AAEtC,WAAO,UAAU;AAEjB,UAAM,IAAI,OAAO;AAAA,MACb,YAAY,YAAY,OAAO,OAAO,KAAK,KAAK,MAAM,MAAM,KAAK,GAAG;AAAA,IAAA;AAGpE,QAAA,KAAK,GACL,MAAM,GACN,MAAM,GACN,KAAK,GACL,KAAK;AAEF,WAAA,KAAK,OAAO,KAAK;AAExB,aAAS,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,EAAE;AAE7B,UAAI,IAAI,GAER,KAAM,IAAI,GACV,MAAM,KAAK,IACX,MAAM,MAAM,IAEZ,KAAK,IAAI,GACT,KAAK,KAAK,GAEV,OAAO;AAAA,QACF,MAAM,QAAU,IAAI,MAAM,IAAI,MAAQ,IAAI,KAAK,KAAK,OAAS,KAAK;AAAA,QAClE,MAAM,QAAU,IAAI,MAAM,IAAI,MAAQ,IAAI,KAAK,KAAK,OAAS,KAAK;AAAA,MAAA;AAAA,EAG/E;AACJ;"}
|
||||
46
resources/app/node_modules/@pixi/graphics/lib/utils/QuadraticUtils.js
generated
vendored
Normal file
46
resources/app/node_modules/@pixi/graphics/lib/utils/QuadraticUtils.js
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
"use strict";
|
||||
var _const = require("../const.js");
|
||||
class QuadraticUtils {
|
||||
/**
|
||||
* Calculate length of quadratic curve
|
||||
* @see {@link http://www.malczak.linuxpl.com/blog/quadratic-bezier-curve-length/}
|
||||
* for the detailed explanation of math behind this.
|
||||
* @private
|
||||
* @param fromX - x-coordinate of curve start point
|
||||
* @param fromY - y-coordinate of curve start point
|
||||
* @param cpX - x-coordinate of curve control point
|
||||
* @param cpY - y-coordinate of curve control point
|
||||
* @param toX - x-coordinate of curve end point
|
||||
* @param toY - y-coordinate of curve end point
|
||||
* @returns - Length of quadratic curve
|
||||
*/
|
||||
static curveLength(fromX, fromY, cpX, cpY, toX, toY) {
|
||||
const ax = fromX - 2 * cpX + toX, ay = fromY - 2 * cpY + toY, bx = 2 * cpX - 2 * fromX, by = 2 * cpY - 2 * fromY, a = 4 * (ax * ax + ay * ay), b = 4 * (ax * bx + ay * by), c = bx * bx + by * by, s = 2 * Math.sqrt(a + b + c), a2 = Math.sqrt(a), a32 = 2 * a * a2, c2 = 2 * Math.sqrt(c), ba = b / a2;
|
||||
return (a32 * s + a2 * b * (s - c2) + (4 * c * a - b * b) * Math.log((2 * a2 + ba + s) / (ba + c2))) / (4 * a32);
|
||||
}
|
||||
/**
|
||||
* Calculate the points for a quadratic bezier curve and then draws it.
|
||||
* Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c
|
||||
* @private
|
||||
* @param cpX - Control point x
|
||||
* @param cpY - Control point y
|
||||
* @param toX - Destination point x
|
||||
* @param toY - Destination point y
|
||||
* @param points - Points to add segments to.
|
||||
*/
|
||||
static curveTo(cpX, cpY, toX, toY, points) {
|
||||
const fromX = points[points.length - 2], fromY = points[points.length - 1], n = _const.curves._segmentsCount(
|
||||
QuadraticUtils.curveLength(fromX, fromY, cpX, cpY, toX, toY)
|
||||
);
|
||||
let xa = 0, ya = 0;
|
||||
for (let i = 1; i <= n; ++i) {
|
||||
const j = i / n;
|
||||
xa = fromX + (cpX - fromX) * j, ya = fromY + (cpY - fromY) * j, points.push(
|
||||
xa + (cpX + (toX - cpX) * j - xa) * j,
|
||||
ya + (cpY + (toY - cpY) * j - ya) * j
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.QuadraticUtils = QuadraticUtils;
|
||||
//# sourceMappingURL=QuadraticUtils.js.map
|
||||
1
resources/app/node_modules/@pixi/graphics/lib/utils/QuadraticUtils.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/graphics/lib/utils/QuadraticUtils.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"QuadraticUtils.js","sources":["../../src/utils/QuadraticUtils.ts"],"sourcesContent":["import { curves } from '../const';\n\n/**\n * Utilities for quadratic curves.\n * @private\n */\nexport class QuadraticUtils\n{\n /**\n * Calculate length of quadratic curve\n * @see {@link http://www.malczak.linuxpl.com/blog/quadratic-bezier-curve-length/}\n * for the detailed explanation of math behind this.\n * @private\n * @param fromX - x-coordinate of curve start point\n * @param fromY - y-coordinate of curve start point\n * @param cpX - x-coordinate of curve control point\n * @param cpY - y-coordinate of curve control point\n * @param toX - x-coordinate of curve end point\n * @param toY - y-coordinate of curve end point\n * @returns - Length of quadratic curve\n */\n static curveLength(\n fromX: number, fromY: number,\n cpX: number, cpY: number,\n toX: number, toY: number): number\n {\n const ax = fromX - (2.0 * cpX) + toX;\n const ay = fromY - (2.0 * cpY) + toY;\n const bx = (2.0 * cpX) - (2.0 * fromX);\n const by = (2.0 * cpY) - (2.0 * fromY);\n const a = 4.0 * ((ax * ax) + (ay * ay));\n const b = 4.0 * ((ax * bx) + (ay * by));\n const c = (bx * bx) + (by * by);\n\n const s = 2.0 * Math.sqrt(a + b + c);\n const a2 = Math.sqrt(a);\n const a32 = 2.0 * a * a2;\n const c2 = 2.0 * Math.sqrt(c);\n const ba = b / a2;\n\n return (\n (a32 * s)\n + (a2 * b * (s - c2))\n + (\n ((4.0 * c * a) - (b * b))\n * Math.log(((2.0 * a2) + ba + s) / (ba + c2))\n )\n ) / (4.0 * a32);\n }\n\n /**\n * Calculate the points for a quadratic bezier curve and then draws it.\n * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c\n * @private\n * @param cpX - Control point x\n * @param cpY - Control point y\n * @param toX - Destination point x\n * @param toY - Destination point y\n * @param points - Points to add segments to.\n */\n static curveTo(cpX: number, cpY: number, toX: number, toY: number, points: Array<number>): void\n {\n const fromX = points[points.length - 2];\n const fromY = points[points.length - 1];\n\n const n = curves._segmentsCount(\n QuadraticUtils.curveLength(fromX, fromY, cpX, cpY, toX, toY)\n );\n\n let xa = 0;\n let ya = 0;\n\n for (let i = 1; i <= n; ++i)\n {\n const j = i / n;\n\n xa = fromX + ((cpX - fromX) * j);\n ya = fromY + ((cpY - fromY) * j);\n\n points.push(xa + (((cpX + ((toX - cpX) * j)) - xa) * j),\n ya + (((cpY + ((toY - cpY) * j)) - ya) * j));\n }\n }\n}\n"],"names":["curves"],"mappings":";;AAMO,MAAM,eACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcI,OAAO,YACH,OAAe,OACf,KAAa,KACb,KAAa,KACjB;AACI,UAAM,KAAK,QAAS,IAAM,MAAO,KAC3B,KAAK,QAAS,IAAM,MAAO,KAC3B,KAAM,IAAM,MAAQ,IAAM,OAC1B,KAAM,IAAM,MAAQ,IAAM,OAC1B,IAAI,KAAQ,KAAK,KAAO,KAAK,KAC7B,IAAI,KAAQ,KAAK,KAAO,KAAK,KAC7B,IAAK,KAAK,KAAO,KAAK,IAEtB,IAAI,IAAM,KAAK,KAAK,IAAI,IAAI,CAAC,GAC7B,KAAK,KAAK,KAAK,CAAC,GAChB,MAAM,IAAM,IAAI,IAChB,KAAK,IAAM,KAAK,KAAK,CAAC,GACtB,KAAK,IAAI;AAGV,YAAA,MAAM,IACA,KAAK,KAAK,IAAI,OAEX,IAAM,IAAI,IAAM,IAAI,KACrB,KAAK,KAAM,IAAM,KAAM,KAAK,MAAM,KAAK,GAAG,MAElD,IAAM;AAAA,EACf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,OAAO,QAAQ,KAAa,KAAa,KAAa,KAAa,QACnE;AACI,UAAM,QAAQ,OAAO,OAAO,SAAS,CAAC,GAChC,QAAQ,OAAO,OAAO,SAAS,CAAC,GAEhC,IAAIA,OAAO,OAAA;AAAA,MACb,eAAe,YAAY,OAAO,OAAO,KAAK,KAAK,KAAK,GAAG;AAAA,IAAA;AAG3D,QAAA,KAAK,GACL,KAAK;AAET,aAAS,IAAI,GAAG,KAAK,GAAG,EAAE,GAC1B;AACI,YAAM,IAAI,IAAI;AAET,WAAA,SAAU,MAAM,SAAS,GAC9B,KAAK,SAAU,MAAM,SAAS,GAE9B,OAAO;AAAA,QAAK,MAAQ,OAAQ,MAAM,OAAO,IAAM,MAAM;AAAA,QACjD,MAAQ,OAAQ,MAAM,OAAO,IAAM,MAAM;AAAA,MAAA;AAAA,IACjD;AAAA,EACJ;AACJ;;"}
|
||||
47
resources/app/node_modules/@pixi/graphics/lib/utils/QuadraticUtils.mjs
generated
vendored
Normal file
47
resources/app/node_modules/@pixi/graphics/lib/utils/QuadraticUtils.mjs
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
import { curves } from "../const.mjs";
|
||||
class QuadraticUtils {
|
||||
/**
|
||||
* Calculate length of quadratic curve
|
||||
* @see {@link http://www.malczak.linuxpl.com/blog/quadratic-bezier-curve-length/}
|
||||
* for the detailed explanation of math behind this.
|
||||
* @private
|
||||
* @param fromX - x-coordinate of curve start point
|
||||
* @param fromY - y-coordinate of curve start point
|
||||
* @param cpX - x-coordinate of curve control point
|
||||
* @param cpY - y-coordinate of curve control point
|
||||
* @param toX - x-coordinate of curve end point
|
||||
* @param toY - y-coordinate of curve end point
|
||||
* @returns - Length of quadratic curve
|
||||
*/
|
||||
static curveLength(fromX, fromY, cpX, cpY, toX, toY) {
|
||||
const ax = fromX - 2 * cpX + toX, ay = fromY - 2 * cpY + toY, bx = 2 * cpX - 2 * fromX, by = 2 * cpY - 2 * fromY, a = 4 * (ax * ax + ay * ay), b = 4 * (ax * bx + ay * by), c = bx * bx + by * by, s = 2 * Math.sqrt(a + b + c), a2 = Math.sqrt(a), a32 = 2 * a * a2, c2 = 2 * Math.sqrt(c), ba = b / a2;
|
||||
return (a32 * s + a2 * b * (s - c2) + (4 * c * a - b * b) * Math.log((2 * a2 + ba + s) / (ba + c2))) / (4 * a32);
|
||||
}
|
||||
/**
|
||||
* Calculate the points for a quadratic bezier curve and then draws it.
|
||||
* Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c
|
||||
* @private
|
||||
* @param cpX - Control point x
|
||||
* @param cpY - Control point y
|
||||
* @param toX - Destination point x
|
||||
* @param toY - Destination point y
|
||||
* @param points - Points to add segments to.
|
||||
*/
|
||||
static curveTo(cpX, cpY, toX, toY, points) {
|
||||
const fromX = points[points.length - 2], fromY = points[points.length - 1], n = curves._segmentsCount(
|
||||
QuadraticUtils.curveLength(fromX, fromY, cpX, cpY, toX, toY)
|
||||
);
|
||||
let xa = 0, ya = 0;
|
||||
for (let i = 1; i <= n; ++i) {
|
||||
const j = i / n;
|
||||
xa = fromX + (cpX - fromX) * j, ya = fromY + (cpY - fromY) * j, points.push(
|
||||
xa + (cpX + (toX - cpX) * j - xa) * j,
|
||||
ya + (cpY + (toY - cpY) * j - ya) * j
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
export {
|
||||
QuadraticUtils
|
||||
};
|
||||
//# sourceMappingURL=QuadraticUtils.mjs.map
|
||||
1
resources/app/node_modules/@pixi/graphics/lib/utils/QuadraticUtils.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/graphics/lib/utils/QuadraticUtils.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"QuadraticUtils.mjs","sources":["../../src/utils/QuadraticUtils.ts"],"sourcesContent":["import { curves } from '../const';\n\n/**\n * Utilities for quadratic curves.\n * @private\n */\nexport class QuadraticUtils\n{\n /**\n * Calculate length of quadratic curve\n * @see {@link http://www.malczak.linuxpl.com/blog/quadratic-bezier-curve-length/}\n * for the detailed explanation of math behind this.\n * @private\n * @param fromX - x-coordinate of curve start point\n * @param fromY - y-coordinate of curve start point\n * @param cpX - x-coordinate of curve control point\n * @param cpY - y-coordinate of curve control point\n * @param toX - x-coordinate of curve end point\n * @param toY - y-coordinate of curve end point\n * @returns - Length of quadratic curve\n */\n static curveLength(\n fromX: number, fromY: number,\n cpX: number, cpY: number,\n toX: number, toY: number): number\n {\n const ax = fromX - (2.0 * cpX) + toX;\n const ay = fromY - (2.0 * cpY) + toY;\n const bx = (2.0 * cpX) - (2.0 * fromX);\n const by = (2.0 * cpY) - (2.0 * fromY);\n const a = 4.0 * ((ax * ax) + (ay * ay));\n const b = 4.0 * ((ax * bx) + (ay * by));\n const c = (bx * bx) + (by * by);\n\n const s = 2.0 * Math.sqrt(a + b + c);\n const a2 = Math.sqrt(a);\n const a32 = 2.0 * a * a2;\n const c2 = 2.0 * Math.sqrt(c);\n const ba = b / a2;\n\n return (\n (a32 * s)\n + (a2 * b * (s - c2))\n + (\n ((4.0 * c * a) - (b * b))\n * Math.log(((2.0 * a2) + ba + s) / (ba + c2))\n )\n ) / (4.0 * a32);\n }\n\n /**\n * Calculate the points for a quadratic bezier curve and then draws it.\n * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c\n * @private\n * @param cpX - Control point x\n * @param cpY - Control point y\n * @param toX - Destination point x\n * @param toY - Destination point y\n * @param points - Points to add segments to.\n */\n static curveTo(cpX: number, cpY: number, toX: number, toY: number, points: Array<number>): void\n {\n const fromX = points[points.length - 2];\n const fromY = points[points.length - 1];\n\n const n = curves._segmentsCount(\n QuadraticUtils.curveLength(fromX, fromY, cpX, cpY, toX, toY)\n );\n\n let xa = 0;\n let ya = 0;\n\n for (let i = 1; i <= n; ++i)\n {\n const j = i / n;\n\n xa = fromX + ((cpX - fromX) * j);\n ya = fromY + ((cpY - fromY) * j);\n\n points.push(xa + (((cpX + ((toX - cpX) * j)) - xa) * j),\n ya + (((cpY + ((toY - cpY) * j)) - ya) * j));\n }\n }\n}\n"],"names":[],"mappings":";AAMO,MAAM,eACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcI,OAAO,YACH,OAAe,OACf,KAAa,KACb,KAAa,KACjB;AACI,UAAM,KAAK,QAAS,IAAM,MAAO,KAC3B,KAAK,QAAS,IAAM,MAAO,KAC3B,KAAM,IAAM,MAAQ,IAAM,OAC1B,KAAM,IAAM,MAAQ,IAAM,OAC1B,IAAI,KAAQ,KAAK,KAAO,KAAK,KAC7B,IAAI,KAAQ,KAAK,KAAO,KAAK,KAC7B,IAAK,KAAK,KAAO,KAAK,IAEtB,IAAI,IAAM,KAAK,KAAK,IAAI,IAAI,CAAC,GAC7B,KAAK,KAAK,KAAK,CAAC,GAChB,MAAM,IAAM,IAAI,IAChB,KAAK,IAAM,KAAK,KAAK,CAAC,GACtB,KAAK,IAAI;AAGV,YAAA,MAAM,IACA,KAAK,KAAK,IAAI,OAEX,IAAM,IAAI,IAAM,IAAI,KACrB,KAAK,KAAM,IAAM,KAAM,KAAK,MAAM,KAAK,GAAG,MAElD,IAAM;AAAA,EACf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,OAAO,QAAQ,KAAa,KAAa,KAAa,KAAa,QACnE;AACI,UAAM,QAAQ,OAAO,OAAO,SAAS,CAAC,GAChC,QAAQ,OAAO,OAAO,SAAS,CAAC,GAEhC,IAAI,OAAO;AAAA,MACb,eAAe,YAAY,OAAO,OAAO,KAAK,KAAK,KAAK,GAAG;AAAA,IAAA;AAG3D,QAAA,KAAK,GACL,KAAK;AAET,aAAS,IAAI,GAAG,KAAK,GAAG,EAAE,GAC1B;AACI,YAAM,IAAI,IAAI;AAET,WAAA,SAAU,MAAM,SAAS,GAC9B,KAAK,SAAU,MAAM,SAAS,GAE9B,OAAO;AAAA,QAAK,MAAQ,OAAQ,MAAM,OAAO,IAAM,MAAM;AAAA,QACjD,MAAQ,OAAQ,MAAM,OAAO,IAAM,MAAM;AAAA,MAAA;AAAA,IACjD;AAAA,EACJ;AACJ;"}
|
||||
70
resources/app/node_modules/@pixi/graphics/lib/utils/buildCircle.js
generated
vendored
Normal file
70
resources/app/node_modules/@pixi/graphics/lib/utils/buildCircle.js
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
"use strict";
|
||||
var core = require("@pixi/core");
|
||||
const buildCircle = {
|
||||
build(graphicsData) {
|
||||
const points = graphicsData.points;
|
||||
let x, y, dx, dy, rx, ry;
|
||||
if (graphicsData.type === core.SHAPES.CIRC) {
|
||||
const circle = graphicsData.shape;
|
||||
x = circle.x, y = circle.y, rx = ry = circle.radius, dx = dy = 0;
|
||||
} else if (graphicsData.type === core.SHAPES.ELIP) {
|
||||
const ellipse = graphicsData.shape;
|
||||
x = ellipse.x, y = ellipse.y, rx = ellipse.width, ry = ellipse.height, dx = dy = 0;
|
||||
} else {
|
||||
const roundedRect = graphicsData.shape, halfWidth = roundedRect.width / 2, halfHeight = roundedRect.height / 2;
|
||||
x = roundedRect.x + halfWidth, y = roundedRect.y + halfHeight, rx = ry = Math.max(0, Math.min(roundedRect.radius, Math.min(halfWidth, halfHeight))), dx = halfWidth - rx, dy = halfHeight - ry;
|
||||
}
|
||||
if (!(rx >= 0 && ry >= 0 && dx >= 0 && dy >= 0)) {
|
||||
points.length = 0;
|
||||
return;
|
||||
}
|
||||
const n = Math.ceil(2.3 * Math.sqrt(rx + ry)), m = n * 8 + (dx ? 4 : 0) + (dy ? 4 : 0);
|
||||
if (points.length = m, m === 0)
|
||||
return;
|
||||
if (n === 0) {
|
||||
points.length = 8, points[0] = points[6] = x + dx, points[1] = points[3] = y + dy, points[2] = points[4] = x - dx, points[5] = points[7] = y - dy;
|
||||
return;
|
||||
}
|
||||
let j1 = 0, j2 = n * 4 + (dx ? 2 : 0) + 2, j3 = j2, j4 = m;
|
||||
{
|
||||
const x0 = dx + rx, y0 = dy, x1 = x + x0, x2 = x - x0, y1 = y + y0;
|
||||
if (points[j1++] = x1, points[j1++] = y1, points[--j2] = y1, points[--j2] = x2, dy) {
|
||||
const y2 = y - y0;
|
||||
points[j3++] = x2, points[j3++] = y2, points[--j4] = y2, points[--j4] = x1;
|
||||
}
|
||||
}
|
||||
for (let i = 1; i < n; i++) {
|
||||
const a = Math.PI / 2 * (i / n), x0 = dx + Math.cos(a) * rx, y0 = dy + Math.sin(a) * ry, x1 = x + x0, x2 = x - x0, y1 = y + y0, y2 = y - y0;
|
||||
points[j1++] = x1, points[j1++] = y1, points[--j2] = y1, points[--j2] = x2, points[j3++] = x2, points[j3++] = y2, points[--j4] = y2, points[--j4] = x1;
|
||||
}
|
||||
{
|
||||
const x0 = dx, y0 = dy + ry, x1 = x + x0, x2 = x - x0, y1 = y + y0, y2 = y - y0;
|
||||
points[j1++] = x1, points[j1++] = y1, points[--j4] = y2, points[--j4] = x1, dx && (points[j1++] = x2, points[j1++] = y1, points[--j4] = y2, points[--j4] = x2);
|
||||
}
|
||||
},
|
||||
triangulate(graphicsData, graphicsGeometry) {
|
||||
const points = graphicsData.points, verts = graphicsGeometry.points, indices = graphicsGeometry.indices;
|
||||
if (points.length === 0)
|
||||
return;
|
||||
let vertPos = verts.length / 2;
|
||||
const center = vertPos;
|
||||
let x, y;
|
||||
if (graphicsData.type !== core.SHAPES.RREC) {
|
||||
const circle = graphicsData.shape;
|
||||
x = circle.x, y = circle.y;
|
||||
} else {
|
||||
const roundedRect = graphicsData.shape;
|
||||
x = roundedRect.x + roundedRect.width / 2, y = roundedRect.y + roundedRect.height / 2;
|
||||
}
|
||||
const matrix = graphicsData.matrix;
|
||||
verts.push(
|
||||
graphicsData.matrix ? matrix.a * x + matrix.c * y + matrix.tx : x,
|
||||
graphicsData.matrix ? matrix.b * x + matrix.d * y + matrix.ty : y
|
||||
), vertPos++, verts.push(points[0], points[1]);
|
||||
for (let i = 2; i < points.length; i += 2)
|
||||
verts.push(points[i], points[i + 1]), indices.push(vertPos++, center, vertPos);
|
||||
indices.push(center + 1, center, vertPos);
|
||||
}
|
||||
};
|
||||
exports.buildCircle = buildCircle;
|
||||
//# sourceMappingURL=buildCircle.js.map
|
||||
1
resources/app/node_modules/@pixi/graphics/lib/utils/buildCircle.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/graphics/lib/utils/buildCircle.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
71
resources/app/node_modules/@pixi/graphics/lib/utils/buildCircle.mjs
generated
vendored
Normal file
71
resources/app/node_modules/@pixi/graphics/lib/utils/buildCircle.mjs
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
import { SHAPES } from "@pixi/core";
|
||||
const buildCircle = {
|
||||
build(graphicsData) {
|
||||
const points = graphicsData.points;
|
||||
let x, y, dx, dy, rx, ry;
|
||||
if (graphicsData.type === SHAPES.CIRC) {
|
||||
const circle = graphicsData.shape;
|
||||
x = circle.x, y = circle.y, rx = ry = circle.radius, dx = dy = 0;
|
||||
} else if (graphicsData.type === SHAPES.ELIP) {
|
||||
const ellipse = graphicsData.shape;
|
||||
x = ellipse.x, y = ellipse.y, rx = ellipse.width, ry = ellipse.height, dx = dy = 0;
|
||||
} else {
|
||||
const roundedRect = graphicsData.shape, halfWidth = roundedRect.width / 2, halfHeight = roundedRect.height / 2;
|
||||
x = roundedRect.x + halfWidth, y = roundedRect.y + halfHeight, rx = ry = Math.max(0, Math.min(roundedRect.radius, Math.min(halfWidth, halfHeight))), dx = halfWidth - rx, dy = halfHeight - ry;
|
||||
}
|
||||
if (!(rx >= 0 && ry >= 0 && dx >= 0 && dy >= 0)) {
|
||||
points.length = 0;
|
||||
return;
|
||||
}
|
||||
const n = Math.ceil(2.3 * Math.sqrt(rx + ry)), m = n * 8 + (dx ? 4 : 0) + (dy ? 4 : 0);
|
||||
if (points.length = m, m === 0)
|
||||
return;
|
||||
if (n === 0) {
|
||||
points.length = 8, points[0] = points[6] = x + dx, points[1] = points[3] = y + dy, points[2] = points[4] = x - dx, points[5] = points[7] = y - dy;
|
||||
return;
|
||||
}
|
||||
let j1 = 0, j2 = n * 4 + (dx ? 2 : 0) + 2, j3 = j2, j4 = m;
|
||||
{
|
||||
const x0 = dx + rx, y0 = dy, x1 = x + x0, x2 = x - x0, y1 = y + y0;
|
||||
if (points[j1++] = x1, points[j1++] = y1, points[--j2] = y1, points[--j2] = x2, dy) {
|
||||
const y2 = y - y0;
|
||||
points[j3++] = x2, points[j3++] = y2, points[--j4] = y2, points[--j4] = x1;
|
||||
}
|
||||
}
|
||||
for (let i = 1; i < n; i++) {
|
||||
const a = Math.PI / 2 * (i / n), x0 = dx + Math.cos(a) * rx, y0 = dy + Math.sin(a) * ry, x1 = x + x0, x2 = x - x0, y1 = y + y0, y2 = y - y0;
|
||||
points[j1++] = x1, points[j1++] = y1, points[--j2] = y1, points[--j2] = x2, points[j3++] = x2, points[j3++] = y2, points[--j4] = y2, points[--j4] = x1;
|
||||
}
|
||||
{
|
||||
const x0 = dx, y0 = dy + ry, x1 = x + x0, x2 = x - x0, y1 = y + y0, y2 = y - y0;
|
||||
points[j1++] = x1, points[j1++] = y1, points[--j4] = y2, points[--j4] = x1, dx && (points[j1++] = x2, points[j1++] = y1, points[--j4] = y2, points[--j4] = x2);
|
||||
}
|
||||
},
|
||||
triangulate(graphicsData, graphicsGeometry) {
|
||||
const points = graphicsData.points, verts = graphicsGeometry.points, indices = graphicsGeometry.indices;
|
||||
if (points.length === 0)
|
||||
return;
|
||||
let vertPos = verts.length / 2;
|
||||
const center = vertPos;
|
||||
let x, y;
|
||||
if (graphicsData.type !== SHAPES.RREC) {
|
||||
const circle = graphicsData.shape;
|
||||
x = circle.x, y = circle.y;
|
||||
} else {
|
||||
const roundedRect = graphicsData.shape;
|
||||
x = roundedRect.x + roundedRect.width / 2, y = roundedRect.y + roundedRect.height / 2;
|
||||
}
|
||||
const matrix = graphicsData.matrix;
|
||||
verts.push(
|
||||
graphicsData.matrix ? matrix.a * x + matrix.c * y + matrix.tx : x,
|
||||
graphicsData.matrix ? matrix.b * x + matrix.d * y + matrix.ty : y
|
||||
), vertPos++, verts.push(points[0], points[1]);
|
||||
for (let i = 2; i < points.length; i += 2)
|
||||
verts.push(points[i], points[i + 1]), indices.push(vertPos++, center, vertPos);
|
||||
indices.push(center + 1, center, vertPos);
|
||||
}
|
||||
};
|
||||
export {
|
||||
buildCircle
|
||||
};
|
||||
//# sourceMappingURL=buildCircle.mjs.map
|
||||
1
resources/app/node_modules/@pixi/graphics/lib/utils/buildCircle.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/graphics/lib/utils/buildCircle.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
297
resources/app/node_modules/@pixi/graphics/lib/utils/buildLine.js
generated
vendored
Normal file
297
resources/app/node_modules/@pixi/graphics/lib/utils/buildLine.js
generated
vendored
Normal file
@@ -0,0 +1,297 @@
|
||||
"use strict";
|
||||
var core = require("@pixi/core"), _const = require("../const.js");
|
||||
function square(x, y, nx, ny, innerWeight, outerWeight, clockwise, verts) {
|
||||
const ix = x - nx * innerWeight, iy = y - ny * innerWeight, ox = x + nx * outerWeight, oy = y + ny * outerWeight;
|
||||
let exx, eyy;
|
||||
clockwise ? (exx = ny, eyy = -nx) : (exx = -ny, eyy = nx);
|
||||
const eix = ix + exx, eiy = iy + eyy, eox = ox + exx, eoy = oy + eyy;
|
||||
return verts.push(
|
||||
eix,
|
||||
eiy,
|
||||
eox,
|
||||
eoy
|
||||
), 2;
|
||||
}
|
||||
function round(cx, cy, sx, sy, ex, ey, verts, clockwise) {
|
||||
const cx2p0x = sx - cx, cy2p0y = sy - cy;
|
||||
let angle0 = Math.atan2(cx2p0x, cy2p0y), angle1 = Math.atan2(ex - cx, ey - cy);
|
||||
clockwise && angle0 < angle1 ? angle0 += Math.PI * 2 : !clockwise && angle0 > angle1 && (angle1 += Math.PI * 2);
|
||||
let startAngle = angle0;
|
||||
const angleDiff = angle1 - angle0, absAngleDiff = Math.abs(angleDiff), radius = Math.sqrt(cx2p0x * cx2p0x + cy2p0y * cy2p0y), segCount = (15 * absAngleDiff * Math.sqrt(radius) / Math.PI >> 0) + 1, angleInc = angleDiff / segCount;
|
||||
if (startAngle += angleInc, clockwise) {
|
||||
verts.push(
|
||||
cx,
|
||||
cy,
|
||||
sx,
|
||||
sy
|
||||
);
|
||||
for (let i = 1, angle = startAngle; i < segCount; i++, angle += angleInc)
|
||||
verts.push(
|
||||
cx,
|
||||
cy,
|
||||
cx + Math.sin(angle) * radius,
|
||||
cy + Math.cos(angle) * radius
|
||||
);
|
||||
verts.push(
|
||||
cx,
|
||||
cy,
|
||||
ex,
|
||||
ey
|
||||
);
|
||||
} else {
|
||||
verts.push(
|
||||
sx,
|
||||
sy,
|
||||
cx,
|
||||
cy
|
||||
);
|
||||
for (let i = 1, angle = startAngle; i < segCount; i++, angle += angleInc)
|
||||
verts.push(
|
||||
cx + Math.sin(angle) * radius,
|
||||
cy + Math.cos(angle) * radius,
|
||||
cx,
|
||||
cy
|
||||
);
|
||||
verts.push(
|
||||
ex,
|
||||
ey,
|
||||
cx,
|
||||
cy
|
||||
);
|
||||
}
|
||||
return segCount * 2;
|
||||
}
|
||||
function buildNonNativeLine(graphicsData, graphicsGeometry) {
|
||||
const shape = graphicsData.shape;
|
||||
let points = graphicsData.points || shape.points.slice();
|
||||
const eps = graphicsGeometry.closePointEps;
|
||||
if (points.length === 0)
|
||||
return;
|
||||
const style = graphicsData.lineStyle, firstPoint = new core.Point(points[0], points[1]), lastPoint = new core.Point(points[points.length - 2], points[points.length - 1]), closedShape = shape.type !== core.SHAPES.POLY || shape.closeStroke, closedPath = Math.abs(firstPoint.x - lastPoint.x) < eps && Math.abs(firstPoint.y - lastPoint.y) < eps;
|
||||
if (closedShape) {
|
||||
points = points.slice(), closedPath && (points.pop(), points.pop(), lastPoint.set(points[points.length - 2], points[points.length - 1]));
|
||||
const midPointX = (firstPoint.x + lastPoint.x) * 0.5, midPointY = (lastPoint.y + firstPoint.y) * 0.5;
|
||||
points.unshift(midPointX, midPointY), points.push(midPointX, midPointY);
|
||||
}
|
||||
const verts = graphicsGeometry.points, length = points.length / 2;
|
||||
let indexCount = points.length;
|
||||
const indexStart = verts.length / 2, width = style.width / 2, widthSquared = width * width, miterLimitSquared = style.miterLimit * style.miterLimit;
|
||||
let x0 = points[0], y0 = points[1], x1 = points[2], y1 = points[3], x2 = 0, y2 = 0, perpx = -(y0 - y1), perpy = x0 - x1, perp1x = 0, perp1y = 0, dist = Math.sqrt(perpx * perpx + perpy * perpy);
|
||||
perpx /= dist, perpy /= dist, perpx *= width, perpy *= width;
|
||||
const ratio = style.alignment, innerWeight = (1 - ratio) * 2, outerWeight = ratio * 2;
|
||||
closedShape || (style.cap === _const.LINE_CAP.ROUND ? indexCount += round(
|
||||
x0 - perpx * (innerWeight - outerWeight) * 0.5,
|
||||
y0 - perpy * (innerWeight - outerWeight) * 0.5,
|
||||
x0 - perpx * innerWeight,
|
||||
y0 - perpy * innerWeight,
|
||||
x0 + perpx * outerWeight,
|
||||
y0 + perpy * outerWeight,
|
||||
verts,
|
||||
!0
|
||||
) + 2 : style.cap === _const.LINE_CAP.SQUARE && (indexCount += square(x0, y0, perpx, perpy, innerWeight, outerWeight, !0, verts))), verts.push(
|
||||
x0 - perpx * innerWeight,
|
||||
y0 - perpy * innerWeight,
|
||||
x0 + perpx * outerWeight,
|
||||
y0 + perpy * outerWeight
|
||||
);
|
||||
for (let i = 1; i < length - 1; ++i) {
|
||||
x0 = points[(i - 1) * 2], y0 = points[(i - 1) * 2 + 1], x1 = points[i * 2], y1 = points[i * 2 + 1], x2 = points[(i + 1) * 2], y2 = points[(i + 1) * 2 + 1], perpx = -(y0 - y1), perpy = x0 - x1, dist = Math.sqrt(perpx * perpx + perpy * perpy), perpx /= dist, perpy /= dist, perpx *= width, perpy *= width, perp1x = -(y1 - y2), perp1y = x1 - x2, dist = Math.sqrt(perp1x * perp1x + perp1y * perp1y), perp1x /= dist, perp1y /= dist, perp1x *= width, perp1y *= width;
|
||||
const dx0 = x1 - x0, dy0 = y0 - y1, dx1 = x1 - x2, dy1 = y2 - y1, dot = dx0 * dx1 + dy0 * dy1, cross = dy0 * dx1 - dy1 * dx0, clockwise = cross < 0;
|
||||
if (Math.abs(cross) < 1e-3 * Math.abs(dot)) {
|
||||
verts.push(
|
||||
x1 - perpx * innerWeight,
|
||||
y1 - perpy * innerWeight,
|
||||
x1 + perpx * outerWeight,
|
||||
y1 + perpy * outerWeight
|
||||
), dot >= 0 && (style.join === _const.LINE_JOIN.ROUND ? indexCount += round(
|
||||
x1,
|
||||
y1,
|
||||
x1 - perpx * innerWeight,
|
||||
y1 - perpy * innerWeight,
|
||||
x1 - perp1x * innerWeight,
|
||||
y1 - perp1y * innerWeight,
|
||||
verts,
|
||||
!1
|
||||
) + 4 : indexCount += 2, verts.push(
|
||||
x1 - perp1x * outerWeight,
|
||||
y1 - perp1y * outerWeight,
|
||||
x1 + perp1x * innerWeight,
|
||||
y1 + perp1y * innerWeight
|
||||
));
|
||||
continue;
|
||||
}
|
||||
const c1 = (-perpx + x0) * (-perpy + y1) - (-perpx + x1) * (-perpy + y0), c2 = (-perp1x + x2) * (-perp1y + y1) - (-perp1x + x1) * (-perp1y + y2), px = (dx0 * c2 - dx1 * c1) / cross, py = (dy1 * c1 - dy0 * c2) / cross, pdist = (px - x1) * (px - x1) + (py - y1) * (py - y1), imx = x1 + (px - x1) * innerWeight, imy = y1 + (py - y1) * innerWeight, omx = x1 - (px - x1) * outerWeight, omy = y1 - (py - y1) * outerWeight, smallerInsideSegmentSq = Math.min(dx0 * dx0 + dy0 * dy0, dx1 * dx1 + dy1 * dy1), insideWeight = clockwise ? innerWeight : outerWeight, smallerInsideDiagonalSq = smallerInsideSegmentSq + insideWeight * insideWeight * widthSquared, insideMiterOk = pdist <= smallerInsideDiagonalSq;
|
||||
let join = style.join;
|
||||
if (join === _const.LINE_JOIN.MITER && pdist / widthSquared > miterLimitSquared && (join = _const.LINE_JOIN.BEVEL), insideMiterOk)
|
||||
switch (join) {
|
||||
case _const.LINE_JOIN.MITER: {
|
||||
verts.push(
|
||||
imx,
|
||||
imy,
|
||||
omx,
|
||||
omy
|
||||
);
|
||||
break;
|
||||
}
|
||||
case _const.LINE_JOIN.BEVEL: {
|
||||
clockwise ? verts.push(
|
||||
imx,
|
||||
imy,
|
||||
// inner miter point
|
||||
x1 + perpx * outerWeight,
|
||||
y1 + perpy * outerWeight,
|
||||
// first segment's outer vertex
|
||||
imx,
|
||||
imy,
|
||||
// inner miter point
|
||||
x1 + perp1x * outerWeight,
|
||||
y1 + perp1y * outerWeight
|
||||
) : verts.push(
|
||||
x1 - perpx * innerWeight,
|
||||
y1 - perpy * innerWeight,
|
||||
// first segment's inner vertex
|
||||
omx,
|
||||
omy,
|
||||
// outer miter point
|
||||
x1 - perp1x * innerWeight,
|
||||
y1 - perp1y * innerWeight,
|
||||
// second segment's outer vertex
|
||||
omx,
|
||||
omy
|
||||
), indexCount += 2;
|
||||
break;
|
||||
}
|
||||
case _const.LINE_JOIN.ROUND: {
|
||||
clockwise ? (verts.push(
|
||||
imx,
|
||||
imy,
|
||||
x1 + perpx * outerWeight,
|
||||
y1 + perpy * outerWeight
|
||||
), indexCount += round(
|
||||
x1,
|
||||
y1,
|
||||
x1 + perpx * outerWeight,
|
||||
y1 + perpy * outerWeight,
|
||||
x1 + perp1x * outerWeight,
|
||||
y1 + perp1y * outerWeight,
|
||||
verts,
|
||||
!0
|
||||
) + 4, verts.push(
|
||||
imx,
|
||||
imy,
|
||||
x1 + perp1x * outerWeight,
|
||||
y1 + perp1y * outerWeight
|
||||
)) : (verts.push(
|
||||
x1 - perpx * innerWeight,
|
||||
y1 - perpy * innerWeight,
|
||||
omx,
|
||||
omy
|
||||
), indexCount += round(
|
||||
x1,
|
||||
y1,
|
||||
x1 - perpx * innerWeight,
|
||||
y1 - perpy * innerWeight,
|
||||
x1 - perp1x * innerWeight,
|
||||
y1 - perp1y * innerWeight,
|
||||
verts,
|
||||
!1
|
||||
) + 4, verts.push(
|
||||
x1 - perp1x * innerWeight,
|
||||
y1 - perp1y * innerWeight,
|
||||
omx,
|
||||
omy
|
||||
));
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
switch (verts.push(
|
||||
x1 - perpx * innerWeight,
|
||||
y1 - perpy * innerWeight,
|
||||
// first segment's inner vertex
|
||||
x1 + perpx * outerWeight,
|
||||
y1 + perpy * outerWeight
|
||||
), join) {
|
||||
case _const.LINE_JOIN.MITER: {
|
||||
clockwise ? verts.push(
|
||||
omx,
|
||||
omy,
|
||||
// inner miter point
|
||||
omx,
|
||||
omy
|
||||
) : verts.push(
|
||||
imx,
|
||||
imy,
|
||||
// outer miter point
|
||||
imx,
|
||||
imy
|
||||
), indexCount += 2;
|
||||
break;
|
||||
}
|
||||
case _const.LINE_JOIN.ROUND: {
|
||||
clockwise ? indexCount += round(
|
||||
x1,
|
||||
y1,
|
||||
x1 + perpx * outerWeight,
|
||||
y1 + perpy * outerWeight,
|
||||
x1 + perp1x * outerWeight,
|
||||
y1 + perp1y * outerWeight,
|
||||
verts,
|
||||
!0
|
||||
) + 2 : indexCount += round(
|
||||
x1,
|
||||
y1,
|
||||
x1 - perpx * innerWeight,
|
||||
y1 - perpy * innerWeight,
|
||||
x1 - perp1x * innerWeight,
|
||||
y1 - perp1y * innerWeight,
|
||||
verts,
|
||||
!1
|
||||
) + 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
verts.push(
|
||||
x1 - perp1x * innerWeight,
|
||||
y1 - perp1y * innerWeight,
|
||||
// second segment's inner vertex
|
||||
x1 + perp1x * outerWeight,
|
||||
y1 + perp1y * outerWeight
|
||||
), indexCount += 2;
|
||||
}
|
||||
}
|
||||
x0 = points[(length - 2) * 2], y0 = points[(length - 2) * 2 + 1], x1 = points[(length - 1) * 2], y1 = points[(length - 1) * 2 + 1], perpx = -(y0 - y1), perpy = x0 - x1, dist = Math.sqrt(perpx * perpx + perpy * perpy), perpx /= dist, perpy /= dist, perpx *= width, perpy *= width, verts.push(
|
||||
x1 - perpx * innerWeight,
|
||||
y1 - perpy * innerWeight,
|
||||
x1 + perpx * outerWeight,
|
||||
y1 + perpy * outerWeight
|
||||
), closedShape || (style.cap === _const.LINE_CAP.ROUND ? indexCount += round(
|
||||
x1 - perpx * (innerWeight - outerWeight) * 0.5,
|
||||
y1 - perpy * (innerWeight - outerWeight) * 0.5,
|
||||
x1 - perpx * innerWeight,
|
||||
y1 - perpy * innerWeight,
|
||||
x1 + perpx * outerWeight,
|
||||
y1 + perpy * outerWeight,
|
||||
verts,
|
||||
!1
|
||||
) + 2 : style.cap === _const.LINE_CAP.SQUARE && (indexCount += square(x1, y1, perpx, perpy, innerWeight, outerWeight, !1, verts)));
|
||||
const indices = graphicsGeometry.indices, eps2 = _const.curves.epsilon * _const.curves.epsilon;
|
||||
for (let i = indexStart; i < indexCount + indexStart - 2; ++i)
|
||||
x0 = verts[i * 2], y0 = verts[i * 2 + 1], x1 = verts[(i + 1) * 2], y1 = verts[(i + 1) * 2 + 1], x2 = verts[(i + 2) * 2], y2 = verts[(i + 2) * 2 + 1], !(Math.abs(x0 * (y1 - y2) + x1 * (y2 - y0) + x2 * (y0 - y1)) < eps2) && indices.push(i, i + 1, i + 2);
|
||||
}
|
||||
function buildNativeLine(graphicsData, graphicsGeometry) {
|
||||
let i = 0;
|
||||
const shape = graphicsData.shape, points = graphicsData.points || shape.points, closedShape = shape.type !== core.SHAPES.POLY || shape.closeStroke;
|
||||
if (points.length === 0)
|
||||
return;
|
||||
const verts = graphicsGeometry.points, indices = graphicsGeometry.indices, length = points.length / 2, startIndex = verts.length / 2;
|
||||
let currentIndex = startIndex;
|
||||
for (verts.push(points[0], points[1]), i = 1; i < length; i++)
|
||||
verts.push(points[i * 2], points[i * 2 + 1]), indices.push(currentIndex, currentIndex + 1), currentIndex++;
|
||||
closedShape && indices.push(currentIndex, startIndex);
|
||||
}
|
||||
function buildLine(graphicsData, graphicsGeometry) {
|
||||
graphicsData.lineStyle.native ? buildNativeLine(graphicsData, graphicsGeometry) : buildNonNativeLine(graphicsData, graphicsGeometry);
|
||||
}
|
||||
exports.buildLine = buildLine;
|
||||
//# sourceMappingURL=buildLine.js.map
|
||||
1
resources/app/node_modules/@pixi/graphics/lib/utils/buildLine.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/graphics/lib/utils/buildLine.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
299
resources/app/node_modules/@pixi/graphics/lib/utils/buildLine.mjs
generated
vendored
Normal file
299
resources/app/node_modules/@pixi/graphics/lib/utils/buildLine.mjs
generated
vendored
Normal file
@@ -0,0 +1,299 @@
|
||||
import { Point, SHAPES } from "@pixi/core";
|
||||
import { LINE_CAP, LINE_JOIN, curves } from "../const.mjs";
|
||||
function square(x, y, nx, ny, innerWeight, outerWeight, clockwise, verts) {
|
||||
const ix = x - nx * innerWeight, iy = y - ny * innerWeight, ox = x + nx * outerWeight, oy = y + ny * outerWeight;
|
||||
let exx, eyy;
|
||||
clockwise ? (exx = ny, eyy = -nx) : (exx = -ny, eyy = nx);
|
||||
const eix = ix + exx, eiy = iy + eyy, eox = ox + exx, eoy = oy + eyy;
|
||||
return verts.push(
|
||||
eix,
|
||||
eiy,
|
||||
eox,
|
||||
eoy
|
||||
), 2;
|
||||
}
|
||||
function round(cx, cy, sx, sy, ex, ey, verts, clockwise) {
|
||||
const cx2p0x = sx - cx, cy2p0y = sy - cy;
|
||||
let angle0 = Math.atan2(cx2p0x, cy2p0y), angle1 = Math.atan2(ex - cx, ey - cy);
|
||||
clockwise && angle0 < angle1 ? angle0 += Math.PI * 2 : !clockwise && angle0 > angle1 && (angle1 += Math.PI * 2);
|
||||
let startAngle = angle0;
|
||||
const angleDiff = angle1 - angle0, absAngleDiff = Math.abs(angleDiff), radius = Math.sqrt(cx2p0x * cx2p0x + cy2p0y * cy2p0y), segCount = (15 * absAngleDiff * Math.sqrt(radius) / Math.PI >> 0) + 1, angleInc = angleDiff / segCount;
|
||||
if (startAngle += angleInc, clockwise) {
|
||||
verts.push(
|
||||
cx,
|
||||
cy,
|
||||
sx,
|
||||
sy
|
||||
);
|
||||
for (let i = 1, angle = startAngle; i < segCount; i++, angle += angleInc)
|
||||
verts.push(
|
||||
cx,
|
||||
cy,
|
||||
cx + Math.sin(angle) * radius,
|
||||
cy + Math.cos(angle) * radius
|
||||
);
|
||||
verts.push(
|
||||
cx,
|
||||
cy,
|
||||
ex,
|
||||
ey
|
||||
);
|
||||
} else {
|
||||
verts.push(
|
||||
sx,
|
||||
sy,
|
||||
cx,
|
||||
cy
|
||||
);
|
||||
for (let i = 1, angle = startAngle; i < segCount; i++, angle += angleInc)
|
||||
verts.push(
|
||||
cx + Math.sin(angle) * radius,
|
||||
cy + Math.cos(angle) * radius,
|
||||
cx,
|
||||
cy
|
||||
);
|
||||
verts.push(
|
||||
ex,
|
||||
ey,
|
||||
cx,
|
||||
cy
|
||||
);
|
||||
}
|
||||
return segCount * 2;
|
||||
}
|
||||
function buildNonNativeLine(graphicsData, graphicsGeometry) {
|
||||
const shape = graphicsData.shape;
|
||||
let points = graphicsData.points || shape.points.slice();
|
||||
const eps = graphicsGeometry.closePointEps;
|
||||
if (points.length === 0)
|
||||
return;
|
||||
const style = graphicsData.lineStyle, firstPoint = new Point(points[0], points[1]), lastPoint = new Point(points[points.length - 2], points[points.length - 1]), closedShape = shape.type !== SHAPES.POLY || shape.closeStroke, closedPath = Math.abs(firstPoint.x - lastPoint.x) < eps && Math.abs(firstPoint.y - lastPoint.y) < eps;
|
||||
if (closedShape) {
|
||||
points = points.slice(), closedPath && (points.pop(), points.pop(), lastPoint.set(points[points.length - 2], points[points.length - 1]));
|
||||
const midPointX = (firstPoint.x + lastPoint.x) * 0.5, midPointY = (lastPoint.y + firstPoint.y) * 0.5;
|
||||
points.unshift(midPointX, midPointY), points.push(midPointX, midPointY);
|
||||
}
|
||||
const verts = graphicsGeometry.points, length = points.length / 2;
|
||||
let indexCount = points.length;
|
||||
const indexStart = verts.length / 2, width = style.width / 2, widthSquared = width * width, miterLimitSquared = style.miterLimit * style.miterLimit;
|
||||
let x0 = points[0], y0 = points[1], x1 = points[2], y1 = points[3], x2 = 0, y2 = 0, perpx = -(y0 - y1), perpy = x0 - x1, perp1x = 0, perp1y = 0, dist = Math.sqrt(perpx * perpx + perpy * perpy);
|
||||
perpx /= dist, perpy /= dist, perpx *= width, perpy *= width;
|
||||
const ratio = style.alignment, innerWeight = (1 - ratio) * 2, outerWeight = ratio * 2;
|
||||
closedShape || (style.cap === LINE_CAP.ROUND ? indexCount += round(
|
||||
x0 - perpx * (innerWeight - outerWeight) * 0.5,
|
||||
y0 - perpy * (innerWeight - outerWeight) * 0.5,
|
||||
x0 - perpx * innerWeight,
|
||||
y0 - perpy * innerWeight,
|
||||
x0 + perpx * outerWeight,
|
||||
y0 + perpy * outerWeight,
|
||||
verts,
|
||||
!0
|
||||
) + 2 : style.cap === LINE_CAP.SQUARE && (indexCount += square(x0, y0, perpx, perpy, innerWeight, outerWeight, !0, verts))), verts.push(
|
||||
x0 - perpx * innerWeight,
|
||||
y0 - perpy * innerWeight,
|
||||
x0 + perpx * outerWeight,
|
||||
y0 + perpy * outerWeight
|
||||
);
|
||||
for (let i = 1; i < length - 1; ++i) {
|
||||
x0 = points[(i - 1) * 2], y0 = points[(i - 1) * 2 + 1], x1 = points[i * 2], y1 = points[i * 2 + 1], x2 = points[(i + 1) * 2], y2 = points[(i + 1) * 2 + 1], perpx = -(y0 - y1), perpy = x0 - x1, dist = Math.sqrt(perpx * perpx + perpy * perpy), perpx /= dist, perpy /= dist, perpx *= width, perpy *= width, perp1x = -(y1 - y2), perp1y = x1 - x2, dist = Math.sqrt(perp1x * perp1x + perp1y * perp1y), perp1x /= dist, perp1y /= dist, perp1x *= width, perp1y *= width;
|
||||
const dx0 = x1 - x0, dy0 = y0 - y1, dx1 = x1 - x2, dy1 = y2 - y1, dot = dx0 * dx1 + dy0 * dy1, cross = dy0 * dx1 - dy1 * dx0, clockwise = cross < 0;
|
||||
if (Math.abs(cross) < 1e-3 * Math.abs(dot)) {
|
||||
verts.push(
|
||||
x1 - perpx * innerWeight,
|
||||
y1 - perpy * innerWeight,
|
||||
x1 + perpx * outerWeight,
|
||||
y1 + perpy * outerWeight
|
||||
), dot >= 0 && (style.join === LINE_JOIN.ROUND ? indexCount += round(
|
||||
x1,
|
||||
y1,
|
||||
x1 - perpx * innerWeight,
|
||||
y1 - perpy * innerWeight,
|
||||
x1 - perp1x * innerWeight,
|
||||
y1 - perp1y * innerWeight,
|
||||
verts,
|
||||
!1
|
||||
) + 4 : indexCount += 2, verts.push(
|
||||
x1 - perp1x * outerWeight,
|
||||
y1 - perp1y * outerWeight,
|
||||
x1 + perp1x * innerWeight,
|
||||
y1 + perp1y * innerWeight
|
||||
));
|
||||
continue;
|
||||
}
|
||||
const c1 = (-perpx + x0) * (-perpy + y1) - (-perpx + x1) * (-perpy + y0), c2 = (-perp1x + x2) * (-perp1y + y1) - (-perp1x + x1) * (-perp1y + y2), px = (dx0 * c2 - dx1 * c1) / cross, py = (dy1 * c1 - dy0 * c2) / cross, pdist = (px - x1) * (px - x1) + (py - y1) * (py - y1), imx = x1 + (px - x1) * innerWeight, imy = y1 + (py - y1) * innerWeight, omx = x1 - (px - x1) * outerWeight, omy = y1 - (py - y1) * outerWeight, smallerInsideSegmentSq = Math.min(dx0 * dx0 + dy0 * dy0, dx1 * dx1 + dy1 * dy1), insideWeight = clockwise ? innerWeight : outerWeight, smallerInsideDiagonalSq = smallerInsideSegmentSq + insideWeight * insideWeight * widthSquared, insideMiterOk = pdist <= smallerInsideDiagonalSq;
|
||||
let join = style.join;
|
||||
if (join === LINE_JOIN.MITER && pdist / widthSquared > miterLimitSquared && (join = LINE_JOIN.BEVEL), insideMiterOk)
|
||||
switch (join) {
|
||||
case LINE_JOIN.MITER: {
|
||||
verts.push(
|
||||
imx,
|
||||
imy,
|
||||
omx,
|
||||
omy
|
||||
);
|
||||
break;
|
||||
}
|
||||
case LINE_JOIN.BEVEL: {
|
||||
clockwise ? verts.push(
|
||||
imx,
|
||||
imy,
|
||||
// inner miter point
|
||||
x1 + perpx * outerWeight,
|
||||
y1 + perpy * outerWeight,
|
||||
// first segment's outer vertex
|
||||
imx,
|
||||
imy,
|
||||
// inner miter point
|
||||
x1 + perp1x * outerWeight,
|
||||
y1 + perp1y * outerWeight
|
||||
) : verts.push(
|
||||
x1 - perpx * innerWeight,
|
||||
y1 - perpy * innerWeight,
|
||||
// first segment's inner vertex
|
||||
omx,
|
||||
omy,
|
||||
// outer miter point
|
||||
x1 - perp1x * innerWeight,
|
||||
y1 - perp1y * innerWeight,
|
||||
// second segment's outer vertex
|
||||
omx,
|
||||
omy
|
||||
), indexCount += 2;
|
||||
break;
|
||||
}
|
||||
case LINE_JOIN.ROUND: {
|
||||
clockwise ? (verts.push(
|
||||
imx,
|
||||
imy,
|
||||
x1 + perpx * outerWeight,
|
||||
y1 + perpy * outerWeight
|
||||
), indexCount += round(
|
||||
x1,
|
||||
y1,
|
||||
x1 + perpx * outerWeight,
|
||||
y1 + perpy * outerWeight,
|
||||
x1 + perp1x * outerWeight,
|
||||
y1 + perp1y * outerWeight,
|
||||
verts,
|
||||
!0
|
||||
) + 4, verts.push(
|
||||
imx,
|
||||
imy,
|
||||
x1 + perp1x * outerWeight,
|
||||
y1 + perp1y * outerWeight
|
||||
)) : (verts.push(
|
||||
x1 - perpx * innerWeight,
|
||||
y1 - perpy * innerWeight,
|
||||
omx,
|
||||
omy
|
||||
), indexCount += round(
|
||||
x1,
|
||||
y1,
|
||||
x1 - perpx * innerWeight,
|
||||
y1 - perpy * innerWeight,
|
||||
x1 - perp1x * innerWeight,
|
||||
y1 - perp1y * innerWeight,
|
||||
verts,
|
||||
!1
|
||||
) + 4, verts.push(
|
||||
x1 - perp1x * innerWeight,
|
||||
y1 - perp1y * innerWeight,
|
||||
omx,
|
||||
omy
|
||||
));
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
switch (verts.push(
|
||||
x1 - perpx * innerWeight,
|
||||
y1 - perpy * innerWeight,
|
||||
// first segment's inner vertex
|
||||
x1 + perpx * outerWeight,
|
||||
y1 + perpy * outerWeight
|
||||
), join) {
|
||||
case LINE_JOIN.MITER: {
|
||||
clockwise ? verts.push(
|
||||
omx,
|
||||
omy,
|
||||
// inner miter point
|
||||
omx,
|
||||
omy
|
||||
) : verts.push(
|
||||
imx,
|
||||
imy,
|
||||
// outer miter point
|
||||
imx,
|
||||
imy
|
||||
), indexCount += 2;
|
||||
break;
|
||||
}
|
||||
case LINE_JOIN.ROUND: {
|
||||
clockwise ? indexCount += round(
|
||||
x1,
|
||||
y1,
|
||||
x1 + perpx * outerWeight,
|
||||
y1 + perpy * outerWeight,
|
||||
x1 + perp1x * outerWeight,
|
||||
y1 + perp1y * outerWeight,
|
||||
verts,
|
||||
!0
|
||||
) + 2 : indexCount += round(
|
||||
x1,
|
||||
y1,
|
||||
x1 - perpx * innerWeight,
|
||||
y1 - perpy * innerWeight,
|
||||
x1 - perp1x * innerWeight,
|
||||
y1 - perp1y * innerWeight,
|
||||
verts,
|
||||
!1
|
||||
) + 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
verts.push(
|
||||
x1 - perp1x * innerWeight,
|
||||
y1 - perp1y * innerWeight,
|
||||
// second segment's inner vertex
|
||||
x1 + perp1x * outerWeight,
|
||||
y1 + perp1y * outerWeight
|
||||
), indexCount += 2;
|
||||
}
|
||||
}
|
||||
x0 = points[(length - 2) * 2], y0 = points[(length - 2) * 2 + 1], x1 = points[(length - 1) * 2], y1 = points[(length - 1) * 2 + 1], perpx = -(y0 - y1), perpy = x0 - x1, dist = Math.sqrt(perpx * perpx + perpy * perpy), perpx /= dist, perpy /= dist, perpx *= width, perpy *= width, verts.push(
|
||||
x1 - perpx * innerWeight,
|
||||
y1 - perpy * innerWeight,
|
||||
x1 + perpx * outerWeight,
|
||||
y1 + perpy * outerWeight
|
||||
), closedShape || (style.cap === LINE_CAP.ROUND ? indexCount += round(
|
||||
x1 - perpx * (innerWeight - outerWeight) * 0.5,
|
||||
y1 - perpy * (innerWeight - outerWeight) * 0.5,
|
||||
x1 - perpx * innerWeight,
|
||||
y1 - perpy * innerWeight,
|
||||
x1 + perpx * outerWeight,
|
||||
y1 + perpy * outerWeight,
|
||||
verts,
|
||||
!1
|
||||
) + 2 : style.cap === LINE_CAP.SQUARE && (indexCount += square(x1, y1, perpx, perpy, innerWeight, outerWeight, !1, verts)));
|
||||
const indices = graphicsGeometry.indices, eps2 = curves.epsilon * curves.epsilon;
|
||||
for (let i = indexStart; i < indexCount + indexStart - 2; ++i)
|
||||
x0 = verts[i * 2], y0 = verts[i * 2 + 1], x1 = verts[(i + 1) * 2], y1 = verts[(i + 1) * 2 + 1], x2 = verts[(i + 2) * 2], y2 = verts[(i + 2) * 2 + 1], !(Math.abs(x0 * (y1 - y2) + x1 * (y2 - y0) + x2 * (y0 - y1)) < eps2) && indices.push(i, i + 1, i + 2);
|
||||
}
|
||||
function buildNativeLine(graphicsData, graphicsGeometry) {
|
||||
let i = 0;
|
||||
const shape = graphicsData.shape, points = graphicsData.points || shape.points, closedShape = shape.type !== SHAPES.POLY || shape.closeStroke;
|
||||
if (points.length === 0)
|
||||
return;
|
||||
const verts = graphicsGeometry.points, indices = graphicsGeometry.indices, length = points.length / 2, startIndex = verts.length / 2;
|
||||
let currentIndex = startIndex;
|
||||
for (verts.push(points[0], points[1]), i = 1; i < length; i++)
|
||||
verts.push(points[i * 2], points[i * 2 + 1]), indices.push(currentIndex, currentIndex + 1), currentIndex++;
|
||||
closedShape && indices.push(currentIndex, startIndex);
|
||||
}
|
||||
function buildLine(graphicsData, graphicsGeometry) {
|
||||
graphicsData.lineStyle.native ? buildNativeLine(graphicsData, graphicsGeometry) : buildNonNativeLine(graphicsData, graphicsGeometry);
|
||||
}
|
||||
export {
|
||||
buildLine
|
||||
};
|
||||
//# sourceMappingURL=buildLine.mjs.map
|
||||
1
resources/app/node_modules/@pixi/graphics/lib/utils/buildLine.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/graphics/lib/utils/buildLine.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
46
resources/app/node_modules/@pixi/graphics/lib/utils/buildPoly.js
generated
vendored
Normal file
46
resources/app/node_modules/@pixi/graphics/lib/utils/buildPoly.js
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
"use strict";
|
||||
var core = require("@pixi/core");
|
||||
function fixOrientation(points, hole = !1) {
|
||||
const m = points.length;
|
||||
if (m < 6)
|
||||
return;
|
||||
let area = 0;
|
||||
for (let i = 0, x1 = points[m - 2], y1 = points[m - 1]; i < m; i += 2) {
|
||||
const x2 = points[i], y2 = points[i + 1];
|
||||
area += (x2 - x1) * (y2 + y1), x1 = x2, y1 = y2;
|
||||
}
|
||||
if (!hole && area > 0 || hole && area <= 0) {
|
||||
const n = m / 2;
|
||||
for (let i = n + n % 2; i < m; i += 2) {
|
||||
const i1 = m - i - 2, i2 = m - i - 1, i3 = i, i4 = i + 1;
|
||||
[points[i1], points[i3]] = [points[i3], points[i1]], [points[i2], points[i4]] = [points[i4], points[i2]];
|
||||
}
|
||||
}
|
||||
}
|
||||
const buildPoly = {
|
||||
build(graphicsData) {
|
||||
graphicsData.points = graphicsData.shape.points.slice();
|
||||
},
|
||||
triangulate(graphicsData, graphicsGeometry) {
|
||||
let points = graphicsData.points;
|
||||
const holes = graphicsData.holes, verts = graphicsGeometry.points, indices = graphicsGeometry.indices;
|
||||
if (points.length >= 6) {
|
||||
fixOrientation(points, !1);
|
||||
const holeArray = [];
|
||||
for (let i = 0; i < holes.length; i++) {
|
||||
const hole = holes[i];
|
||||
fixOrientation(hole.points, !0), holeArray.push(points.length / 2), points = points.concat(hole.points);
|
||||
}
|
||||
const triangles = core.utils.earcut(points, holeArray, 2);
|
||||
if (!triangles)
|
||||
return;
|
||||
const vertPos = verts.length / 2;
|
||||
for (let i = 0; i < triangles.length; i += 3)
|
||||
indices.push(triangles[i] + vertPos), indices.push(triangles[i + 1] + vertPos), indices.push(triangles[i + 2] + vertPos);
|
||||
for (let i = 0; i < points.length; i++)
|
||||
verts.push(points[i]);
|
||||
}
|
||||
}
|
||||
};
|
||||
exports.buildPoly = buildPoly;
|
||||
//# sourceMappingURL=buildPoly.js.map
|
||||
1
resources/app/node_modules/@pixi/graphics/lib/utils/buildPoly.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/graphics/lib/utils/buildPoly.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"buildPoly.js","sources":["../../src/utils/buildPoly.ts"],"sourcesContent":["import { utils } from '@pixi/core';\n\nimport type { Polygon } from '@pixi/core';\nimport type { IShapeBuildCommand } from './IShapeBuildCommand';\n\nfunction fixOrientation(points: number[], hole = false)\n{\n const m = points.length;\n\n if (m < 6)\n {\n return;\n }\n\n let area = 0;\n\n for (let i = 0, x1 = points[m - 2], y1 = points[m - 1]; i < m; i += 2)\n {\n const x2 = points[i];\n const y2 = points[i + 1];\n\n area += (x2 - x1) * (y2 + y1);\n\n x1 = x2;\n y1 = y2;\n }\n\n if ((!hole && area > 0) || (hole && area <= 0))\n {\n const n = m / 2;\n\n for (let i = n + (n % 2); i < m; i += 2)\n {\n const i1 = m - i - 2;\n const i2 = m - i - 1;\n const i3 = i;\n const i4 = i + 1;\n\n [points[i1], points[i3]] = [points[i3], points[i1]];\n [points[i2], points[i4]] = [points[i4], points[i2]];\n }\n }\n}\n/**\n * Builds a polygon to draw\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines\n */\nexport const buildPoly: IShapeBuildCommand = {\n\n build(graphicsData)\n {\n graphicsData.points = (graphicsData.shape as Polygon).points.slice();\n },\n\n triangulate(graphicsData, graphicsGeometry)\n {\n let points = graphicsData.points;\n const holes = graphicsData.holes;\n const verts = graphicsGeometry.points;\n const indices = graphicsGeometry.indices;\n\n if (points.length >= 6)\n {\n fixOrientation(points, false);\n\n const holeArray = [];\n // Process holes..\n\n for (let i = 0; i < holes.length; i++)\n {\n const hole = holes[i];\n\n fixOrientation(hole.points, true);\n\n holeArray.push(points.length / 2);\n points = points.concat(hole.points);\n }\n\n // sort color\n const triangles = utils.earcut(points, holeArray, 2);\n\n if (!triangles)\n {\n return;\n }\n\n const vertPos = verts.length / 2;\n\n for (let i = 0; i < triangles.length; i += 3)\n {\n indices.push(triangles[i] + vertPos);\n indices.push(triangles[i + 1] + vertPos);\n indices.push(triangles[i + 2] + vertPos);\n }\n\n for (let i = 0; i < points.length; i++)\n {\n verts.push(points[i]);\n }\n }\n },\n};\n"],"names":["utils"],"mappings":";;AAKA,SAAS,eAAe,QAAkB,OAAO,IACjD;AACI,QAAM,IAAI,OAAO;AAEjB,MAAI,IAAI;AAEJ;AAGJ,MAAI,OAAO;AAEX,WAAS,IAAI,GAAG,KAAK,OAAO,IAAI,CAAC,GAAG,KAAK,OAAO,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,GACpE;AACI,UAAM,KAAK,OAAO,CAAC,GACb,KAAK,OAAO,IAAI,CAAC;AAEvB,aAAS,KAAK,OAAO,KAAK,KAE1B,KAAK,IACL,KAAK;AAAA,EACT;AAEA,MAAK,CAAC,QAAQ,OAAO,KAAO,QAAQ,QAAQ,GAC5C;AACI,UAAM,IAAI,IAAI;AAEd,aAAS,IAAI,IAAK,IAAI,GAAI,IAAI,GAAG,KAAK,GACtC;AACU,YAAA,KAAK,IAAI,IAAI,GACb,KAAK,IAAI,IAAI,GACb,KAAK,GACL,KAAK,IAAI;AAEf,OAAC,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC,GAClD,CAAC,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC;AAAA,IACtD;AAAA,EACJ;AACJ;AAWO,MAAM,YAAgC;AAAA,EAEzC,MAAM,cACN;AACI,iBAAa,SAAU,aAAa,MAAkB,OAAO,MAAM;AAAA,EACvE;AAAA,EAEA,YAAY,cAAc,kBAC1B;AACI,QAAI,SAAS,aAAa;AAC1B,UAAM,QAAQ,aAAa,OACrB,QAAQ,iBAAiB,QACzB,UAAU,iBAAiB;AAE7B,QAAA,OAAO,UAAU,GACrB;AACI,qBAAe,QAAQ,EAAK;AAE5B,YAAM,YAAY,CAAA;AAGlB,eAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAClC;AACU,cAAA,OAAO,MAAM,CAAC;AAEpB,uBAAe,KAAK,QAAQ,EAAI,GAEhC,UAAU,KAAK,OAAO,SAAS,CAAC,GAChC,SAAS,OAAO,OAAO,KAAK,MAAM;AAAA,MACtC;AAGA,YAAM,YAAYA,KAAAA,MAAM,OAAO,QAAQ,WAAW,CAAC;AAEnD,UAAI,CAAC;AAED;AAGE,YAAA,UAAU,MAAM,SAAS;AAE/B,eAAS,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;AAE/B,gBAAA,KAAK,UAAU,CAAC,IAAI,OAAO,GACnC,QAAQ,KAAK,UAAU,IAAI,CAAC,IAAI,OAAO,GACvC,QAAQ,KAAK,UAAU,IAAI,CAAC,IAAI,OAAO;AAG3C,eAAS,IAAI,GAAG,IAAI,OAAO,QAAQ;AAEzB,cAAA,KAAK,OAAO,CAAC,CAAC;AAAA,IAE5B;AAAA,EACJ;AACJ;;"}
|
||||
47
resources/app/node_modules/@pixi/graphics/lib/utils/buildPoly.mjs
generated
vendored
Normal file
47
resources/app/node_modules/@pixi/graphics/lib/utils/buildPoly.mjs
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
import { utils } from "@pixi/core";
|
||||
function fixOrientation(points, hole = !1) {
|
||||
const m = points.length;
|
||||
if (m < 6)
|
||||
return;
|
||||
let area = 0;
|
||||
for (let i = 0, x1 = points[m - 2], y1 = points[m - 1]; i < m; i += 2) {
|
||||
const x2 = points[i], y2 = points[i + 1];
|
||||
area += (x2 - x1) * (y2 + y1), x1 = x2, y1 = y2;
|
||||
}
|
||||
if (!hole && area > 0 || hole && area <= 0) {
|
||||
const n = m / 2;
|
||||
for (let i = n + n % 2; i < m; i += 2) {
|
||||
const i1 = m - i - 2, i2 = m - i - 1, i3 = i, i4 = i + 1;
|
||||
[points[i1], points[i3]] = [points[i3], points[i1]], [points[i2], points[i4]] = [points[i4], points[i2]];
|
||||
}
|
||||
}
|
||||
}
|
||||
const buildPoly = {
|
||||
build(graphicsData) {
|
||||
graphicsData.points = graphicsData.shape.points.slice();
|
||||
},
|
||||
triangulate(graphicsData, graphicsGeometry) {
|
||||
let points = graphicsData.points;
|
||||
const holes = graphicsData.holes, verts = graphicsGeometry.points, indices = graphicsGeometry.indices;
|
||||
if (points.length >= 6) {
|
||||
fixOrientation(points, !1);
|
||||
const holeArray = [];
|
||||
for (let i = 0; i < holes.length; i++) {
|
||||
const hole = holes[i];
|
||||
fixOrientation(hole.points, !0), holeArray.push(points.length / 2), points = points.concat(hole.points);
|
||||
}
|
||||
const triangles = utils.earcut(points, holeArray, 2);
|
||||
if (!triangles)
|
||||
return;
|
||||
const vertPos = verts.length / 2;
|
||||
for (let i = 0; i < triangles.length; i += 3)
|
||||
indices.push(triangles[i] + vertPos), indices.push(triangles[i + 1] + vertPos), indices.push(triangles[i + 2] + vertPos);
|
||||
for (let i = 0; i < points.length; i++)
|
||||
verts.push(points[i]);
|
||||
}
|
||||
}
|
||||
};
|
||||
export {
|
||||
buildPoly
|
||||
};
|
||||
//# sourceMappingURL=buildPoly.mjs.map
|
||||
1
resources/app/node_modules/@pixi/graphics/lib/utils/buildPoly.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/graphics/lib/utils/buildPoly.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"buildPoly.mjs","sources":["../../src/utils/buildPoly.ts"],"sourcesContent":["import { utils } from '@pixi/core';\n\nimport type { Polygon } from '@pixi/core';\nimport type { IShapeBuildCommand } from './IShapeBuildCommand';\n\nfunction fixOrientation(points: number[], hole = false)\n{\n const m = points.length;\n\n if (m < 6)\n {\n return;\n }\n\n let area = 0;\n\n for (let i = 0, x1 = points[m - 2], y1 = points[m - 1]; i < m; i += 2)\n {\n const x2 = points[i];\n const y2 = points[i + 1];\n\n area += (x2 - x1) * (y2 + y1);\n\n x1 = x2;\n y1 = y2;\n }\n\n if ((!hole && area > 0) || (hole && area <= 0))\n {\n const n = m / 2;\n\n for (let i = n + (n % 2); i < m; i += 2)\n {\n const i1 = m - i - 2;\n const i2 = m - i - 1;\n const i3 = i;\n const i4 = i + 1;\n\n [points[i1], points[i3]] = [points[i3], points[i1]];\n [points[i2], points[i4]] = [points[i4], points[i2]];\n }\n }\n}\n/**\n * Builds a polygon to draw\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines\n */\nexport const buildPoly: IShapeBuildCommand = {\n\n build(graphicsData)\n {\n graphicsData.points = (graphicsData.shape as Polygon).points.slice();\n },\n\n triangulate(graphicsData, graphicsGeometry)\n {\n let points = graphicsData.points;\n const holes = graphicsData.holes;\n const verts = graphicsGeometry.points;\n const indices = graphicsGeometry.indices;\n\n if (points.length >= 6)\n {\n fixOrientation(points, false);\n\n const holeArray = [];\n // Process holes..\n\n for (let i = 0; i < holes.length; i++)\n {\n const hole = holes[i];\n\n fixOrientation(hole.points, true);\n\n holeArray.push(points.length / 2);\n points = points.concat(hole.points);\n }\n\n // sort color\n const triangles = utils.earcut(points, holeArray, 2);\n\n if (!triangles)\n {\n return;\n }\n\n const vertPos = verts.length / 2;\n\n for (let i = 0; i < triangles.length; i += 3)\n {\n indices.push(triangles[i] + vertPos);\n indices.push(triangles[i + 1] + vertPos);\n indices.push(triangles[i + 2] + vertPos);\n }\n\n for (let i = 0; i < points.length; i++)\n {\n verts.push(points[i]);\n }\n }\n },\n};\n"],"names":[],"mappings":";AAKA,SAAS,eAAe,QAAkB,OAAO,IACjD;AACI,QAAM,IAAI,OAAO;AAEjB,MAAI,IAAI;AAEJ;AAGJ,MAAI,OAAO;AAEX,WAAS,IAAI,GAAG,KAAK,OAAO,IAAI,CAAC,GAAG,KAAK,OAAO,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,GACpE;AACI,UAAM,KAAK,OAAO,CAAC,GACb,KAAK,OAAO,IAAI,CAAC;AAEvB,aAAS,KAAK,OAAO,KAAK,KAE1B,KAAK,IACL,KAAK;AAAA,EACT;AAEA,MAAK,CAAC,QAAQ,OAAO,KAAO,QAAQ,QAAQ,GAC5C;AACI,UAAM,IAAI,IAAI;AAEd,aAAS,IAAI,IAAK,IAAI,GAAI,IAAI,GAAG,KAAK,GACtC;AACU,YAAA,KAAK,IAAI,IAAI,GACb,KAAK,IAAI,IAAI,GACb,KAAK,GACL,KAAK,IAAI;AAEf,OAAC,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC,GAClD,CAAC,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC;AAAA,IACtD;AAAA,EACJ;AACJ;AAWO,MAAM,YAAgC;AAAA,EAEzC,MAAM,cACN;AACI,iBAAa,SAAU,aAAa,MAAkB,OAAO,MAAM;AAAA,EACvE;AAAA,EAEA,YAAY,cAAc,kBAC1B;AACI,QAAI,SAAS,aAAa;AAC1B,UAAM,QAAQ,aAAa,OACrB,QAAQ,iBAAiB,QACzB,UAAU,iBAAiB;AAE7B,QAAA,OAAO,UAAU,GACrB;AACI,qBAAe,QAAQ,EAAK;AAE5B,YAAM,YAAY,CAAA;AAGlB,eAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAClC;AACU,cAAA,OAAO,MAAM,CAAC;AAEpB,uBAAe,KAAK,QAAQ,EAAI,GAEhC,UAAU,KAAK,OAAO,SAAS,CAAC,GAChC,SAAS,OAAO,OAAO,KAAK,MAAM;AAAA,MACtC;AAGA,YAAM,YAAY,MAAM,OAAO,QAAQ,WAAW,CAAC;AAEnD,UAAI,CAAC;AAED;AAGE,YAAA,UAAU,MAAM,SAAS;AAE/B,eAAS,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;AAE/B,gBAAA,KAAK,UAAU,CAAC,IAAI,OAAO,GACnC,QAAQ,KAAK,UAAU,IAAI,CAAC,IAAI,OAAO,GACvC,QAAQ,KAAK,UAAU,IAAI,CAAC,IAAI,OAAO;AAG3C,eAAS,IAAI,GAAG,IAAI,OAAO,QAAQ;AAEzB,cAAA,KAAK,OAAO,CAAC,CAAC;AAAA,IAE5B;AAAA,EACJ;AACJ;"}
|
||||
41
resources/app/node_modules/@pixi/graphics/lib/utils/buildRectangle.js
generated
vendored
Normal file
41
resources/app/node_modules/@pixi/graphics/lib/utils/buildRectangle.js
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
"use strict";
|
||||
const buildRectangle = {
|
||||
build(graphicsData) {
|
||||
const rectData = graphicsData.shape, x = rectData.x, y = rectData.y, width = rectData.width, height = rectData.height, points = graphicsData.points;
|
||||
points.length = 0, width >= 0 && height >= 0 && points.push(
|
||||
x,
|
||||
y,
|
||||
x + width,
|
||||
y,
|
||||
x + width,
|
||||
y + height,
|
||||
x,
|
||||
y + height
|
||||
);
|
||||
},
|
||||
triangulate(graphicsData, graphicsGeometry) {
|
||||
const points = graphicsData.points, verts = graphicsGeometry.points;
|
||||
if (points.length === 0)
|
||||
return;
|
||||
const vertPos = verts.length / 2;
|
||||
verts.push(
|
||||
points[0],
|
||||
points[1],
|
||||
points[2],
|
||||
points[3],
|
||||
points[6],
|
||||
points[7],
|
||||
points[4],
|
||||
points[5]
|
||||
), graphicsGeometry.indices.push(
|
||||
vertPos,
|
||||
vertPos + 1,
|
||||
vertPos + 2,
|
||||
vertPos + 1,
|
||||
vertPos + 2,
|
||||
vertPos + 3
|
||||
);
|
||||
}
|
||||
};
|
||||
exports.buildRectangle = buildRectangle;
|
||||
//# sourceMappingURL=buildRectangle.js.map
|
||||
1
resources/app/node_modules/@pixi/graphics/lib/utils/buildRectangle.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/graphics/lib/utils/buildRectangle.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"buildRectangle.js","sources":["../../src/utils/buildRectangle.ts"],"sourcesContent":["import type { Rectangle } from '@pixi/core';\nimport type { IShapeBuildCommand } from './IShapeBuildCommand';\n\n/**\n * Builds a rectangle to draw\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines\n */\nexport const buildRectangle: IShapeBuildCommand = {\n\n build(graphicsData)\n {\n // --- //\n // need to convert points to a nice regular data\n //\n const rectData = graphicsData.shape as Rectangle;\n const x = rectData.x;\n const y = rectData.y;\n const width = rectData.width;\n const height = rectData.height;\n\n const points = graphicsData.points;\n\n points.length = 0;\n\n if (!(width >= 0 && height >= 0))\n {\n return;\n }\n\n points.push(x, y,\n x + width, y,\n x + width, y + height,\n x, y + height);\n },\n\n triangulate(graphicsData, graphicsGeometry)\n {\n const points = graphicsData.points;\n const verts = graphicsGeometry.points;\n\n if (points.length === 0)\n {\n return;\n }\n\n const vertPos = verts.length / 2;\n\n verts.push(points[0], points[1],\n points[2], points[3],\n points[6], points[7],\n points[4], points[5]);\n\n graphicsGeometry.indices.push(vertPos, vertPos + 1, vertPos + 2,\n vertPos + 1, vertPos + 2, vertPos + 3);\n },\n};\n"],"names":[],"mappings":";AAaO,MAAM,iBAAqC;AAAA,EAE9C,MAAM,cACN;AAII,UAAM,WAAW,aAAa,OACxB,IAAI,SAAS,GACb,IAAI,SAAS,GACb,QAAQ,SAAS,OACjB,SAAS,SAAS,QAElB,SAAS,aAAa;AAE5B,WAAO,SAAS,GAEV,SAAS,KAAK,UAAU,KAK9B,OAAO;AAAA,MAAK;AAAA,MAAG;AAAA,MACX,IAAI;AAAA,MAAO;AAAA,MACX,IAAI;AAAA,MAAO,IAAI;AAAA,MACf;AAAA,MAAG,IAAI;AAAA,IAAA;AAAA,EACf;AAAA,EAEA,YAAY,cAAc,kBAC1B;AACI,UAAM,SAAS,aAAa,QACtB,QAAQ,iBAAiB;AAE/B,QAAI,OAAO,WAAW;AAElB;AAGE,UAAA,UAAU,MAAM,SAAS;AAEzB,UAAA;AAAA,MAAK,OAAO,CAAC;AAAA,MAAG,OAAO,CAAC;AAAA,MAC1B,OAAO,CAAC;AAAA,MAAG,OAAO,CAAC;AAAA,MACnB,OAAO,CAAC;AAAA,MAAG,OAAO,CAAC;AAAA,MACnB,OAAO,CAAC;AAAA,MAAG,OAAO,CAAC;AAAA,IAAA,GAEvB,iBAAiB,QAAQ;AAAA,MAAK;AAAA,MAAS,UAAU;AAAA,MAAG,UAAU;AAAA,MAC1D,UAAU;AAAA,MAAG,UAAU;AAAA,MAAG,UAAU;AAAA,IAAA;AAAA,EAC5C;AACJ;;"}
|
||||
42
resources/app/node_modules/@pixi/graphics/lib/utils/buildRectangle.mjs
generated
vendored
Normal file
42
resources/app/node_modules/@pixi/graphics/lib/utils/buildRectangle.mjs
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
const buildRectangle = {
|
||||
build(graphicsData) {
|
||||
const rectData = graphicsData.shape, x = rectData.x, y = rectData.y, width = rectData.width, height = rectData.height, points = graphicsData.points;
|
||||
points.length = 0, width >= 0 && height >= 0 && points.push(
|
||||
x,
|
||||
y,
|
||||
x + width,
|
||||
y,
|
||||
x + width,
|
||||
y + height,
|
||||
x,
|
||||
y + height
|
||||
);
|
||||
},
|
||||
triangulate(graphicsData, graphicsGeometry) {
|
||||
const points = graphicsData.points, verts = graphicsGeometry.points;
|
||||
if (points.length === 0)
|
||||
return;
|
||||
const vertPos = verts.length / 2;
|
||||
verts.push(
|
||||
points[0],
|
||||
points[1],
|
||||
points[2],
|
||||
points[3],
|
||||
points[6],
|
||||
points[7],
|
||||
points[4],
|
||||
points[5]
|
||||
), graphicsGeometry.indices.push(
|
||||
vertPos,
|
||||
vertPos + 1,
|
||||
vertPos + 2,
|
||||
vertPos + 1,
|
||||
vertPos + 2,
|
||||
vertPos + 3
|
||||
);
|
||||
}
|
||||
};
|
||||
export {
|
||||
buildRectangle
|
||||
};
|
||||
//# sourceMappingURL=buildRectangle.mjs.map
|
||||
1
resources/app/node_modules/@pixi/graphics/lib/utils/buildRectangle.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/graphics/lib/utils/buildRectangle.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"buildRectangle.mjs","sources":["../../src/utils/buildRectangle.ts"],"sourcesContent":["import type { Rectangle } from '@pixi/core';\nimport type { IShapeBuildCommand } from './IShapeBuildCommand';\n\n/**\n * Builds a rectangle to draw\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines\n */\nexport const buildRectangle: IShapeBuildCommand = {\n\n build(graphicsData)\n {\n // --- //\n // need to convert points to a nice regular data\n //\n const rectData = graphicsData.shape as Rectangle;\n const x = rectData.x;\n const y = rectData.y;\n const width = rectData.width;\n const height = rectData.height;\n\n const points = graphicsData.points;\n\n points.length = 0;\n\n if (!(width >= 0 && height >= 0))\n {\n return;\n }\n\n points.push(x, y,\n x + width, y,\n x + width, y + height,\n x, y + height);\n },\n\n triangulate(graphicsData, graphicsGeometry)\n {\n const points = graphicsData.points;\n const verts = graphicsGeometry.points;\n\n if (points.length === 0)\n {\n return;\n }\n\n const vertPos = verts.length / 2;\n\n verts.push(points[0], points[1],\n points[2], points[3],\n points[6], points[7],\n points[4], points[5]);\n\n graphicsGeometry.indices.push(vertPos, vertPos + 1, vertPos + 2,\n vertPos + 1, vertPos + 2, vertPos + 3);\n },\n};\n"],"names":[],"mappings":"AAaO,MAAM,iBAAqC;AAAA,EAE9C,MAAM,cACN;AAII,UAAM,WAAW,aAAa,OACxB,IAAI,SAAS,GACb,IAAI,SAAS,GACb,QAAQ,SAAS,OACjB,SAAS,SAAS,QAElB,SAAS,aAAa;AAE5B,WAAO,SAAS,GAEV,SAAS,KAAK,UAAU,KAK9B,OAAO;AAAA,MAAK;AAAA,MAAG;AAAA,MACX,IAAI;AAAA,MAAO;AAAA,MACX,IAAI;AAAA,MAAO,IAAI;AAAA,MACf;AAAA,MAAG,IAAI;AAAA,IAAA;AAAA,EACf;AAAA,EAEA,YAAY,cAAc,kBAC1B;AACI,UAAM,SAAS,aAAa,QACtB,QAAQ,iBAAiB;AAE/B,QAAI,OAAO,WAAW;AAElB;AAGE,UAAA,UAAU,MAAM,SAAS;AAEzB,UAAA;AAAA,MAAK,OAAO,CAAC;AAAA,MAAG,OAAO,CAAC;AAAA,MAC1B,OAAO,CAAC;AAAA,MAAG,OAAO,CAAC;AAAA,MACnB,OAAO,CAAC;AAAA,MAAG,OAAO,CAAC;AAAA,MACnB,OAAO,CAAC;AAAA,MAAG,OAAO,CAAC;AAAA,IAAA,GAEvB,iBAAiB,QAAQ;AAAA,MAAK;AAAA,MAAS,UAAU;AAAA,MAAG,UAAU;AAAA,MAC1D,UAAU;AAAA,MAAG,UAAU;AAAA,MAAG,UAAU;AAAA,IAAA;AAAA,EAC5C;AACJ;"}
|
||||
12
resources/app/node_modules/@pixi/graphics/lib/utils/buildRoundedRectangle.js
generated
vendored
Normal file
12
resources/app/node_modules/@pixi/graphics/lib/utils/buildRoundedRectangle.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
var buildCircle = require("./buildCircle.js");
|
||||
const buildRoundedRectangle = {
|
||||
build(graphicsData) {
|
||||
buildCircle.buildCircle.build(graphicsData);
|
||||
},
|
||||
triangulate(graphicsData, graphicsGeometry) {
|
||||
buildCircle.buildCircle.triangulate(graphicsData, graphicsGeometry);
|
||||
}
|
||||
};
|
||||
exports.buildRoundedRectangle = buildRoundedRectangle;
|
||||
//# sourceMappingURL=buildRoundedRectangle.js.map
|
||||
1
resources/app/node_modules/@pixi/graphics/lib/utils/buildRoundedRectangle.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/graphics/lib/utils/buildRoundedRectangle.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"buildRoundedRectangle.js","sources":["../../src/utils/buildRoundedRectangle.ts"],"sourcesContent":["// for type only\nimport { buildCircle } from './buildCircle';\n\nimport type { IShapeBuildCommand } from './IShapeBuildCommand';\n\n/**\n * Builds a rounded rectangle to draw\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines\n */\nexport const buildRoundedRectangle: IShapeBuildCommand = {\n\n build(graphicsData)\n {\n buildCircle.build(graphicsData);\n },\n\n triangulate(graphicsData, graphicsGeometry)\n {\n buildCircle.triangulate(graphicsData, graphicsGeometry);\n },\n};\n"],"names":["buildCircle"],"mappings":";;AAeO,MAAM,wBAA4C;AAAA,EAErD,MAAM,cACN;AACIA,4BAAY,MAAM,YAAY;AAAA,EAClC;AAAA,EAEA,YAAY,cAAc,kBAC1B;AACgBA,gBAAAA,YAAA,YAAY,cAAc,gBAAgB;AAAA,EAC1D;AACJ;;"}
|
||||
13
resources/app/node_modules/@pixi/graphics/lib/utils/buildRoundedRectangle.mjs
generated
vendored
Normal file
13
resources/app/node_modules/@pixi/graphics/lib/utils/buildRoundedRectangle.mjs
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { buildCircle } from "./buildCircle.mjs";
|
||||
const buildRoundedRectangle = {
|
||||
build(graphicsData) {
|
||||
buildCircle.build(graphicsData);
|
||||
},
|
||||
triangulate(graphicsData, graphicsGeometry) {
|
||||
buildCircle.triangulate(graphicsData, graphicsGeometry);
|
||||
}
|
||||
};
|
||||
export {
|
||||
buildRoundedRectangle
|
||||
};
|
||||
//# sourceMappingURL=buildRoundedRectangle.mjs.map
|
||||
1
resources/app/node_modules/@pixi/graphics/lib/utils/buildRoundedRectangle.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/graphics/lib/utils/buildRoundedRectangle.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"buildRoundedRectangle.mjs","sources":["../../src/utils/buildRoundedRectangle.ts"],"sourcesContent":["// for type only\nimport { buildCircle } from './buildCircle';\n\nimport type { IShapeBuildCommand } from './IShapeBuildCommand';\n\n/**\n * Builds a rounded rectangle to draw\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines\n */\nexport const buildRoundedRectangle: IShapeBuildCommand = {\n\n build(graphicsData)\n {\n buildCircle.build(graphicsData);\n },\n\n triangulate(graphicsData, graphicsGeometry)\n {\n buildCircle.triangulate(graphicsData, graphicsGeometry);\n },\n};\n"],"names":[],"mappings":";AAeO,MAAM,wBAA4C;AAAA,EAErD,MAAM,cACN;AACI,gBAAY,MAAM,YAAY;AAAA,EAClC;AAAA,EAEA,YAAY,cAAc,kBAC1B;AACgB,gBAAA,YAAY,cAAc,gBAAgB;AAAA,EAC1D;AACJ;"}
|
||||
22
resources/app/node_modules/@pixi/graphics/lib/utils/index.js
generated
vendored
Normal file
22
resources/app/node_modules/@pixi/graphics/lib/utils/index.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
var core = require("@pixi/core"), buildCircle = require("./buildCircle.js"), buildPoly = require("./buildPoly.js"), buildRectangle = require("./buildRectangle.js"), buildRoundedRectangle = require("./buildRoundedRectangle.js"), ArcUtils = require("./ArcUtils.js"), BatchPart = require("./BatchPart.js"), BezierUtils = require("./BezierUtils.js"), buildLine = require("./buildLine.js"), QuadraticUtils = require("./QuadraticUtils.js");
|
||||
const FILL_COMMANDS = {
|
||||
[core.SHAPES.POLY]: buildPoly.buildPoly,
|
||||
[core.SHAPES.CIRC]: buildCircle.buildCircle,
|
||||
[core.SHAPES.ELIP]: buildCircle.buildCircle,
|
||||
[core.SHAPES.RECT]: buildRectangle.buildRectangle,
|
||||
[core.SHAPES.RREC]: buildRoundedRectangle.buildRoundedRectangle
|
||||
}, BATCH_POOL = [], DRAW_CALL_POOL = [];
|
||||
exports.buildCircle = buildCircle.buildCircle;
|
||||
exports.buildPoly = buildPoly.buildPoly;
|
||||
exports.buildRectangle = buildRectangle.buildRectangle;
|
||||
exports.buildRoundedRectangle = buildRoundedRectangle.buildRoundedRectangle;
|
||||
exports.ArcUtils = ArcUtils.ArcUtils;
|
||||
exports.BatchPart = BatchPart.BatchPart;
|
||||
exports.BezierUtils = BezierUtils.BezierUtils;
|
||||
exports.buildLine = buildLine.buildLine;
|
||||
exports.QuadraticUtils = QuadraticUtils.QuadraticUtils;
|
||||
exports.BATCH_POOL = BATCH_POOL;
|
||||
exports.DRAW_CALL_POOL = DRAW_CALL_POOL;
|
||||
exports.FILL_COMMANDS = FILL_COMMANDS;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
resources/app/node_modules/@pixi/graphics/lib/utils/index.js.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/graphics/lib/utils/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sources":["../../src/utils/index.ts"],"sourcesContent":["/**\n * Generalized convenience utilities for Graphics.\n * @namespace graphicsUtils\n * @memberof PIXI\n */\n\n// for type only\nimport { SHAPES } from '@pixi/core';\nimport { buildCircle } from './buildCircle';\nimport { buildPoly } from './buildPoly';\nimport { buildRectangle } from './buildRectangle';\nimport { buildRoundedRectangle } from './buildRoundedRectangle';\n\nimport type { BatchDrawCall } from '@pixi/core';\nimport type { BatchPart } from './BatchPart';\nimport type { IShapeBuildCommand } from './IShapeBuildCommand';\n\nexport * from './ArcUtils';\nexport * from './BatchPart';\nexport * from './BezierUtils';\nexport * from './buildCircle';\nexport * from './buildLine';\nexport * from './buildPoly';\nexport * from './buildRectangle';\nexport * from './buildRoundedRectangle';\nexport * from './QuadraticUtils';\n\n/**\n * Map of fill commands for each shape type.\n * @memberof PIXI.graphicsUtils\n * @member {object} FILL_COMMANDS\n */\nexport const FILL_COMMANDS: Record<SHAPES, IShapeBuildCommand> = {\n [SHAPES.POLY]: buildPoly,\n [SHAPES.CIRC]: buildCircle,\n [SHAPES.ELIP]: buildCircle,\n [SHAPES.RECT]: buildRectangle,\n [SHAPES.RREC]: buildRoundedRectangle,\n};\n\n/**\n * Batch pool, stores unused batches for preventing allocations.\n * @memberof PIXI.graphicsUtils\n * @member {Array<PIXI.graphicsUtils.BatchPart>} BATCH_POOL\n */\nexport const BATCH_POOL: Array<BatchPart> = [];\n\n/**\n * Draw call pool, stores unused draw calls for preventing allocations.\n * @memberof PIXI.graphicsUtils\n * @member {Array<PIXI.BatchDrawCall>} DRAW_CALL_POOL\n */\nexport const DRAW_CALL_POOL: Array<BatchDrawCall> = [];\n"],"names":["SHAPES","buildPoly","buildCircle","buildRectangle","buildRoundedRectangle"],"mappings":";;AAgCO,MAAM,gBAAoD;AAAA,EAC7D,CAACA,KAAAA,OAAO,IAAI,GAAGC,UAAA;AAAA,EACf,CAACD,KAAAA,OAAO,IAAI,GAAGE,YAAA;AAAA,EACf,CAACF,KAAAA,OAAO,IAAI,GAAGE,YAAA;AAAA,EACf,CAACF,KAAAA,OAAO,IAAI,GAAGG,eAAA;AAAA,EACf,CAACH,KAAAA,OAAO,IAAI,GAAGI,sBAAA;AACnB,GAOa,aAA+B,IAO/B,iBAAuC,CAAA;;;;;;;;;;;;;"}
|
||||
32
resources/app/node_modules/@pixi/graphics/lib/utils/index.mjs
generated
vendored
Normal file
32
resources/app/node_modules/@pixi/graphics/lib/utils/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
import { SHAPES } from "@pixi/core";
|
||||
import { buildCircle } from "./buildCircle.mjs";
|
||||
import { buildPoly } from "./buildPoly.mjs";
|
||||
import { buildRectangle } from "./buildRectangle.mjs";
|
||||
import { buildRoundedRectangle } from "./buildRoundedRectangle.mjs";
|
||||
import { ArcUtils } from "./ArcUtils.mjs";
|
||||
import { BatchPart } from "./BatchPart.mjs";
|
||||
import { BezierUtils } from "./BezierUtils.mjs";
|
||||
import { buildLine } from "./buildLine.mjs";
|
||||
import { QuadraticUtils } from "./QuadraticUtils.mjs";
|
||||
const FILL_COMMANDS = {
|
||||
[SHAPES.POLY]: buildPoly,
|
||||
[SHAPES.CIRC]: buildCircle,
|
||||
[SHAPES.ELIP]: buildCircle,
|
||||
[SHAPES.RECT]: buildRectangle,
|
||||
[SHAPES.RREC]: buildRoundedRectangle
|
||||
}, BATCH_POOL = [], DRAW_CALL_POOL = [];
|
||||
export {
|
||||
ArcUtils,
|
||||
BATCH_POOL,
|
||||
BatchPart,
|
||||
BezierUtils,
|
||||
DRAW_CALL_POOL,
|
||||
FILL_COMMANDS,
|
||||
QuadraticUtils,
|
||||
buildCircle,
|
||||
buildLine,
|
||||
buildPoly,
|
||||
buildRectangle,
|
||||
buildRoundedRectangle
|
||||
};
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
1
resources/app/node_modules/@pixi/graphics/lib/utils/index.mjs.map
generated
vendored
Normal file
1
resources/app/node_modules/@pixi/graphics/lib/utils/index.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.mjs","sources":["../../src/utils/index.ts"],"sourcesContent":["/**\n * Generalized convenience utilities for Graphics.\n * @namespace graphicsUtils\n * @memberof PIXI\n */\n\n// for type only\nimport { SHAPES } from '@pixi/core';\nimport { buildCircle } from './buildCircle';\nimport { buildPoly } from './buildPoly';\nimport { buildRectangle } from './buildRectangle';\nimport { buildRoundedRectangle } from './buildRoundedRectangle';\n\nimport type { BatchDrawCall } from '@pixi/core';\nimport type { BatchPart } from './BatchPart';\nimport type { IShapeBuildCommand } from './IShapeBuildCommand';\n\nexport * from './ArcUtils';\nexport * from './BatchPart';\nexport * from './BezierUtils';\nexport * from './buildCircle';\nexport * from './buildLine';\nexport * from './buildPoly';\nexport * from './buildRectangle';\nexport * from './buildRoundedRectangle';\nexport * from './QuadraticUtils';\n\n/**\n * Map of fill commands for each shape type.\n * @memberof PIXI.graphicsUtils\n * @member {object} FILL_COMMANDS\n */\nexport const FILL_COMMANDS: Record<SHAPES, IShapeBuildCommand> = {\n [SHAPES.POLY]: buildPoly,\n [SHAPES.CIRC]: buildCircle,\n [SHAPES.ELIP]: buildCircle,\n [SHAPES.RECT]: buildRectangle,\n [SHAPES.RREC]: buildRoundedRectangle,\n};\n\n/**\n * Batch pool, stores unused batches for preventing allocations.\n * @memberof PIXI.graphicsUtils\n * @member {Array<PIXI.graphicsUtils.BatchPart>} BATCH_POOL\n */\nexport const BATCH_POOL: Array<BatchPart> = [];\n\n/**\n * Draw call pool, stores unused draw calls for preventing allocations.\n * @memberof PIXI.graphicsUtils\n * @member {Array<PIXI.BatchDrawCall>} DRAW_CALL_POOL\n */\nexport const DRAW_CALL_POOL: Array<BatchDrawCall> = [];\n"],"names":[],"mappings":";;;;;;;;;;AAgCO,MAAM,gBAAoD;AAAA,EAC7D,CAAC,OAAO,IAAI,GAAG;AAAA,EACf,CAAC,OAAO,IAAI,GAAG;AAAA,EACf,CAAC,OAAO,IAAI,GAAG;AAAA,EACf,CAAC,OAAO,IAAI,GAAG;AAAA,EACf,CAAC,OAAO,IAAI,GAAG;AACnB,GAOa,aAA+B,IAO/B,iBAAuC,CAAA;"}
|
||||
Reference in New Issue
Block a user