@zyzgroup/core-web 0.1.18 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/better.css +2 -0
- package/dist/zyzgroup_core_web.iife.js +1 -1
- package/dist/zyzgroup_core_web.iife.js.map +1 -1
- package/dist/zyzgroup_core_web.js +4 -4
- package/dist/zyzgroup_core_web.js.map +1 -1
- package/dist/zyzgroup_core_web.umd.cjs +1 -1
- package/dist/zyzgroup_core_web.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/types/svg/DOMSVGUtil.d.ts.map +1 -1
|
@@ -5470,7 +5470,7 @@ class xt extends li {
|
|
|
5470
5470
|
let h;
|
|
5471
5471
|
const c = [];
|
|
5472
5472
|
Math.abs(n) > 1e12 && (n = 0.5), Math.abs(r) > 1e12 && (r = 0.5), n >= 0 && n <= 1 && (h = this.interpolate(n), a.push(h.x), o.push(h.y), c.push({ X: h.x, Y: h.y })), r >= 0 && r <= 1 && (h = this.interpolate(r), a.push(h.x), o.push(h.y), c.push({ X: h.x, Y: h.y })), t = this.c2y - 2 * this.c1y + this.y - (this.toY - 2 * this.c2y + this.c1y), e = 2 * (this.c1y - this.y) - 2 * (this.c2y - this.c1y), s = this.y - this.c1y, n = (-e + Math.sqrt(e * e - 4 * t * s)) / 2 / t, r = (-e - Math.sqrt(e * e - 4 * t * s)) / 2 / t, Math.abs(n) > 1e12 && (n = 0.5), Math.abs(r) > 1e12 && (r = 0.5), n >= 0 && n <= 1 && (h = this.interpolate(n), a.push(h.x), o.push(h.y), c.push({ X: h.x, Y: h.y })), r >= 0 && r <= 1 && (h = this.interpolate(r), a.push(h.x), o.push(h.y), c.push({ X: h.x, Y: h.y }));
|
|
5473
|
-
|
|
5473
|
+
const l = [], u = c.length;
|
|
5474
5474
|
for (let m = 0; m < u; m++) {
|
|
5475
5475
|
for (let S = m + 1; S < u; S++)
|
|
5476
5476
|
c[m].X === c[S].X && c[m].Y === c[S].Y && (S = ++m);
|
|
@@ -5556,15 +5556,15 @@ class xt extends li {
|
|
|
5556
5556
|
const e = this.x, s = this.y, n = this.c1x, r = this.c1y, o = this.c2x, a = this.c2y, h = this.toX, c = this.toY;
|
|
5557
5557
|
if (t < 0 || xt.bezlen(e, s, n, r, o, a, h, c) < t)
|
|
5558
5558
|
return 0;
|
|
5559
|
-
|
|
5559
|
+
const l = 1;
|
|
5560
|
+
let u = l / 2, f = l - u, d = xt.bezlen(e, s, n, r, o, a, h, c, f);
|
|
5560
5561
|
for (; Math.abs(d - t) > 0.01; )
|
|
5561
5562
|
u /= 2, f += (d < t ? 1 : -1) * u, d = xt.bezlen(e, s, n, r, o, a, h, c, f);
|
|
5562
5563
|
return f;
|
|
5563
5564
|
}
|
|
5564
5565
|
/// Find dot coordinates on the given cubic bezier curve at the given t
|
|
5565
5566
|
getPointAtSegmentLength(t) {
|
|
5566
|
-
const e = this.getTatLen(t);
|
|
5567
|
-
let s = 1 - e, n = Math.pow(s, 3), r = Math.pow(s, 2), o = e * e, a = o * e, h = n * this.x + r * 3 * e * this.c1x + s * 3 * e * e * this.c2x + a * this.toX, c = n * this.y + r * 3 * e * this.c1y + s * 3 * e * e * this.c2y + a * this.toY, l = this.x + 2 * e * (this.c1x - this.x) + o * (this.c2x - 2 * this.c1x + this.x), u = this.y + 2 * e * (this.c1y - this.y) + o * (this.c2y - 2 * this.c1y + this.y), f = this.c1x + 2 * e * (this.c2x - this.c1x) + o * (this.toX - 2 * this.c2x + this.c1x), d = this.c1y + 2 * e * (this.c2y - this.c1y) + o * (this.toY - 2 * this.c2y + this.c1y), m = s * this.x + e * this.c1x, S = s * this.y + e * this.c1y, v = s * this.c2x + e * this.toX, w = s * this.c2y + e * this.toY, b = 90 - Math.atan2(l - f, u - d) * 180 / Math.PI;
|
|
5567
|
+
const e = this.getTatLen(t), s = 1 - e, n = Math.pow(s, 3), r = Math.pow(s, 2), o = e * e, a = o * e, h = n * this.x + r * 3 * e * this.c1x + s * 3 * e * e * this.c2x + a * this.toX, c = n * this.y + r * 3 * e * this.c1y + s * 3 * e * e * this.c2y + a * this.toY, l = this.x + 2 * e * (this.c1x - this.x) + o * (this.c2x - 2 * this.c1x + this.x), u = this.y + 2 * e * (this.c1y - this.y) + o * (this.c2y - 2 * this.c1y + this.y), f = this.c1x + 2 * e * (this.c2x - this.c1x) + o * (this.toX - 2 * this.c2x + this.c1x), d = this.c1y + 2 * e * (this.c2y - this.c1y) + o * (this.toY - 2 * this.c2y + this.c1y), m = s * this.x + e * this.c1x, S = s * this.y + e * this.c1y, v = s * this.c2x + e * this.toX, w = s * this.c2y + e * this.toY, b = 90 - Math.atan2(l - f, u - d) * 180 / Math.PI;
|
|
5568
5568
|
return {
|
|
5569
5569
|
x: h,
|
|
5570
5570
|
// x coordinate of the point
|