android: InputOverlayDrawableJoystick: Fix off by 1 error with inner joystick.

This commit is contained in:
bunnei 2020-05-01 03:33:36 -04:00 committed by xperia64
parent 60805dbe47
commit c7993c29ca

View File

@ -195,6 +195,11 @@ public final class InputOverlayDrawableJoystick {
int X = getVirtBounds().centerX() + (int) ((axises[0]) * (getVirtBounds().width() / 2));
int Y = getVirtBounds().centerY() + (int) ((axises[1]) * (getVirtBounds().height() / 2));
if (mJoystickType == ButtonType.STICK_LEFT) {
X += 1;
Y += 1;
}
if (X > getVirtBounds().centerX() + (getVirtBounds().width() / 2))
X = getVirtBounds().centerX() + (getVirtBounds().width() / 2);
if (X < getVirtBounds().centerX() - (getVirtBounds().width() / 2))