Fixed: Changing font name for already rendered text leading to crash.

--HG--
branch : develop
This commit is contained in:
Nimetu 2019-04-10 00:31:37 +03:00
parent 35f5c1b77f
commit ac4fd3f8b2

View file

@ -1440,12 +1440,11 @@ namespace NLGUI
if (_FontName == name)
return;
if (_FontName.length() > 0)
{
if (_Index != 0xFFFFFFFF)
CViewRenderer::getTextContext(_FontName)->erase (_Index);
clearLines();
}
if (_Index != 0xFFFFFFFF)
CViewRenderer::getTextContext(_FontName)->erase (_Index);
clearLines();
resetTextIndex();
_FontName = name;
computeFontSize ();