1
0
Fork 0
mirror of https://github.com/sbrl/Nibriboard.git synced 2018-01-10 21:33:49 +00:00

[server] Fix Rectangle Overlap() method

This commit is contained in:
Starbeamrainbowlabs 2017-05-04 21:35:27 +01:00
parent 19412e4361
commit 1b2d50b7af

View file

@ -11,6 +11,8 @@ namespace SBRL.Utilities
/// <changelog> /// <changelog>
/// v0.1 - 1st April 2017 /// v0.1 - 1st April 2017
/// - Added this changelog! /// - Added this changelog!
/// v0.2 - 4th May 2017
/// - Fixed Overlap(Rectangle otherRectangle) method
/// </changelog> /// </changelog>
public struct Rectangle public struct Rectangle
{ {
@ -144,9 +146,9 @@ namespace SBRL.Utilities
/// <returns>Whether this rectangle overlaps another rectangle.</returns> /// <returns>Whether this rectangle overlaps another rectangle.</returns>
public bool Overlap(Rectangle otherRectangle) public bool Overlap(Rectangle otherRectangle)
{ {
if(Top > otherRectangle.Bottom && if(Top > otherRectangle.Bottom ||
Bottom < otherRectangle.Top && Bottom < otherRectangle.Top ||
Left > otherRectangle.Right && Left > otherRectangle.Right ||
Right < otherRectangle.Left) Right < otherRectangle.Left)
return false; return false;