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:
@@ -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
|
||||
// copy of this software and associated documentation files (the "Software"),
|
||||
@@ -247,11 +247,11 @@ BRect::operator|(BRect rect) const
|
||||
bool
|
||||
BRect::Intersects(BRect rect) const
|
||||
{
|
||||
if (!(rect.left > right || rect.right < left
|
||||
|| rect.top > bottom || rect.bottom < top))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
if (!IsValid() || !rect.IsValid())
|
||||
return false;
|
||||
|
||||
return !(rect.left > right || rect.right < left
|
||||
|| rect.top > bottom || rect.bottom < top);
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
bool
|
||||
|
||||
Reference in New Issue
Block a user