BRegion: add ScaleBy method.

* Is there a reason to not have it?
This commit is contained in:
Adrien Destugues
2014-06-19 18:05:14 +02:00
parent 3fc9fd5624
commit 669ac9d6f5
3 changed files with 28 additions and 0 deletions
+10
View File
@@ -81,6 +81,16 @@ offset_rect(clipping_rect &rect, int32 x, int32 y)
}
static inline void
scale_rect(clipping_rect& rect, float x, float y)
{
rect.left = (int)(rect.left * x);
rect.top = (int)(rect.top * y);
rect.right = (int)(rect.right * x);
rect.bottom = (int)(rect.bottom * y);
}
// Converts the given clipping_rect to a BRect
static inline BRect
to_BRect(const clipping_rect &rect)