summaryrefslogtreecommitdiff
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
parent047fa20f28890176e0d86191b3a9fd459d967785 (diff)
some Radar and Hud cleanup; fix in Physical
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; }
};