@esotericsoftware/spine-webgl 4.2.8 → 4.2.9

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.
@@ -2864,13 +2864,18 @@ var spine = (() => {
2864
2864
  lastTotal = timelinesRotation[i];
2865
2865
  lastDiff = timelinesRotation[i + 1];
2866
2866
  }
2867
- let current = diff > 0, dir = lastTotal >= 0;
2868
- if (MathUtils.signum(lastDiff) != MathUtils.signum(diff) && Math.abs(lastDiff) <= 90) {
2869
- if (Math.abs(lastTotal) > 180)
2870
- lastTotal += 360 * MathUtils.signum(lastTotal);
2871
- dir = current;
2867
+ let loops = lastTotal - lastTotal % 360;
2868
+ total = diff + loops;
2869
+ let current = diff >= 0, dir = lastTotal >= 0;
2870
+ if (Math.abs(lastDiff) <= 90 && MathUtils.signum(lastDiff) != MathUtils.signum(diff)) {
2871
+ if (Math.abs(lastTotal - loops) > 180) {
2872
+ total += 360 * MathUtils.signum(lastTotal);
2873
+ dir = current;
2874
+ } else if (loops != 0)
2875
+ total -= 360 * MathUtils.signum(lastTotal);
2876
+ else
2877
+ dir = current;
2872
2878
  }
2873
- total = diff + lastTotal - lastTotal % 360;
2874
2879
  if (dir != current)
2875
2880
  total += 360 * MathUtils.signum(lastTotal);
2876
2881
  timelinesRotation[i] = total;