Add extension methods to Rectangle/RectangleF, remove a pile of ToPoint()'s.
This commit is contained in:
@@ -88,7 +88,7 @@ namespace OpenRA.Widgets
|
||||
|
||||
case MouseInputEvent.Down:
|
||||
{
|
||||
if (thumbRect.Contains(mi.Location.ToPoint()))
|
||||
if (thumbRect.Contains(mi.Location))
|
||||
{
|
||||
isMoving = true;
|
||||
lastMouseLocation = mi.Location;
|
||||
@@ -103,7 +103,7 @@ namespace OpenRA.Widgets
|
||||
: Math.Floor((pos - delta) * (Ticks - 1)));
|
||||
OnChange(targetTick / (Ticks - 1));
|
||||
|
||||
if (thumbRect.Contains(mi.Location.ToPoint()))
|
||||
if (thumbRect.Contains(mi.Location))
|
||||
{
|
||||
isMoving = true;
|
||||
lastMouseLocation = mi.Location;
|
||||
@@ -119,7 +119,7 @@ namespace OpenRA.Widgets
|
||||
{
|
||||
OnChange(newOffset);
|
||||
|
||||
if (thumbRect.Contains(mi.Location.ToPoint()))
|
||||
if (thumbRect.Contains(mi.Location))
|
||||
{
|
||||
isMoving = true;
|
||||
lastMouseLocation = mi.Location;
|
||||
|
||||
@@ -180,7 +180,7 @@ namespace OpenRA.Widgets
|
||||
public string GetCursorOuter(int2 pos)
|
||||
{
|
||||
// Is the cursor on top of us?
|
||||
if (!(IsVisible() && GetEventBounds().Contains(pos.ToPoint())))
|
||||
if (!(IsVisible() && GetEventBounds().Contains(pos)))
|
||||
return null;
|
||||
|
||||
// Do any of our children specify a cursor?
|
||||
@@ -191,7 +191,7 @@ namespace OpenRA.Widgets
|
||||
return cc;
|
||||
}
|
||||
|
||||
return EventBounds.Contains(pos.ToPoint()) ? GetCursor(pos) : null;
|
||||
return EventBounds.Contains(pos) ? GetCursor(pos) : null;
|
||||
}
|
||||
|
||||
public static bool HandleInput(MouseInput mi)
|
||||
|
||||
Reference in New Issue
Block a user