Fix issuing orders when releasing RMB after standard-scrolling

This commit is contained in:
Oliver Brakmann
2016-08-26 10:40:27 +02:00
parent d6a6ed28c8
commit 1f2d046d34

View File

@@ -35,6 +35,7 @@ namespace OpenRA.Mods.Common.Widgets
public int EdgeCornerScrollThreshold = 35; public int EdgeCornerScrollThreshold = 35;
int2? joystickScrollStart, joystickScrollEnd; int2? joystickScrollStart, joystickScrollEnd;
bool isStandardScrolling;
static readonly Dictionary<ScrollDirection, string> ScrollCursors = new Dictionary<ScrollDirection, string> static readonly Dictionary<ScrollDirection, string> ScrollCursors = new Dictionary<ScrollDirection, string>
{ {
@@ -287,10 +288,19 @@ namespace OpenRA.Mods.Common.Widgets
{ {
if (mi.Event == MouseInputEvent.Move) if (mi.Event == MouseInputEvent.Move)
{ {
isStandardScrolling = true;
var d = scrollType == MouseScrollType.Inverted ? -1 : 1; var d = scrollType == MouseScrollType.Inverted ? -1 : 1;
worldRenderer.Viewport.Scroll((Viewport.LastMousePos - mi.Location) * d, false); worldRenderer.Viewport.Scroll((Viewport.LastMousePos - mi.Location) * d, false);
return true; return true;
} }
else if (mi.Event == MouseInputEvent.Up)
{
var wasStandardScrolling = isStandardScrolling;
isStandardScrolling = false;
if (wasStandardScrolling)
return true;
}
} }
// Tiberian Sun style click-and-drag scrolling // Tiberian Sun style click-and-drag scrolling