mirror of
https://github.com/ppy/osu
synced 2024-12-26 00:32:52 +00:00
Fix previous touch action not being released when it's not a direct touch
This commit is contained in:
parent
6c4f596a9a
commit
42359a9754
@ -172,7 +172,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
beginTouch(TouchSource.Touch2);
|
||||
|
||||
assertKeyCounter(1, 1);
|
||||
checkPressed(OsuAction.LeftButton);
|
||||
checkNotPressed(OsuAction.LeftButton);
|
||||
checkPressed(OsuAction.RightButton);
|
||||
// in this case, touch 2 should not become the positional tracking touch.
|
||||
checkPosition(TouchSource.Touch1);
|
||||
|
@ -105,12 +105,12 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
}
|
||||
|
||||
// In the case the new touch was not used for position tracking, we should also check the previous position tracking touch.
|
||||
// If it was a direct touch and still has its action pressed, that action should be released.
|
||||
// If it still has its action pressed, that action should be released.
|
||||
//
|
||||
// This is done to allow tracking with the initial touch while still having both Left/Right actions available for alternating with two more touches.
|
||||
if (positionTrackingTouch.DirectTouch && positionTrackingTouch.Action is OsuAction directTouchAction)
|
||||
if (positionTrackingTouch.Action is OsuAction touchAction)
|
||||
{
|
||||
osuInputManager.KeyBindingContainer.TriggerReleased(directTouchAction);
|
||||
osuInputManager.KeyBindingContainer.TriggerReleased(touchAction);
|
||||
positionTrackingTouch.Action = null;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user