mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 05:43:21 +08:00
fix click to expand on touch devices
This commit is contained in:
parent
77d64e0c3d
commit
5b46597d56
@ -95,11 +95,30 @@ namespace osu.Game.Overlays.Mods
|
||||
}, true);
|
||||
}
|
||||
|
||||
private bool touchedThisFrame;
|
||||
|
||||
protected override bool OnTouchDown(TouchDownEvent e)
|
||||
{
|
||||
if (Enabled.Value)
|
||||
{
|
||||
touchedThisFrame = true;
|
||||
Schedule(() => touchedThisFrame = false);
|
||||
}
|
||||
|
||||
return base.OnTouchDown(e);
|
||||
}
|
||||
|
||||
protected override bool OnHover(HoverEvent e)
|
||||
{
|
||||
if (Enabled.Value)
|
||||
{
|
||||
Parent?.UpdateHoverExpansion(true);
|
||||
if (!touchedThisFrame)
|
||||
Parent?.UpdateHoverExpansion(true);
|
||||
}
|
||||
if (Enabled.Value)
|
||||
{
|
||||
if (!touchedThisFrame)
|
||||
Parent?.UpdateHoverExpansion(true);
|
||||
}
|
||||
|
||||
return base.OnHover(e);
|
||||
|
Loading…
Reference in New Issue
Block a user