about summary refs log tree commit diff
path: root/src/game/client/ui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/client/ui.cpp')
-rw-r--r--src/game/client/ui.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/game/client/ui.cpp b/src/game/client/ui.cpp
index 020a0c70..23643e2a 100644
--- a/src/game/client/ui.cpp
+++ b/src/game/client/ui.cpp
@@ -94,6 +94,28 @@ void CUI::ClipDisable()
 	Graphics()->ClipDisable();
 }
 
+void CUIRect::HSplitMid(CUIRect *pTop, CUIRect *pBottom) const
+{
+	CUIRect r = *this;
+    float Cut = r.h/2;
+
+    if(pTop)
+    {
+        pTop->x = r.x;
+        pTop->y = r.y;
+        pTop->w = r.w;
+        pTop->h = Cut;
+    }
+
+    if(pBottom)
+    {
+        pBottom->x = r.x;
+        pBottom->y = r.y + Cut;
+        pBottom->w = r.w;
+        pBottom->h = r.h - Cut;
+    }
+}
+
 void CUIRect::HSplitTop(float Cut, CUIRect *pTop, CUIRect *pBottom) const
 {
     CUIRect r = *this;