summaryrefslogtreecommitdiffstats
path: root/src/math
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-06-23 13:11:41 +0200
committeraap <aap@papnet.eu>2019-06-23 13:11:41 +0200
commita5ba53896881ec479f9819ab0349437de4c3f4ed (patch)
tree89471ebfcd3b95fdb3b35a13bcdb605d27694973 /src/math
parentfixed key binding, head shots, freezes (diff)
downloadre3-a5ba53896881ec479f9819ab0349437de4c3f4ed.tar
re3-a5ba53896881ec479f9819ab0349437de4c3f4ed.tar.gz
re3-a5ba53896881ec479f9819ab0349437de4c3f4ed.tar.bz2
re3-a5ba53896881ec479f9819ab0349437de4c3f4ed.tar.lz
re3-a5ba53896881ec479f9819ab0349437de4c3f4ed.tar.xz
re3-a5ba53896881ec479f9819ab0349437de4c3f4ed.tar.zst
re3-a5ba53896881ec479f9819ab0349437de4c3f4ed.zip
Diffstat (limited to 'src/math')
-rw-r--r--src/math/Rect.h16
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; }
};