BRect::Intersects() should return false if the passed rect is invalid

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8359 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2004-07-09 07:56:50 +00:00
parent 61c93e14bc
commit 06a6652107
+6 -6
View File
@@ -1,5 +1,5 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Copyright (c) 2001-2003, OpenBeOS // Copyright (c) 2001-2004, Haiku, Inc.
// //
// Permission is hereby granted, free of charge, to any person obtaining a // Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"), // copy of this software and associated documentation files (the "Software"),
@@ -247,11 +247,11 @@ BRect::operator|(BRect rect) const
bool bool
BRect::Intersects(BRect rect) const BRect::Intersects(BRect rect) const
{ {
if (!(rect.left > right || rect.right < left if (!IsValid() || !rect.IsValid())
|| rect.top > bottom || rect.bottom < top)) return false;
return true;
return !(rect.left > right || rect.right < left
return false; || rect.top > bottom || rect.bottom < top);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool bool