@esotericsoftware/spine-canvas 4.1.6 → 4.1.7

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.
@@ -1103,8 +1103,8 @@ var spine = (() => {
1103
1103
  bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;
1104
1104
  break;
1105
1105
  case 3:
1106
- bone.scaleX = (x - bone.data.scaleX) * alpha;
1107
- bone.scaleY = (y - bone.data.scaleY) * alpha;
1106
+ bone.scaleX += (x - bone.data.scaleX) * alpha;
1107
+ bone.scaleY += (y - bone.data.scaleY) * alpha;
1108
1108
  }
1109
1109
  } else {
1110
1110
  switch (blend) {
@@ -1170,7 +1170,7 @@ var spine = (() => {
1170
1170
  bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;
1171
1171
  break;
1172
1172
  case 3:
1173
- bone.scaleX = (x - bone.data.scaleX) * alpha;
1173
+ bone.scaleX += (x - bone.data.scaleX) * alpha;
1174
1174
  }
1175
1175
  } else {
1176
1176
  switch (blend) {
@@ -1231,7 +1231,7 @@ var spine = (() => {
1231
1231
  bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;
1232
1232
  break;
1233
1233
  case 3:
1234
- bone.scaleY = (y - bone.data.scaleY) * alpha;
1234
+ bone.scaleY += (y - bone.data.scaleY) * alpha;
1235
1235
  }
1236
1236
  } else {
1237
1237
  switch (blend) {
@@ -2653,13 +2653,14 @@ var spine = (() => {
2653
2653
  }
2654
2654
  } else {
2655
2655
  let timelineMode = current.timelineMode;
2656
- let firstFrame = current.timelinesRotation.length != timelineCount << 1;
2656
+ let shortestRotation = current.shortestRotation;
2657
+ let firstFrame = !shortestRotation && current.timelinesRotation.length != timelineCount << 1;
2657
2658
  if (firstFrame)
2658
2659
  current.timelinesRotation.length = timelineCount << 1;
2659
2660
  for (let ii = 0; ii < timelineCount; ii++) {
2660
2661
  let timeline2 = timelines[ii];
2661
2662
  let timelineBlend = timelineMode[ii] == SUBSEQUENT ? blend : MixBlend.setup;
2662
- if (timeline2 instanceof RotateTimeline) {
2663
+ if (!shortestRotation && timeline2 instanceof RotateTimeline) {
2663
2664
  this.applyRotateTimeline(timeline2, skeleton, applyTime, mix, timelineBlend, current.timelinesRotation, ii << 1, firstFrame);
2664
2665
  } else if (timeline2 instanceof AttachmentTimeline) {
2665
2666
  this.applyAttachmentTimeline(timeline2, skeleton, applyTime, blend, true);
@@ -2719,7 +2720,8 @@ var spine = (() => {
2719
2720
  } else {
2720
2721
  let timelineMode = from.timelineMode;
2721
2722
  let timelineHoldMix = from.timelineHoldMix;
2722
- let firstFrame = from.timelinesRotation.length != timelineCount << 1;
2723
+ let shortestRotation = from.shortestRotation;
2724
+ let firstFrame = !shortestRotation && from.timelinesRotation.length != timelineCount << 1;
2723
2725
  if (firstFrame)
2724
2726
  from.timelinesRotation.length = timelineCount << 1;
2725
2727
  from.totalAlpha = 0;
@@ -2754,7 +2756,7 @@ var spine = (() => {
2754
2756
  break;
2755
2757
  }
2756
2758
  from.totalAlpha += alpha;
2757
- if (timeline instanceof RotateTimeline)
2759
+ if (!shortestRotation && timeline instanceof RotateTimeline)
2758
2760
  this.applyRotateTimeline(timeline, skeleton, applyTime, alpha, timelineBlend, from.timelinesRotation, i << 1, firstFrame);
2759
2761
  else if (timeline instanceof AttachmentTimeline)
2760
2762
  this.applyAttachmentTimeline(timeline, skeleton, applyTime, timelineBlend, attachments);
@@ -3010,6 +3012,8 @@ var spine = (() => {
3010
3012
  entry.animation = animation;
3011
3013
  entry.loop = loop;
3012
3014
  entry.holdPrevious = false;
3015
+ entry.reverse = false;
3016
+ entry.shortestRotation = false;
3013
3017
  entry.eventThreshold = 0;
3014
3018
  entry.attachmentThreshold = 0;
3015
3019
  entry.drawOrderThreshold = 0;
@@ -3024,9 +3028,10 @@ var spine = (() => {
3024
3028
  entry.trackEnd = Number.MAX_VALUE;
3025
3029
  entry.timeScale = 1;
3026
3030
  entry.alpha = 1;
3027
- entry.interruptAlpha = 1;
3028
3031
  entry.mixTime = 0;
3029
3032
  entry.mixDuration = !last ? 0 : this.data.getMix(last.animation, animation);
3033
+ entry.interruptAlpha = 1;
3034
+ entry.totalAlpha = 0;
3030
3035
  entry.mixBlend = MixBlend.replace;
3031
3036
  return entry;
3032
3037
  }
@@ -3126,6 +3131,7 @@ var spine = (() => {
3126
3131
  this.loop = false;
3127
3132
  this.holdPrevious = false;
3128
3133
  this.reverse = false;
3134
+ this.shortestRotation = false;
3129
3135
  this.eventThreshold = 0;
3130
3136
  this.attachmentThreshold = 0;
3131
3137
  this.drawOrderThreshold = 0;