mirror of https://github.com/axmolengine/axmol.git
Merge pull request #15003 from WenhaiLin/v3-0202-labelfix
Label:Fixed characters are displayed incorrectly with some specific font.
This commit is contained in:
commit
7a9e0e7b71
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue