Compatibility with API level < 24

The Math.floorMod method was added on API level 24.
This commit is contained in:
Jules Aguillon 2022-07-03 22:58:02 +02:00
parent 1951448f9e
commit 1ddd089166

View File

@ -163,7 +163,7 @@ public final class Pointers implements Handler.Callback
KeyValue k;
for (int i = 0; i > -3; i = (~i>>31) - i)
{
int d = Math.floorMod(direction + i - 1, 8) + 1;
int d = (direction + i + 8 - 1) % 8 + 1;
// Don't make the difference between a key that doesn't exist and a key
// that is removed by [_handler]. Triggers side effects.
k = _handler.modifyKey(ptr.key.getAtDirection(d), ptr.modifiers);