From 1f2d046d3406977ef08f1e4224f9b3f5e67c2fd2 Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Fri, 26 Aug 2016 10:40:27 +0200 Subject: [PATCH] Fix issuing orders when releasing RMB after standard-scrolling --- OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs b/OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs index 6fd0057d0a..b9424f0dfc 100644 --- a/OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs +++ b/OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs @@ -35,6 +35,7 @@ namespace OpenRA.Mods.Common.Widgets public int EdgeCornerScrollThreshold = 35; int2? joystickScrollStart, joystickScrollEnd; + bool isStandardScrolling; static readonly Dictionary ScrollCursors = new Dictionary { @@ -287,10 +288,19 @@ namespace OpenRA.Mods.Common.Widgets { if (mi.Event == MouseInputEvent.Move) { + isStandardScrolling = true; var d = scrollType == MouseScrollType.Inverted ? -1 : 1; worldRenderer.Viewport.Scroll((Viewport.LastMousePos - mi.Location) * d, false); return true; } + else if (mi.Event == MouseInputEvent.Up) + { + var wasStandardScrolling = isStandardScrolling; + isStandardScrolling = false; + + if (wasStandardScrolling) + return true; + } } // Tiberian Sun style click-and-drag scrolling