Merge pull request #9258 from Robyt3/Textrender-Newline-Loop-Fix

Fix client hanging when rendering text with small maximum width
This commit is contained in:
Dennis Felsing 2024-11-16 21:00:42 +00:00 committed by GitHub
commit 9c02194f09
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;