Remove blatant abuse of RenderBounds
This commit is contained in:
@@ -65,7 +65,7 @@ namespace OpenRA.Widgets
|
||||
return true;
|
||||
}
|
||||
|
||||
public override Rectangle RenderBounds
|
||||
public override Rectangle EventBounds
|
||||
{
|
||||
get { return new Rectangle((int)radarOrigin.X + 9, (int)(radarOrigin.Y + (192 - radarMinimapHeight) / 2),
|
||||
192, (int)radarMinimapHeight);}
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace OpenRA.Widgets
|
||||
clock = new Animation("clock");
|
||||
}
|
||||
|
||||
public override Rectangle RenderBounds
|
||||
public override Rectangle EventBounds
|
||||
{
|
||||
get { return buttons.Any() ? buttons.Select(b => b.First).Aggregate(Rectangle.Union) : Bounds; }
|
||||
}
|
||||
|
||||
@@ -129,10 +129,12 @@ namespace OpenRA.Widgets
|
||||
Game.CreateObject<IWidgetDelegate>(d);
|
||||
}
|
||||
|
||||
public virtual Rectangle EventBounds { get { return RenderBounds; } }
|
||||
|
||||
public bool HitTest(int2 xy)
|
||||
{
|
||||
if (!IsVisible()) return false;
|
||||
if (RenderBounds.Contains(xy.ToPoint()) && !ClickThrough) return true;
|
||||
if (EventBounds.Contains(xy.ToPoint()) && !ClickThrough) return true;
|
||||
|
||||
return Children.Any(c => c.HitTest(xy));
|
||||
}
|
||||
@@ -142,7 +144,7 @@ namespace OpenRA.Widgets
|
||||
return Children
|
||||
.Where(c => c.IsVisible())
|
||||
.Select(c => c.GetEventBounds())
|
||||
.Aggregate(RenderBounds, Rectangle.Union);
|
||||
.Aggregate(EventBounds, Rectangle.Union);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user