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 IsometricSelectionDecorations(init.Self, this); }
}
public class IsometricSelectionDecorations : SelectionDecorationsBase
public class IsometricSelectionDecorations : SelectionDecorationsBase, IRender
{
readonly IsometricSelectable selectable;
@@ -61,5 +61,15 @@ namespace OpenRA.Mods.Common.Traits.Render
var bounds = selectable.DecorationBounds(self, wr);
yield return new IsometricSelectionBarsAnnotationRenderable(self, bounds, displayHealth, displayExtra);
}
IEnumerable<IRenderable> IRender.Render(Actor self, WorldRenderer wr)
{
yield break;
}
IEnumerable<Rectangle> IRender.ScreenBounds(Actor self, WorldRenderer wr)
{
yield return selectable.DecorationBounds(self, wr).BoundingRect;
}
}
}