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:
parent
19412e4361
commit
1b2d50b7af
1 changed files with 5 additions and 3 deletions
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue