Fix BackgroundWidget eating input outside its bounds.
This commit is contained in:
@@ -30,8 +30,12 @@ namespace OpenRA.Widgets
|
|||||||
|
|
||||||
public override bool HandleMouseInput(MouseInput mi)
|
public override bool HandleMouseInput(MouseInput mi)
|
||||||
{
|
{
|
||||||
if (ClickThrough) return false;
|
if (ClickThrough || !Bounds.Contains(mi.Location))
|
||||||
if (!Draggable || moving && (!TakeFocus(mi) || mi.Button != MouseButton.Left)) return true;
|
return false;
|
||||||
|
|
||||||
|
if (!Draggable || moving && (!TakeFocus(mi) || mi.Button != MouseButton.Left))
|
||||||
|
return true;
|
||||||
|
|
||||||
if (prevMouseLocation == null)
|
if (prevMouseLocation == null)
|
||||||
prevMouseLocation = mi.Location;
|
prevMouseLocation = mi.Location;
|
||||||
var vec = mi.Location - (int2)prevMouseLocation;
|
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);
|
Bounds = new Rectangle(Bounds.X + vec.X, Bounds.Y + vec.Y, Bounds.Width, Bounds.Height);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user