diff options
| -rw-r--r-- | src/engine/client/text.cpp | 17 | ||||
| -rw-r--r-- | src/game/client/components/broadcast.cpp | 2 |
2 files changed, 9 insertions, 10 deletions
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; diff --git a/src/game/client/components/broadcast.cpp b/src/game/client/components/broadcast.cpp index a4940ed7..c262fff0 100644 --- a/src/game/client/components/broadcast.cpp +++ b/src/game/client/components/broadcast.cpp @@ -23,7 +23,7 @@ void CBroadcast::OnRender() { CTextCursor Cursor; TextRender()->SetCursor(&Cursor, m_BroadcastRenderOffset, 40.0f, 12.0f, TEXTFLAG_RENDER|TEXTFLAG_STOP_AT_END); - Cursor.m_LineWidth = 300*Graphics()->ScreenAspect()-2*m_BroadcastRenderOffset; + Cursor.m_LineWidth = 300*Graphics()->ScreenAspect()-m_BroadcastRenderOffset; TextRender()->TextEx(&Cursor, m_aBroadcastText, -1); } } |