summaryrefslogtreecommitdiff
path: root/src/ui/ui_shared.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/ui_shared.c')
-rw-r--r--src/ui/ui_shared.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/ui/ui_shared.c b/src/ui/ui_shared.c
index 4f579e4a..1fbee153 100644
--- a/src/ui/ui_shared.c
+++ b/src/ui/ui_shared.c
@@ -1954,7 +1954,7 @@ static float UI_Parse_Indent( const char **text )
float UI_Text_Width( const char *text, float scale, int limit )
{
- int count, len;
+ int count;
float out;
glyphInfo_t *glyph;
float useScale;
@@ -1978,15 +1978,10 @@ float UI_Text_Width( const char *text, float scale, int limit )
if( text )
{
- len = Q_PrintStrlen( text );
-
- if( limit > 0 && len > limit )
- len = limit;
-
count = 0;
indentWidth = UI_Parse_Indent( &s );
- while( s && *s && count < len )
+ while( s && *s && ( limit == 0 || count < limit ) )
{
glyph = &font->glyphs[( int )*s];