mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
fixed text rendering problem. Closes #12
This commit is contained in:
parent
cabecb7fa9
commit
0f72fd19ef
|
@ -571,6 +571,8 @@ public:
|
||||||
pSizeData = GetSize(pFont, ActualSize);
|
pSizeData = GetSize(pFont, ActualSize);
|
||||||
RenderSetup(pFont, ActualSize);
|
RenderSetup(pFont, ActualSize);
|
||||||
|
|
||||||
|
float Scale = 1/pSizeData->m_FontSize;
|
||||||
|
|
||||||
// set length
|
// set length
|
||||||
if(Length < 0)
|
if(Length < 0)
|
||||||
Length = str_length(pText);
|
Length = str_length(pText);
|
||||||
|
@ -679,7 +681,7 @@ public:
|
||||||
Graphics()->QuadsDrawTL(&QuadItem, 1);
|
Graphics()->QuadsDrawTL(&QuadItem, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
Advance = pChr->m_AdvanceX + Kerning(pFont, Character, Nextcharacter)/Size;
|
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)
|
if(pCursor->m_Flags&TEXTFLAG_STOP_AT_END && DrawX+(Advance+pChr->m_Width)*Size-pCursor->m_StartX > pCursor->m_LineWidth)
|
||||||
|
|
Loading…
Reference in a new issue