1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-23 00:47:24 +08:00

Fix cursor expansion state potentially being incorrect (#5145)

Fix cursor expansion state potentially being incorrect
This commit is contained in:
Dean Herbert 2019-06-25 16:16:27 +09:00 committed by GitHub
commit 7281b64eb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
@ -73,7 +74,10 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
{
case OsuAction.LeftButton:
case OsuAction.RightButton:
if (--downCount == 0)
// Todo: Math.Max() is required as a temporary measure to address https://github.com/ppy/osu-framework/issues/2576
downCount = Math.Max(0, downCount - 1);
if (downCount == 0)
updateExpandedState();
break;
}