Fixed a bug in BRegion copy constructor. If one constructed a BRegion with

BRegion region(region), the region would have been put into an unitialized state. Took the chance to cleanup a bit the code, using some methods of clipping.h. Changed the way offset_rect works, and changed its name too. Added a note to Region.cpp


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4512 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2003-09-05 10:16:34 +00:00
parent e4bd4b6b58
commit 8d1a0ee7c1
4 changed files with 83 additions and 100 deletions
+9 -14
View File
@@ -42,6 +42,15 @@ sect_rect(clipping_rect r1, clipping_rect r2)
return rect;
}
static inline void
offset_rect(clipping_rect &rect, int32 x, int32 y)
{
rect.left += x;
rect.top += y;
rect.right += x;
rect.bottom += y;
}
static inline BRect
to_BRect(clipping_rect rect)
@@ -113,18 +122,4 @@ rect_height(clipping_rect rect)
return rect.bottom - rect.top;
}
static inline clipping_rect
rect_offset(clipping_rect rect, int32 x, int32 y)
{
clipping_rect offRect;
offRect.left = rect.left + x;
offRect.top = rect.top + y;
offRect.right = rect.right + x;
offRect.bottom = rect.bottom + y;
return offRect;
}
#endif // __CLIPPING_H