[libgdx] Fixed crash when a pingpong sequence has 1 frame.

This commit is contained in:
Nathan Sweet 2022-06-18 13:45:13 -04:00
parent a1e782a533
commit 81baef0b5b

View File

@ -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;
}
}