From 1908310788689a5e9ea89336bcd3bd186b2f12ac Mon Sep 17 00:00:00 2001 From: Spoike Date: Mon, 23 Jun 2014 16:18:00 +0000 Subject: [PATCH] try to fix centerprint bug. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4696 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/gl/gl_font.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/gl/gl_font.c b/engine/gl/gl_font.c index e507fdc86..49af08e7f 100644 --- a/engine/gl/gl_font.c +++ b/engine/gl/gl_font.c @@ -1548,9 +1548,9 @@ int Font_LineBreaks(conchar_t *start, conchar_t *end, int maxpixelwidth, int max // scan the width of the line for (px=0, l=0 ; px <= maxpixelwidth; ) { - l++; - if (start+l >= end || (start[l-1]&(CON_CHARMASK|CON_HIDDEN)) == '\n') + if (start+l >= end || (start[l]&(CON_CHARMASK|CON_HIDDEN)) == '\n') break; + l++; px = Font_CharEndCoord(font, px, start[l]); } //if we did get to the end @@ -1576,7 +1576,7 @@ int Font_LineBreaks(conchar_t *start, conchar_t *end, int maxpixelwidth, int max if (start == end) break; - if ((*start&(CON_CHARMASK|CON_HIDDEN)) == '\n'||!l) + if ((*start&(CON_CHARMASK|CON_HIDDEN)) == '\n') start++; // skip the \n }