Added int2.Clamp(Rectangle). All queries for map geometry use map.Bounds.

This commit is contained in:
Paul Chote
2010-11-24 12:24:48 +13:00
parent 1dfe437641
commit fc5830a687
14 changed files with 63 additions and 52 deletions

View File

@@ -52,8 +52,7 @@ namespace OpenRA.Graphics
private int2 NormalizeScrollPosition(int2 newScrollPosition)
{
return new int2(Math.Min(adjustedMapBounds.Right, Math.Max(newScrollPosition.X, adjustedMapBounds.Left)),
Math.Min(adjustedMapBounds.Bottom, Math.Max(newScrollPosition.Y, adjustedMapBounds.Top)));
return newScrollPosition.Clamp(adjustedMapBounds);
}
public ScrollDirection GetBlockedDirections()