mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-17 13:38:18 +00:00
Fix client hanging when rendering text with small maximum width
Previously, when rendering text with a maximum width that is too small for a single glyph then the text rendering would loop indefinitely trying to advance the cursor to the next line where the glyph will also not fit.
This commit is contained in:
parent
aa408ef8c8
commit
c3bcf57f99
|
@ -1560,6 +1560,7 @@ public:
|
|||
|
||||
const char *pCurrent = pText;
|
||||
const char *pEnd = pCurrent + Length;
|
||||
const char *pPrevBatchEnd = nullptr;
|
||||
const char *pEllipsis = "…";
|
||||
const SGlyph *pEllipsisGlyph = nullptr;
|
||||
if(pCursor->m_Flags & TEXTFLAG_ELLIPSIS_AT_END)
|
||||
|
@ -1966,6 +1967,9 @@ public:
|
|||
|
||||
if(NewLine)
|
||||
{
|
||||
if(pPrevBatchEnd == pBatchEnd)
|
||||
break;
|
||||
pPrevBatchEnd = pBatchEnd;
|
||||
if(!StartNewLine())
|
||||
break;
|
||||
GotNewLineLast = true;
|
||||
|
|
Loading…
Reference in a new issue