mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Render full text when it still fits
This commit is contained in:
parent
2818c6e17c
commit
c4bcf3d628
|
@ -1256,7 +1256,8 @@ public:
|
||||||
if((RenderFlags & TEXT_RENDER_FLAG_KERNING) != 0)
|
if((RenderFlags & TEXT_RENDER_FLAG_KERNING) != 0)
|
||||||
CharKerningEllipsis = Kerning(TextContainer.m_pFont, pChr->m_GlyphIndex, pEllipsisChr->m_GlyphIndex) * Scale * Size;
|
CharKerningEllipsis = Kerning(TextContainer.m_pFont, pChr->m_GlyphIndex, pEllipsisChr->m_GlyphIndex) * Scale * Size;
|
||||||
|
|
||||||
if(DrawX + CharKerning + Advance + CharKerningEllipsis + AdvanceEllipsis - pCursor->m_StartX > pCursor->m_LineWidth)
|
const int WidthOfRemainingText = CalculateTextWidth(pTmp, str_length(pTmp), 0, 100);
|
||||||
|
if(DrawX + CharKerning + Advance + WidthOfRemainingText - pCursor->m_StartX > pCursor->m_LineWidth && DrawX + CharKerning + Advance + CharKerningEllipsis + AdvanceEllipsis - pCursor->m_StartX > pCursor->m_LineWidth)
|
||||||
{
|
{
|
||||||
// we hit the end, only render ellipsis and finish
|
// we hit the end, only render ellipsis and finish
|
||||||
pTmp = pEllipsis;
|
pTmp = pEllipsis;
|
||||||
|
|
Loading…
Reference in a new issue