mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
[libgdx] Fixed crash when a pingpong sequence has 1 frame.
This commit is contained in:
parent
a1e782a533
commit
81baef0b5b
@ -2496,7 +2496,7 @@ public class Animation {
|
|||||||
break;
|
break;
|
||||||
case pingpong: {
|
case pingpong: {
|
||||||
int n = (count << 1) - 2;
|
int n = (count << 1) - 2;
|
||||||
index %= n;
|
index = n == 0 ? 0 : index % n;
|
||||||
if (index >= count) index = n - index;
|
if (index >= count) index = n - index;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2508,7 +2508,7 @@ public class Animation {
|
|||||||
break;
|
break;
|
||||||
case pingpongReverse:
|
case pingpongReverse:
|
||||||
int n = (count << 1) - 2;
|
int n = (count << 1) - 2;
|
||||||
index = (index + count - 1) % n;
|
index = n == 0 ? 0 : (index + count - 1) % n;
|
||||||
if (index >= count) index = n - index;
|
if (index >= count) index = n - index;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user