1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 02:43:19 +08:00

Fix gradient showing when toggling toolbar with mouse above window

This commit is contained in:
Bartłomiej Dach 2022-12-29 23:34:33 +01:00
parent bf975eb48a
commit f625c5d744
No known key found for this signature in database

View File

@ -235,7 +235,11 @@ namespace osu.Game.Overlays.Toolbar
protected override void Update()
{
base.Update();
showGradient.Value = Contains(inputManager.CurrentState.Mouse.Position);
var currentMousePosition = inputManager.CurrentState.Mouse.Position;
// ensure that the gradient is not shown if the mouse is above the window.
// this is relevant when the background is moving due to the toolbar being toggled.
showGradient.Value = currentMousePosition.Y >= 0 && Contains(inputManager.CurrentState.Mouse.Position);
}
private void updateState()