Label:ignore '\r' character.

This commit is contained in:
WenhaiLin 2015-08-14 11:07:34 +08:00
parent c4af7b8c45
commit d25decb414
1 changed files with 10 additions and 0 deletions

View File

@ -133,6 +133,11 @@ bool Label::multilineTextWrapByWord()
{
int letterIndex = index + tmp;
character = _utf16Text[letterIndex];
if (character == '\r')
{
recordPlaceholderInfo(letterIndex, character);
continue;
}
if (_fontAtlas->getLetterDefinitionForChar(character, letterDef) == false)
{
recordPlaceholderInfo(letterIndex, character);
@ -226,6 +231,11 @@ bool Label::multilineTextWrapByChar()
for (int index = 0; index < textLen; index++)
{
auto character = _utf16Text[index];
if (character == '\r')
{
recordPlaceholderInfo(index, character);
continue;
}
if (character == '\n')
{
_linesWidth.push_back(letterRight);