Initialize glyph layouts if text exists to fix #4557

This commit is contained in:
Benau 2021-08-06 12:49:38 +08:00
parent bc43eee98c
commit b89dd89dad

View File

@ -202,6 +202,8 @@ CGUIEditBox::CGUIEditBox(const wchar_t* text, bool border,
Text = text;
m_edit_text = StringUtils::wideToUtf32(text);
if (!m_edit_text.empty())
updateGlyphLayouts();
#ifndef SERVER_ONLY
if (Environment)
@ -312,6 +314,8 @@ void CGUIEditBox::setPasswordBox(bool passwordBox, wchar_t passwordChar)
PasswordBox = passwordBox;
if (PasswordBox)
PasswordChar = (char32_t)passwordChar;
if (!m_edit_text.empty())
updateGlyphLayouts();
}