diff options
Diffstat (limited to 'src/cgame/cg_draw.c')
-rw-r--r-- | src/cgame/cg_draw.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index ea7d0a1c..780ac7ed 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -2261,6 +2261,7 @@ static void CG_DrawLocation( rectDef_t *rect, float scale, int textalign, vec4_t float maxX; float tx = rect->x, ty = rect->y; maxX = rect->x + rect->w; + qboolean aligned = qfalse; locent = CG_GetPlayerLocation( ); if( locent ) @@ -2269,9 +2270,15 @@ static void CG_DrawLocation( rectDef_t *rect, float scale, int textalign, vec4_t location = CG_ConfigString( CS_LOCATIONS ); if( UI_Text_Width( location, scale, 0 ) < rect->w ) + { CG_AlignText( rect, location, scale, 0.0f, 0.0f, textalign, VALIGN_CENTER, &tx, &ty ); + aligned = qtrue; + } - UI_Text_Paint_Limit( &maxX, tx, ty, scale, color, location, 0, 0 ); + if( aligned && textalign == ALIGN_RIGHT ) // If we aligned right, we're not going to cut off on the right + UI_Text_Paint( tx, ty, scale, color, location, 0, 0, ITEM_TEXTSTYLE_NORMAL ); + else + UI_Text_Paint_Limit( &maxX, tx, ty, scale, color, location, 0, 0 ); trap_R_SetColor( NULL ); } |