Remove PVecInt from Viewport.

This commit is contained in:
Paul Chote
2013-09-27 15:53:24 +12:00
parent 68a0070fa6
commit b96c430f84

View File

@@ -159,12 +159,10 @@ namespace OpenRA.Graphics
public void Center(IEnumerable<Actor> actors)
{
if (!actors.Any()) return;
if (!actors.Any())
return;
var avgPos = actors
.Select(a => (PVecInt)a.CenterLocation)
.Aggregate((a, b) => a + b) / actors.Count();
scrollPosition = NormalizeScrollPosition((avgPos.ToFloat2() - (1f / (2 * Zoom) * screenSize.ToFloat2())).ToInt2());
Center(actors.Select(a => a.CenterPosition).Average().ToCPos().ToFloat2());
}
// Rectangle (in viewport coords) that contains things to be drawn