1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 10:47:28 +08:00

Fix tooltips sticking after drag.

This commit is contained in:
Dean Herbert 2017-04-20 18:17:12 +09:00
parent 02e406860b
commit 4e1942f998
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49

View File

@ -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) protected override bool OnMouseMove(InputState state)
{ {
updateTooltipState(state);
return base.OnMouseMove(state);
}
private void updateTooltipState(InputState state)
{
if (currentlyDisplayed?.Hovering != true) if (currentlyDisplayed?.Hovering != true)
{ {
if (currentlyDisplayed != null && !state.Mouse.HasMainButtonPressed) if (currentlyDisplayed != null && !state.Mouse.HasMainButtonPressed)
@ -80,8 +91,6 @@ namespace osu.Game.Graphics.Cursor
currentlyDisplayed = tooltipTarget; currentlyDisplayed = tooltipTarget;
}, (1 - tooltip.Alpha) * default_appear_delay); }, (1 - tooltip.Alpha) * default_appear_delay);
} }
return base.OnMouseMove(state);
} }
public class Tooltip : Container public class Tooltip : Container