Skip to content

Commit

Permalink
More Vector2 Overloads
Browse files Browse the repository at this point in the history
Includes Vi2, Vu2 and Vf2 for both Rects
  • Loading branch information
Rosst0pher committed Jul 30, 2020
1 parent 45ec2c7 commit 3c2e66d
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions src/SFML.Graphics/Rect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,32 @@ public bool Contains(Vector2i point)
return Contains(point.X, point.Y);
}


////////////////////////////////////////////////////////////
/// <summary>
/// Check if a point is inside the rectangle's area
/// </summary>
/// <param name="point">Vector2 position of the point to test</param>
/// <returns>True if the point is inside</returns>
////////////////////////////////////////////////////////////
public bool Contains(Vector2u point)
{
return Contains((Vector2i)point);
}


////////////////////////////////////////////////////////////
/// <summary>
/// Check if a point is inside the rectangle's area
/// </summary>
/// <param name="point">Vector2 position of the point to test</param>
/// <returns>True if the point is inside</returns>
////////////////////////////////////////////////////////////
public bool Contains(Vector2f point)
{
return Contains((Vector2i)point);
}

////////////////////////////////////////////////////////////
/// <summary>
/// Check intersection between two rectangles
Expand Down Expand Up @@ -300,6 +326,31 @@ public bool Contains(Vector2f point)
return Contains(point.X, point.Y);
}

////////////////////////////////////////////////////////////
/// <summary>
/// Check if a point is inside the rectangle's area
/// </summary>
/// <param name="point">Vector2 position of the point to test</param>
/// <returns>True if the point is inside</returns>
////////////////////////////////////////////////////////////
public bool Contains(Vector2i point)
{
return Contains((Vector2f)point);
}


////////////////////////////////////////////////////////////
/// <summary>
/// Check if a point is inside the rectangle's area
/// </summary>
/// <param name="point">Vector2 position of the point to test</param>
/// <returns>True if the point is inside</returns>
////////////////////////////////////////////////////////////
public bool Contains(Vector2u point)
{
return Contains((Vector2i)point);
}

////////////////////////////////////////////////////////////
/// <summary>
/// Check intersection between two rectangles
Expand Down

0 comments on commit 3c2e66d

Please sign in to comment.