@esotericsoftware/spine-canvas 4.2.56 → 4.2.58

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