Ignore empty children when aggregating EventBounds.
This commit is contained in:
@@ -284,8 +284,15 @@ namespace OpenRA.Widgets
|
|||||||
// PERF: Avoid LINQ.
|
// PERF: Avoid LINQ.
|
||||||
var bounds = EventBounds;
|
var bounds = EventBounds;
|
||||||
foreach (var child in Children)
|
foreach (var child in Children)
|
||||||
|
{
|
||||||
if (child.IsVisible())
|
if (child.IsVisible())
|
||||||
bounds = Rectangle.Union(bounds, child.GetEventBounds());
|
{
|
||||||
|
var childBounds = child.GetEventBounds();
|
||||||
|
if (childBounds != Rectangle.Empty)
|
||||||
|
bounds = Rectangle.Union(bounds, childBounds);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return bounds;
|
return bounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user