Ignore empty children when aggregating EventBounds.

This commit is contained in:
Paul Chote
2017-11-25 16:47:02 +00:00
committed by Pavel Penev
parent 65a2410738
commit 4994716cf7

View File

@@ -284,8 +284,15 @@ namespace OpenRA.Widgets
// PERF: Avoid LINQ.
var bounds = EventBounds;
foreach (var child in Children)
{
if (child.IsVisible())
bounds = Rectangle.Union(bounds, child.GetEventBounds());
{
var childBounds = child.GetEventBounds();
if (childBounds != Rectangle.Empty)
bounds = Rectangle.Union(bounds, childBounds);
}
}
return bounds;
}