From: FruitieX Date: Thu, 17 Jun 2010 10:09:30 +0000 (+0300) Subject: add a failsafe to resizing so that panels can NEVER be resized to a negative size... X-Git-Tag: xonotic-v0.1.0preview~541^2~19 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=1d7770cab4125758db17ebce95df40000a265069 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 --- 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;