From: divverent Date: Sat, 22 Dec 2007 09:34:52 +0000 (+0000) Subject: this may fix the word wrap issue, hopefully X-Git-Tag: xonotic-v0.1.0preview~2656 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=98a8de78b00646eb1674620e22becd243412d17c;p=xonotic%2Fdarkplaces.git this may fix the word wrap issue, hopefully git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7835 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/console.c b/console.c index 82c35dd6..a3d7bb5c 100644 --- a/console.c +++ b/console.c @@ -1180,7 +1180,16 @@ float Con_WordWidthFunc(void *passthrough, const char *w, size_t *length, float ti->colorindex = -1; return ti->fontsize * ti->font->width_of[0]; } - return DrawQ_TextWidth_Font_UntilWidth(w, length, false, ti->font, maxWidth) * ti->fontsize; + if(maxWidth >= 0) + return DrawQ_TextWidth_Font_UntilWidth(w, length, false, ti->font, maxWidth / ti->fontsize) * ti->fontsize; + else if(maxWidth == -1) + return DrawQ_TextWidth_Font(w, *length, false, ti->font) * ti->fontsize; + else + { + printf("Con_WordWidthFunc: can't get here (maxWidth should never be %f)\n", maxWidth); + // Note: this is NOT a Con_Printf, as it could print recursively + return 0; + } } int Con_CountLineFunc(void *passthrough, const char *line, size_t length, float width, qboolean isContinuation)