mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-18 18:42:46 +00:00
fix bug where touch hitbox of analog stick is not full circle
This commit is contained in:
parent
11b3648fac
commit
171a6437fe
@ -293,12 +293,12 @@ public class AnalogStick extends VirtualControllerElement {
|
|||||||
movement_radius = getMovementRadius(relative_x, relative_y);
|
movement_radius = getMovementRadius(relative_x, relative_y);
|
||||||
movement_angle = getAngle(relative_x, relative_y);
|
movement_angle = getAngle(relative_x, relative_y);
|
||||||
|
|
||||||
// chop radius if out of outer circle and already pressed
|
// pass touch event to parent if out of outer circle
|
||||||
|
if (movement_radius > radius_complete && !isPressed())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// chop radius if out of outer circle or near the edge
|
||||||
if (movement_radius > (radius_complete - radius_analog_stick)) {
|
if (movement_radius > (radius_complete - radius_analog_stick)) {
|
||||||
// not pressed already, so ignore event from outer circle
|
|
||||||
if (!isPressed()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
movement_radius = radius_complete - radius_analog_stick;
|
movement_radius = radius_complete - radius_analog_stick;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user