diff --git a/OpenRA.Game/Chrome.cs b/OpenRA.Game/Chrome.cs index 7bcebc7d44..b9679ddf86 100644 --- a/OpenRA.Game/Chrome.cs +++ b/OpenRA.Game/Chrome.cs @@ -1069,7 +1069,8 @@ namespace OpenRA public bool HitTest(int2 mousePos) { - return buttons.Any(a => a.First.Contains(mousePos.ToPoint())); + return WidgetLoader.rootWidget.EventBounds.Contains(mousePos.X, mousePos.Y) + || buttons.Any(a => a.First.Contains(mousePos.ToPoint())); } void DrawRightAligned(string text, int2 pos, Color c) diff --git a/OpenRA.Game/Chrome/Widget.cs b/OpenRA.Game/Chrome/Widget.cs index 82b1b26113..691ded52fd 100644 --- a/OpenRA.Game/Chrome/Widget.cs +++ b/OpenRA.Game/Chrome/Widget.cs @@ -1,11 +1,9 @@ using System; using System.Collections.Generic; using System.Drawing; -using OpenRA.FileFormats; -using OpenRA.Graphics; +using OpenRA.FileFormats; using OpenRA.Widgets.Delegates; - namespace OpenRA.Widgets { public class Widget @@ -54,7 +52,6 @@ namespace OpenRA.Widgets child.Initialize(); EventBounds = Rectangle.Union(EventBounds, child.EventBounds); } - } public virtual void UpdateEventBounds() @@ -118,6 +115,7 @@ namespace OpenRA.Widgets return null; } - } - class ContainerWidget : Widget { } + } + + class ContainerWidget : Widget { } } \ No newline at end of file