mirror of
https://github.com/ppy/osu.git
synced 2025-02-16 05:03:02 +08:00
Simplify implementation
This commit is contained in:
parent
e88965b433
commit
299d528654
@ -36,11 +36,9 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
protected override bool OnMouseUp(MouseUpEvent e)
|
||||
{
|
||||
bool shouldPlayEffect = buttons.Contains(e.Button);
|
||||
// examine the button pressed first for short-circuiting
|
||||
// in most usages it is more likely that another button was pressed than that the cursor left the drawable bounds
|
||||
if (shouldPlayEffect && Contains(e.ScreenSpaceMousePosition))
|
||||
if (buttons.Contains(e.Button) && Contains(e.ScreenSpaceMousePosition))
|
||||
sampleClick?.Play();
|
||||
|
||||
return base.OnMouseUp(e);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user