mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 14:17:06 +09:00
Ensure hover handling container always calls base on hover events
This commit is contained in:
@ -14,14 +14,16 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
||||
public Func<HoverEvent, bool>? Hovered { get; set; }
|
||||
public Action<HoverLostEvent>? Unhovered { get; set; }
|
||||
|
||||
protected override bool OnHover(HoverEvent e) => Hovered?.Invoke(e) ?? base.OnHover(e);
|
||||
protected override bool OnHover(HoverEvent e)
|
||||
{
|
||||
bool handledByBase = base.OnHover(e);
|
||||
return Hovered?.Invoke(e) ?? handledByBase;
|
||||
}
|
||||
|
||||
protected override void OnHoverLost(HoverLostEvent e)
|
||||
{
|
||||
if (Unhovered != null)
|
||||
Unhovered?.Invoke(e);
|
||||
else
|
||||
base.OnHoverLost(e);
|
||||
base.OnHoverLost(e);
|
||||
Unhovered?.Invoke(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user