From 91f642fac2362b03c5246f76883dd2eadc54abdd Mon Sep 17 00:00:00 2001 From: oy Date: Sun, 9 Jan 2011 23:25:07 +0100 Subject: fixed cut off broadcast. Closes #398 --- src/engine/client/text.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/engine/client/text.cpp') diff --git a/src/engine/client/text.cpp b/src/engine/client/text.cpp index 828aa3fd..d24c41ae 100644 --- a/src/engine/client/text.cpp +++ b/src/engine/client/text.cpp @@ -688,21 +688,20 @@ public: if(pChr) { + Advance = pChr->m_AdvanceX + Kerning(pFont, Character, Nextcharacter)*Scale; + if(pCursor->m_Flags&TEXTFLAG_STOP_AT_END && DrawX+Advance*Size-pCursor->m_StartX > pCursor->m_LineWidth) + { + // we hit the end of the line, no more to render or count + pCurrent = pEnd; + break; + } + if(pCursor->m_Flags&TEXTFLAG_RENDER) { Graphics()->QuadsSetSubset(pChr->m_aUvs[0], pChr->m_aUvs[1], pChr->m_aUvs[2], pChr->m_aUvs[3]); IGraphics::CQuadItem QuadItem(DrawX+pChr->m_OffsetX*Size, DrawY+pChr->m_OffsetY*Size, pChr->m_Width*Size, pChr->m_Height*Size); Graphics()->QuadsDrawTL(&QuadItem, 1); } - - Advance = pChr->m_AdvanceX + Kerning(pFont, Character, Nextcharacter)*Scale; - } - - if(pCursor->m_Flags&TEXTFLAG_STOP_AT_END && DrawX+(Advance+pChr->m_Width)*Size-pCursor->m_StartX > pCursor->m_LineWidth) - { - // we hit the end of the line, no more to render or count - pCurrent = pEnd; - break; } DrawX += Advance*Size; -- cgit 1.4.1