diff options
| author | Max Horn | 2009-04-09 17:08:09 +0000 |
|---|---|---|
| committer | Max Horn | 2009-04-09 17:08:09 +0000 |
| commit | a1dc2ecc6342f77a4c663057ce00c388092124f2 (patch) | |
| tree | 5b55866fe48f79cb14d1242949bd7473f9f99643 /common | |
| parent | c473fa849d7539444c1810ce48cb83dec31a7916 (diff) | |
| download | scummvm-rg350-a1dc2ecc6342f77a4c663057ce00c388092124f2.tar.gz scummvm-rg350-a1dc2ecc6342f77a4c663057ce00c388092124f2.tar.bz2 scummvm-rg350-a1dc2ecc6342f77a4c663057ce00c388092124f2.zip | |
Rewrote Common::Rect::contains(Rect) to do what the name suggests (check whether one rect contains the other). Previously, foo.contains(foo) would return false. Added/enabled unit tets for this
svn-id: r39911
Diffstat (limited to 'common')
| -rw-r--r-- | common/rect.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/rect.h b/common/rect.h index d01d910c3e..a0ccd07f90 100644 --- a/common/rect.h +++ b/common/rect.h @@ -127,14 +127,14 @@ struct Rect { } /** - * Check if the given rect is _fully_ contained inside this rectangle. + * Check if the given rect is contained inside this rectangle. * * @param r The rectangle to check * * @return true if the given rect is inside, false otherwise */ bool contains(const Rect &r) const { - return (left < r.left) && (right > r.right) && (top < r.top) && (bottom > r.bottom); + return (left <= r.left) && (r.right <= right) && (top <= r.top) && (r.bottom <= bottom); } /** |
