about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2011-01-09 23:25:07 +0100
committeroy <Tom_Adams@web.de>2011-01-09 23:25:07 +0100
commit91f642fac2362b03c5246f76883dd2eadc54abdd (patch)
tree933b7567238af398d634d40da5766be86b5b5daf /src
parentdf47aedbfebd9d5ab71cb8aeeede83a77c36de95 (diff)
downloadzcatch-91f642fac2362b03c5246f76883dd2eadc54abdd.tar.gz
zcatch-91f642fac2362b03c5246f76883dd2eadc54abdd.zip
fixed cut off broadcast. Closes #398
Diffstat (limited to 'src')
-rw-r--r--src/engine/client/text.cpp17
-rw-r--r--src/game/client/components/broadcast.cpp2
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);
 	}
 }