Merge pull request #8919 from ahlwong/v3

Fix Label Kerning on Single Characters Cocos2d-X3.3Beta0
This commit is contained in:
minggo 2014-10-27 11:48:50 +08:00
commit 23f922420a
1 changed files with 5 additions and 2 deletions

View File

@ -387,13 +387,16 @@ bool LabelTextFormatter::createStringSprites(Label *theLabel)
log("WARNING: can't find letter definition in font file for letter: %c", c);
continue;
}
nextFontPositionX += charAdvance + kernings[i] + theLabel->_additionalKerning;
nextFontPositionX += charAdvance + kernings[i];
if (longestLine < nextFontPositionX)
{
longestLine = nextFontPositionX;
}
// check longest line before adding additional kerning
nextFontPositionX += theLabel->_additionalKerning;
}
float lastCharWidth = tempDefinition.width * contentScaleFactor;