virtual-joystick-android icon indicating copy to clipboard operation
virtual-joystick-android copied to clipboard

It is possible to have strength > 100

Open Trobiun opened this issue 4 years ago • 1 comments

When the user touches the joystick without dragging it to the maximum possible value or more, the strength obtained in the OnMoveListener can be greater than 100.

I think it's probably when the touch point is farther from the joystick center than the maximum value of the button center. Tested with a single axis and version 1.10.1.

Sorry if it's not clear or if my english is bad.

Trobiun avatar Dec 19 '20 18:12 Trobiun

I have noticed this issue also - if I get time I might look at doing a pull request to fix it as I assume it's a bug.

That said I just simply wrote a couple of if statements to protect against it like:

if (output > 100)
  output = 100

if (output < 0)
  output = 0

JohanJarvi avatar Apr 13 '21 03:04 JohanJarvi