Fix newline not handled to to interpreting it as invisible char

This commit is contained in:
sapier 2014-06-19 23:02:09 +02:00
parent 1c7cc2665b
commit 3a9cf21664

@ -568,8 +568,6 @@ void CGUITTFont::draw(const core::stringw& text, const core::rect<s32>& position
uchar32_t currentChar = *iter; uchar32_t currentChar = *iter;
n = getGlyphIndexByChar(currentChar); n = getGlyphIndexByChar(currentChar);
bool visible = (Invisible.findFirst(currentChar) == -1); bool visible = (Invisible.findFirst(currentChar) == -1);
if (n > 0 && visible)
{
bool lineBreak=false; bool lineBreak=false;
if (currentChar == L'\r') // Mac or Windows breaks if (currentChar == L'\r') // Mac or Windows breaks
{ {
@ -594,6 +592,8 @@ void CGUITTFont::draw(const core::stringw& text, const core::rect<s32>& position
continue; continue;
} }
if (n > 0 && visible)
{
// Calculate the glyph offset. // Calculate the glyph offset.
s32 offx = Glyphs[n-1].offset.X; s32 offx = Glyphs[n-1].offset.X;
s32 offy = (font_metrics.ascender / 64) - Glyphs[n-1].offset.Y; s32 offy = (font_metrics.ascender / 64) - Glyphs[n-1].offset.Y;