adjusted bounds to take altitude into account

This commit is contained in:
Chris Forbes
2009-12-21 18:35:22 +13:00
parent 9a0b15ac23
commit e2ef5d8bc3
2 changed files with 12 additions and 7 deletions

View File

@@ -102,6 +102,11 @@ namespace OpenRa.Game
{
var size = SelectedSize;
var loc = CenterLocation - 0.5f * size;
var unit = traits.GetOrDefault<Unit>();
if (unit != null)
loc -= new float2(0, unit.Altitude);
return new RectangleF(loc.X, loc.Y, size.X, size.Y);
}
}