1
0
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:
Caiyi Shyu 2024-07-31 16:54:32 +08:00
parent 77d64e0c3d
commit 5b46597d56

View File

@ -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);