Don't bother calculating active keys if input source was not handled

This commit is contained in:
Dean Herbert
2022-09-09 15:22:12 +09:00
parent a42c1af09e
commit e6ba95ee16

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Linq; using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
@ -149,15 +150,14 @@ namespace osu.Game.Rulesets.Catch.UI
base.OnTouchUp(e); base.OnTouchUp(e);
} }
private bool handleDown(object source, Vector2 position) private bool handleDown(object inputSource, Vector2 position)
{ {
TouchCatchAction catchAction = getTouchCatchActionFromInput(position); TouchCatchAction catchAction = getTouchCatchActionFromInput(position);
if (catchAction == TouchCatchAction.None) if (catchAction == TouchCatchAction.None)
return false; return false;
trackedActionSources[source] = catchAction; trackedActionSources[inputSource] = catchAction;
calculateActiveKeys(); calculateActiveKeys();
return true; return true;
@ -165,9 +165,8 @@ namespace osu.Game.Rulesets.Catch.UI
private void handleUp(object source) private void handleUp(object source)
{ {
trackedActionSources.Remove(source); if (trackedActionSources.Remove(source))
calculateActiveKeys();
calculateActiveKeys();
} }
private void calculateActiveKeys() private void calculateActiveKeys()