From ef96604f9e0f7316ae843ecf1e7199b09640ea5c Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 9 Oct 2010 08:12:01 +1300 Subject: [PATCH] #231 scroll jumping fixed --- OpenRA.Game/Widgets/ViewportScrollControllerWidget.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Game/Widgets/ViewportScrollControllerWidget.cs b/OpenRA.Game/Widgets/ViewportScrollControllerWidget.cs index 45eb7c2f06..539fb0a466 100755 --- a/OpenRA.Game/Widgets/ViewportScrollControllerWidget.cs +++ b/OpenRA.Game/Widgets/ViewportScrollControllerWidget.cs @@ -152,7 +152,7 @@ namespace OpenRA.Widgets if (Keyboard.Includes(ScrollDirection.Left) || Edge.Includes(ScrollDirection.Left)) scroll += new float2(-1, 0); - float length = scroll.Length; + float length = Math.Max(1, scroll.Length); scroll.X = (scroll.X / length) * Game.Settings.Game.ViewportEdgeScrollStep; scroll.Y = (scroll.Y / length) * Game.Settings.Game.ViewportEdgeScrollStep;