Fixed some bugs reported by Stephan. You were right after all :)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15237 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2005-11-30 09:12:24 +00:00
parent 5c2728e222
commit 927995cedd
@@ -267,12 +267,9 @@ ClipRegion::Exclude(const BRect &rect)
void void
ClipRegion::Exclude(const ClipRegion &region) ClipRegion::Exclude(const ClipRegion &region)
{ {
if (fCount == 0) if (fCount == 0 || region.fCount == 0 || !rects_intersect(fBound, region.fBound))
return; return;
if (region.fCount == 0 || !rects_intersect(fBound, region.fBound))
*this = region;
else
_ExcludeComplex(region); _ExcludeComplex(region);
} }
@@ -296,7 +293,7 @@ ClipRegion::operator=(const ClipRegion &region)
void void
ClipRegion::_IntersectWithComplex(const ClipRegion &region) ClipRegion::_IntersectWithComplex(const ClipRegion &region)
{ {
ClipRegion dest(*this); ClipRegion dest;
for (int32 f = 0; f < fCount; f++) { for (int32 f = 0; f < fCount; f++) {
for (int32 s = 0; s < region.fCount; s++) { for (int32 s = 0; s < region.fCount; s++) {