]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
add a failsafe to resizing so that panels can NEVER be resized to a negative size...
authorFruitieX <rasse@rasse-lappy.localdomain>
Thu, 17 Jun 2010 10:09:30 +0000 (13:09 +0300)
committerFruitieX <rasse@rasse-lappy.localdomain>
Thu, 17 Jun 2010 10:09:30 +0000 (13:09 +0300)
qcsrc/client/hud.qc

index 55428f061ffe476d2b6d7c94d592bc0074c63a85..658af451ce6ffd318e1576709b124f1b8003d577 100644 (file)
@@ -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;