Include selection decorations when calculating ScreenMap bounds.

This commit is contained in:
Paul Chote
2020-04-28 13:44:29 +01:00
committed by abcdefg30
parent c2156af7b0
commit e42d177920
2 changed files with 22 additions and 2 deletions

View File

@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public override object Create(ActorInitializer init) { return new SelectionDecorations(init.Self, this); }
}
public class SelectionDecorations : SelectionDecorationsBase
public class SelectionDecorations : SelectionDecorationsBase, IRender
{
readonly Interactable interactable;
@@ -62,5 +62,15 @@ namespace OpenRA.Mods.Common.Traits.Render
var bounds = interactable.DecorationBounds(self, wr);
yield return new SelectionBarsAnnotationRenderable(self, bounds, displayHealth, displayExtra);
}
IEnumerable<IRenderable> IRender.Render(Actor self, WorldRenderer wr)
{
yield break;
}
IEnumerable<Rectangle> IRender.ScreenBounds(Actor self, WorldRenderer wr)
{
yield return interactable.DecorationBounds(self, wr);
}
}
}