From 82ed8eae6bfa4f42ecb274f1138f414ad42f7d04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 6 Dec 2021 20:52:06 +0100 Subject: [PATCH] Ensure hover handling container always calls base on hover events --- .../Drawables/Cards/HoverHandlingContainer.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/osu.Game/Beatmaps/Drawables/Cards/HoverHandlingContainer.cs b/osu.Game/Beatmaps/Drawables/Cards/HoverHandlingContainer.cs index 1e2c616332..fe37616755 100644 --- a/osu.Game/Beatmaps/Drawables/Cards/HoverHandlingContainer.cs +++ b/osu.Game/Beatmaps/Drawables/Cards/HoverHandlingContainer.cs @@ -14,14 +14,16 @@ public class HoverHandlingContainer : Container public Func? Hovered { get; set; } public Action? 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); } } }