Replace dynamic Actor.Bounds with the (unchanging) relative rect.
This commit is contained in:
@@ -150,14 +150,15 @@ namespace OpenRA.Graphics
|
||||
Game.Renderer.Flush();
|
||||
}
|
||||
|
||||
public void DrawSelectionBox(Actor selectedUnit, Color c)
|
||||
public void DrawSelectionBox(Actor a, Color c)
|
||||
{
|
||||
var bounds = selectedUnit.Bounds.Value;
|
||||
var pos = ScreenPxPosition(a.CenterPosition);
|
||||
var bounds = a.Bounds.Value;
|
||||
|
||||
var xy = new float2(bounds.Left, bounds.Top);
|
||||
var Xy = new float2(bounds.Right, bounds.Top);
|
||||
var xY = new float2(bounds.Left, bounds.Bottom);
|
||||
var XY = new float2(bounds.Right, bounds.Bottom);
|
||||
var xy = pos + new float2(bounds.Left, bounds.Top);
|
||||
var Xy = pos + new float2(bounds.Right, bounds.Top);
|
||||
var xY = pos + new float2(bounds.Left, bounds.Bottom);
|
||||
var XY = pos + new float2(bounds.Right, bounds.Bottom);
|
||||
|
||||
var wlr = Game.Renderer.WorldLineRenderer;
|
||||
wlr.DrawLine(xy, xy + new float2(4, 0), c, c);
|
||||
|
||||
Reference in New Issue
Block a user