mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 09:16:01 +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;
|
||||
case pingpong: {
|
||||
int n = (count << 1) - 2;
|
||||
index %= n;
|
||||
index = n == 0 ? 0 : index % n;
|
||||
if (index >= count) index = n - index;
|
||||
break;
|
||||
}
|
||||
@ -2508,7 +2508,7 @@ public class Animation {
|
||||
break;
|
||||
case pingpongReverse:
|
||||
int n = (count << 1) - 2;
|
||||
index = (index + count - 1) % n;
|
||||
index = n == 0 ? 0 : (index + count - 1) % n;
|
||||
if (index >= count) index = n - index;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user