diff options
Diffstat (limited to 'src/math/Rect.h')
-rw-r--r-- | src/math/Rect.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/math/Rect.h b/src/math/Rect.h index d0824987..fd1bd05e 100644 --- a/src/math/Rect.h +++ b/src/math/Rect.h @@ -26,4 +26,20 @@ public: if(v.y < top) top = v.y; if(v.y > bottom) bottom = v.y; } + + void Translate(float x, float y){ + left += x; + right += x; + bottom += y; + top += y; + } + void Grow(float r){ + left -= r; + right += r; + top -= r; + bottom += r; + } + + float GetWidth(void) { return right - left; } + float GetHeight(void) { return bottom - top; } }; |