From: Rudolf Polzer Date: Fri, 11 Oct 2013 05:33:52 +0000 (+0200) Subject: Bottom align the headings. X-Git-Tag: xonotic-v0.8.0~256^2~20 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=409f938e8826e207c6a53cbffa9adb2692e421cb;p=xonotic%2Fxonotic-data.pk3dir.git Bottom align the headings. --- diff --git a/qcsrc/menu/xonotic/serverlist.c b/qcsrc/menu/xonotic/serverlist.c index 69a4401c1..8b6139cff 100644 --- a/qcsrc/menu/xonotic/serverlist.c +++ b/qcsrc/menu/xonotic/serverlist.c @@ -1027,12 +1027,20 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float float item = CheckItemNumber(i); //print(sprintf("time: %f, i: %d, item: %d, nitems: %d\n", time, i, item, me.nItems)); - + + vector oldscale = draw_scale; + vector oldshift = draw_shift; +#define SET_YRANGE(start,end) \ + draw_scale = boxToGlobalSize(eX * 1 + eY * (end - start), oldscale); \ + draw_shift = boxToGlobal(eY * start, oldshift, oldscale); + if(item < 0) { entity catent = RetrieveCategoryEnt(-item); if(catent) { + float delta = (1 - 1 / me.categoriesHeight); + SET_YRANGE(delta, 1); // bottom align draw_Text( eY * me.realUpperMargin + @@ -1043,6 +1051,7 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float SKINALPHA_TEXT, 0 ); + SET_YRANGE(0, 1); return; } }