From 4e1942f998d7dc6f4c74d9b46988a786ad7ea022 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 20 Apr 2017 18:17:12 +0900 Subject: [PATCH] Fix tooltips sticking after drag. --- osu.Game/Graphics/Cursor/TooltipContainer.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/Cursor/TooltipContainer.cs b/osu.Game/Graphics/Cursor/TooltipContainer.cs index 8a55f1897f..5f0743746a 100644 --- a/osu.Game/Graphics/Cursor/TooltipContainer.cs +++ b/osu.Game/Graphics/Cursor/TooltipContainer.cs @@ -55,9 +55,20 @@ namespace osu.Game.Graphics.Cursor } } + protected override bool OnMouseUp(InputState state, MouseUpEventArgs args) + { + updateTooltipState(state); + return base.OnMouseUp(state, args); + } + protected override bool OnMouseMove(InputState state) { + updateTooltipState(state); + return base.OnMouseMove(state); + } + private void updateTooltipState(InputState state) + { if (currentlyDisplayed?.Hovering != true) { if (currentlyDisplayed != null && !state.Mouse.HasMainButtonPressed) @@ -80,8 +91,6 @@ namespace osu.Game.Graphics.Cursor currentlyDisplayed = tooltipTarget; }, (1 - tooltip.Alpha) * default_appear_delay); } - - return base.OnMouseMove(state); } public class Tooltip : Container