fixed HitTest for yaml chrome
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
using System;
|
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()
|
||||||
@@ -118,6 +115,7 @@ namespace OpenRA.Widgets
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
class ContainerWidget : Widget { }
|
|
||||||
|
class ContainerWidget : Widget { }
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user