#231 scroll jumping fixed

This commit is contained in:
Chris Forbes
2010-10-09 08:12:01 +13:00
parent 465f5d295b
commit ef96604f9e

View File

@@ -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;