Allow to draw BorderPicture without borders in menu too
authorterencehill <piuntn@gmail.com>
Wed, 4 Aug 2010 18:55:12 +0000 (20:55 +0200)
committerterencehill <piuntn@gmail.com>
Wed, 4 Aug 2010 18:55:12 +0000 (20:55 +0200)
This actually fix menu dialogs with exaggerated dimensions using HEIGHT_DIALOGBORDER 0

qcsrc/menu/draw.qc

index cec73d6c0a2f146d89b9298e21723d0976694442..1bda59583bb2dad9c7566657ea33b98de5040bfb 100644 (file)
@@ -167,6 +167,12 @@ void draw_BorderPicture(vector theOrigin, string pic, vector theSize, vector the
        vector dX, dY;
        vector width, height;
        vector bW, bH;
+       if (theBorderSize_x <= 0 && theBorderSize_y <= 0) // no border
+       {
+               // draw only the central part
+               drawsubpic(theOrigin, theSize, pic, '0.25 0.25 0', '0.5 0.5 0', theColor, theAlpha, 0);
+               return;
+       }
        pic = draw_UseSkinFor(pic);
        theOrigin = boxToGlobal(theOrigin, draw_shift, draw_scale);
        theSize = boxToGlobalSize(theSize, draw_scale);