sdfsdfs
This commit is contained in:
25
node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildArc.mjs
generated
vendored
Normal file
25
node_modules/pixi.js/lib/scene/graphics/shared/buildCommands/buildArc.mjs
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
function buildArc(points, x, y, radius, start, end, clockwise, steps) {
|
||||
let dist = Math.abs(start - end);
|
||||
if (!clockwise && start > end) {
|
||||
dist = 2 * Math.PI - dist;
|
||||
} else if (clockwise && end > start) {
|
||||
dist = 2 * Math.PI - dist;
|
||||
}
|
||||
steps = steps || Math.max(6, Math.floor(6 * Math.pow(radius, 1 / 3) * (dist / Math.PI)));
|
||||
steps = Math.max(steps, 3);
|
||||
let f = dist / steps;
|
||||
let t = start;
|
||||
f *= clockwise ? -1 : 1;
|
||||
for (let i = 0; i < steps + 1; i++) {
|
||||
const cs = Math.cos(t);
|
||||
const sn = Math.sin(t);
|
||||
const nx = x + cs * radius;
|
||||
const ny = y + sn * radius;
|
||||
points.push(nx, ny);
|
||||
t += f;
|
||||
}
|
||||
}
|
||||
|
||||
export { buildArc };
|
||||
//# sourceMappingURL=buildArc.mjs.map
|
Reference in New Issue
Block a user