fixed HitTest for yaml chrome

This commit is contained in:
Chris Forbes
2010-03-16 19:02:24 +13:00
parent bba765cb4b
commit 088b97fd96
2 changed files with 6 additions and 7 deletions

View File

@@ -1069,7 +1069,8 @@ namespace OpenRA
public bool HitTest(int2 mousePos) 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) void DrawRightAligned(string text, int2 pos, Color c)

View File

@@ -2,10 +2,8 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using OpenRA.FileFormats; using OpenRA.FileFormats;
using OpenRA.Graphics;
using OpenRA.Widgets.Delegates; using OpenRA.Widgets.Delegates;
namespace OpenRA.Widgets namespace OpenRA.Widgets
{ {
public class Widget public class Widget
@@ -54,7 +52,6 @@ namespace OpenRA.Widgets
child.Initialize(); child.Initialize();
EventBounds = Rectangle.Union(EventBounds, child.EventBounds); EventBounds = Rectangle.Union(EventBounds, child.EventBounds);
} }
} }
public virtual void UpdateEventBounds() public virtual void UpdateEventBounds()
@@ -119,5 +116,6 @@ namespace OpenRA.Widgets
} }
} }
class ContainerWidget : Widget { } class ContainerWidget : Widget { }
} }