[drape] Safe input text check.

Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
This commit is contained in:
Viktor Govako 2023-05-20 21:21:15 -03:00
parent ad4bf7e3a0
commit 8dfb17f9dd

View file

@ -348,6 +348,10 @@ StraightTextLayout::StraightTextLayout(strings::UniString const & text, float fo
bool forceNoWrap)
{
strings::UniString visibleText = bidi::log2vis(text);
// Possible if name has strange symbols only.
if (visibleText.empty())
return;
buffer_vector<size_t, 2> delimIndexes;
if (visibleText == text && !forceNoWrap)
SplitText(visibleText, delimIndexes);