mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-23 06:15:38 +00:00
More QoL changes for touch gliding
This commit is contained in:
parent
3d08dd0250
commit
20f7cd7217
|
@ -461,11 +461,11 @@ public class TouchscreenControllerView extends FrameLayout {
|
||||||
final int y = (int) event.getY(i);
|
final int y = (int) event.getY(i);
|
||||||
if (rect.contains(x, y)) {
|
if (rect.contains(x, y)) {
|
||||||
buttonView.setPressed(true);
|
buttonView.setPressed(true);
|
||||||
int pointerID = event.getPointerId(i);
|
final int pointerId = event.getPointerId(i);
|
||||||
if (!mGlidePairs.containsKey(pointerID) && !mGlidePairs.containsValue(buttonView)) {
|
if (!mGlidePairs.containsKey(pointerId) && !mGlidePairs.containsValue(buttonView)) {
|
||||||
if (buttonView.getIsGlidable())
|
if (buttonView.getIsGlidable())
|
||||||
mGlidePairs.put(pointerID, buttonView);
|
mGlidePairs.put(pointerId, buttonView);
|
||||||
else { mGlidePairs.put(pointerID, null); }
|
else { mGlidePairs.put(pointerId, null); }
|
||||||
}
|
}
|
||||||
pressed = true;
|
pressed = true;
|
||||||
break;
|
break;
|
||||||
|
@ -494,6 +494,7 @@ public class TouchscreenControllerView extends FrameLayout {
|
||||||
(axisView.isPressed() && axisView.getPointerId() == pointerId)) {
|
(axisView.isPressed() && axisView.getPointerId() == pointerId)) {
|
||||||
axisView.setPressed(pointerId, x, y);
|
axisView.setPressed(pointerId, x, y);
|
||||||
pressed = true;
|
pressed = true;
|
||||||
|
mGlidePairs.put(pointerId, null);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -526,9 +527,9 @@ public class TouchscreenControllerView extends FrameLayout {
|
||||||
case MotionEvent.ACTION_DOWN:
|
case MotionEvent.ACTION_DOWN:
|
||||||
case MotionEvent.ACTION_POINTER_DOWN:
|
case MotionEvent.ACTION_POINTER_DOWN:
|
||||||
case MotionEvent.ACTION_POINTER_UP: {
|
case MotionEvent.ACTION_POINTER_UP: {
|
||||||
int pointerID = event.getPointerId(event.getActionIndex());
|
final int pointerId = event.getPointerId(event.getActionIndex());
|
||||||
if (mGlidePairs.containsKey(pointerID))
|
if (mGlidePairs.containsKey(pointerId))
|
||||||
mGlidePairs.remove(pointerID);
|
mGlidePairs.remove(pointerId);
|
||||||
|
|
||||||
return updateTouchButtonsFromEvent(event);
|
return updateTouchButtonsFromEvent(event);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue