@esotericsoftware/spine-canvaskit 4.2.56 → 4.2.57
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.
|
@@ -1554,6 +1554,11 @@ var spine = (() => {
|
|
|
1554
1554
|
let bone = skeleton.bones[this.boneIndex];
|
|
1555
1555
|
if (!bone.active)
|
|
1556
1556
|
return;
|
|
1557
|
+
if (direction == 1 /* mixOut */) {
|
|
1558
|
+
if (blend == 0 /* setup */)
|
|
1559
|
+
bone.inherit = bone.data.inherit;
|
|
1560
|
+
return;
|
|
1561
|
+
}
|
|
1557
1562
|
let frames = this.frames;
|
|
1558
1563
|
if (time < frames[0]) {
|
|
1559
1564
|
if (blend == 0 /* setup */ || blend == 1 /* first */)
|
|
@@ -6415,8 +6420,9 @@ var spine = (() => {
|
|
|
6415
6420
|
q = -(c1 + q) * 0.5;
|
|
6416
6421
|
let r0 = q / c2, r1 = c / q;
|
|
6417
6422
|
let r = Math.abs(r0) < Math.abs(r1) ? r0 : r1;
|
|
6418
|
-
|
|
6419
|
-
|
|
6423
|
+
r0 = dd - r * r;
|
|
6424
|
+
if (r0 >= 0) {
|
|
6425
|
+
y = Math.sqrt(r0) * bendDir;
|
|
6420
6426
|
a1 = ta - Math.atan2(y, r);
|
|
6421
6427
|
a2 = Math.atan2(y / psy, (r - l1) / psx);
|
|
6422
6428
|
break outer;
|
|
@@ -7099,25 +7105,28 @@ var spine = (() => {
|
|
|
7099
7105
|
case 1 /* reset */:
|
|
7100
7106
|
this.reset();
|
|
7101
7107
|
case 2 /* update */:
|
|
7108
|
+
const skeleton = this.skeleton;
|
|
7102
7109
|
const delta = Math.max(this.skeleton.time - this.lastTime, 0);
|
|
7103
7110
|
this.remaining += delta;
|
|
7104
|
-
this.lastTime =
|
|
7111
|
+
this.lastTime = skeleton.time;
|
|
7105
7112
|
const bx = bone.worldX, by = bone.worldY;
|
|
7106
7113
|
if (this._reset) {
|
|
7107
7114
|
this._reset = false;
|
|
7108
7115
|
this.ux = bx;
|
|
7109
7116
|
this.uy = by;
|
|
7110
7117
|
} else {
|
|
7111
|
-
let a = this.remaining, i = this.inertia,
|
|
7118
|
+
let a = this.remaining, i = this.inertia, t = this.data.step, f = this.skeleton.data.referenceScale, d = -1;
|
|
7119
|
+
let qx = this.data.limit * delta, qy = qx * Math.abs(skeleton.scaleY);
|
|
7120
|
+
qx *= Math.abs(skeleton.scaleX);
|
|
7112
7121
|
if (x || y) {
|
|
7113
7122
|
if (x) {
|
|
7114
7123
|
const u = (this.ux - bx) * i;
|
|
7115
|
-
this.xOffset += u >
|
|
7124
|
+
this.xOffset += u > qx ? qx : u < -qx ? -qx : u;
|
|
7116
7125
|
this.ux = bx;
|
|
7117
7126
|
}
|
|
7118
7127
|
if (y) {
|
|
7119
7128
|
const u = (this.uy - by) * i;
|
|
7120
|
-
this.yOffset += u >
|
|
7129
|
+
this.yOffset += u > qy ? qy : u < -qy ? -qy : u;
|
|
7121
7130
|
this.uy = by;
|
|
7122
7131
|
}
|
|
7123
7132
|
if (a >= t) {
|
|
@@ -7145,14 +7154,14 @@ var spine = (() => {
|
|
|
7145
7154
|
if (rotateOrShearX || scaleX) {
|
|
7146
7155
|
let ca = Math.atan2(bone.c, bone.a), c = 0, s = 0, mr = 0;
|
|
7147
7156
|
let dx = this.cx - bone.worldX, dy = this.cy - bone.worldY;
|
|
7148
|
-
if (dx >
|
|
7149
|
-
dx =
|
|
7150
|
-
else if (dx < -
|
|
7151
|
-
dx = -
|
|
7152
|
-
if (dy >
|
|
7153
|
-
dy =
|
|
7154
|
-
else if (dy < -
|
|
7155
|
-
dy = -
|
|
7157
|
+
if (dx > qx)
|
|
7158
|
+
dx = qx;
|
|
7159
|
+
else if (dx < -qx)
|
|
7160
|
+
dx = -qx;
|
|
7161
|
+
if (dy > qy)
|
|
7162
|
+
dy = qy;
|
|
7163
|
+
else if (dy < -qy)
|
|
7164
|
+
dy = -qy;
|
|
7156
7165
|
if (rotateOrShearX) {
|
|
7157
7166
|
mr = (this.data.rotate + this.data.shearX) * mix;
|
|
7158
7167
|
let r = Math.atan2(dy + this.ty, dx + this.tx) - ca - this.rotateOffset * mr;
|
|
@@ -10313,7 +10322,28 @@ var spine = (() => {
|
|
|
10313
10322
|
isClipping() {
|
|
10314
10323
|
return this.clipAttachment != null;
|
|
10315
10324
|
}
|
|
10316
|
-
clipTriangles(vertices,
|
|
10325
|
+
clipTriangles(vertices, verticesLengthOrTriangles, trianglesOrTrianglesLength, trianglesLengthOrUvs, uvsOrLight, lightOrDark, darkOrTwoColor, twoColorParam) {
|
|
10326
|
+
let triangles;
|
|
10327
|
+
let trianglesLength;
|
|
10328
|
+
let uvs;
|
|
10329
|
+
let light;
|
|
10330
|
+
let dark;
|
|
10331
|
+
let twoColor;
|
|
10332
|
+
if (typeof verticesLengthOrTriangles === "number") {
|
|
10333
|
+
triangles = trianglesOrTrianglesLength;
|
|
10334
|
+
trianglesLength = trianglesLengthOrUvs;
|
|
10335
|
+
uvs = uvsOrLight;
|
|
10336
|
+
light = lightOrDark;
|
|
10337
|
+
dark = darkOrTwoColor;
|
|
10338
|
+
twoColor = twoColorParam;
|
|
10339
|
+
} else {
|
|
10340
|
+
triangles = verticesLengthOrTriangles;
|
|
10341
|
+
trianglesLength = trianglesOrTrianglesLength;
|
|
10342
|
+
uvs = trianglesLengthOrUvs;
|
|
10343
|
+
light = uvsOrLight;
|
|
10344
|
+
dark = lightOrDark;
|
|
10345
|
+
twoColor = darkOrTwoColor;
|
|
10346
|
+
}
|
|
10317
10347
|
if (uvs && light && dark && typeof twoColor === "boolean")
|
|
10318
10348
|
this.clipTrianglesRender(vertices, triangles, trianglesLength, uvs, light, dark, twoColor);
|
|
10319
10349
|
else
|