From 1d7770cab4125758db17ebce95df40000a265069 Mon Sep 17 00:00:00 2001 From: FruitieX Date: Thu, 17 Jun 2010 13:09:30 +0300 Subject: [PATCH] add a failsafe to resizing so that panels can NEVER be resized to a negative size by code, happens if panel is inside another panel, and resizeorigin is also inside that panel --- qcsrc/client/hud.qc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 55428f061..658af451c 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -1282,6 +1282,10 @@ void HUD_Panel_SetPosSize(float id) } } + // minimum panel size cap, do this once more so we NEVER EVER EVER have a panel smaller than this, JUST IN CASE above code still makes the panel eg negative (impossible to resize back without changing cvars manually then) + mySize_x = max(0.025 * vid_conwidth, mySize_x); + mySize_y = max(0.025 * vid_conheight, mySize_y); + // do another pos check, as size might have changed by now if(resizeCorner == 1) { myPos_x = resizeorigin_x - mySize_x; -- 2.39.2