diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2019-06-26 22:34:14 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2019-06-26 22:34:14 +0200 |
commit | 08b053a568e15dd318dcfc46eaa6393af4a5f8c4 (patch) | |
tree | 7e6a0bc15376f347c13029b99f2f0ec1427bf2c1 /src/math/Rect.h | |
parent | More replay stuff (diff) | |
parent | bla (diff) | |
download | re3-08b053a568e15dd318dcfc46eaa6393af4a5f8c4.tar re3-08b053a568e15dd318dcfc46eaa6393af4a5f8c4.tar.gz re3-08b053a568e15dd318dcfc46eaa6393af4a5f8c4.tar.bz2 re3-08b053a568e15dd318dcfc46eaa6393af4a5f8c4.tar.lz re3-08b053a568e15dd318dcfc46eaa6393af4a5f8c4.tar.xz re3-08b053a568e15dd318dcfc46eaa6393af4a5f8c4.tar.zst re3-08b053a568e15dd318dcfc46eaa6393af4a5f8c4.zip |
Diffstat (limited to '')
-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; } }; |