Fix BackgroundWidget eating input outside its bounds.

This commit is contained in:
Paul Chote
2013-07-11 19:19:02 +12:00
parent 045eb12388
commit a783321c03

View File

@@ -30,8 +30,12 @@ namespace OpenRA.Widgets
public override bool HandleMouseInput(MouseInput mi)
{
if (ClickThrough) return false;
if (!Draggable || moving && (!TakeFocus(mi) || mi.Button != MouseButton.Left)) return true;
if (ClickThrough || !Bounds.Contains(mi.Location))
return false;
if (!Draggable || moving && (!TakeFocus(mi) || mi.Button != MouseButton.Left))
return true;
if (prevMouseLocation == null)
prevMouseLocation = mi.Location;
var vec = mi.Location - (int2)prevMouseLocation;
@@ -51,6 +55,7 @@ namespace OpenRA.Widgets
Bounds = new Rectangle(Bounds.X + vec.X, Bounds.Y + vec.Y, Bounds.Width, Bounds.Height);
break;
}
return true;
}