mirror of
https://github.com/osukey/osukey.git
synced 2025-05-30 01:47:30 +09: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)
|
protected override bool OnMouseUp(MouseUpEvent e)
|
||||||
{
|
{
|
||||||
bool shouldPlayEffect = buttons.Contains(e.Button);
|
if (buttons.Contains(e.Button) && Contains(e.ScreenSpaceMousePosition))
|
||||||
// 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))
|
|
||||||
sampleClick?.Play();
|
sampleClick?.Play();
|
||||||
|
|
||||||
return base.OnMouseUp(e);
|
return base.OnMouseUp(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user