mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
fixed cut off broadcast. Closes #398
This commit is contained in:
parent
df47aedbfe
commit
91f642fac2
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue