Merge pull request #15003 from WenhaiLin/v3-0202-labelfix

Label:Fixed characters are displayed incorrectly with some specific font.
This commit is contained in:
zilongshanren 2016-02-02 17:56:43 +08:00
commit 7a9e0e7b71
1 changed files with 4 additions and 2 deletions

View File

@ -321,6 +321,7 @@ bool FontAtlas::prepareLetterDefinitions(const std::u16string& utf16Text)
int adjustForExtend = _letterEdgeExtend / 2;
long bitmapWidth;
long bitmapHeight;
int glyphHeight;
Rect tempRect;
FontLetterDefinition tempDef;
@ -340,9 +341,10 @@ bool FontAtlas::prepareLetterDefinitions(const std::u16string& utf16Text)
tempDef.offsetX = tempRect.origin.x + adjustForDistanceMap + adjustForExtend;
tempDef.offsetY = _fontAscender + tempRect.origin.y - adjustForDistanceMap - adjustForExtend;
if (bitmapHeight > _currLineHeight)
glyphHeight = static_cast<int>(bitmapHeight) + _letterPadding + _letterEdgeExtend;
if (glyphHeight > _currLineHeight)
{
_currLineHeight = static_cast<int>(bitmapHeight) + _letterPadding + _letterEdgeExtend + 1;
_currLineHeight = glyphHeight;
}
if (_currentPageOrigX + tempDef.width > CacheTextureWidth)
{