mirror of https://github.com/axmolengine/axmol.git
Merge pull request #7004 from Dhilan007/v3-labelfix
close issue#5158:Label's display may go bonkers if using outline feature.
This commit is contained in:
commit
59c7b7e9a0
|
@ -264,8 +264,16 @@ bool FontAtlas::prepareLetterDefinitions(const std::u16string& utf16String)
|
|||
_currentPageOrigY += _commonLineHeight;
|
||||
_currentPageOrigX = 0;
|
||||
if(_currentPageOrigY + _commonLineHeight >= CacheTextureHeight)
|
||||
{
|
||||
auto data = _currentPageData + CacheTextureWidth * (int)startY;
|
||||
{
|
||||
unsigned char *data = nullptr;
|
||||
if(pixelFormat == Texture2D::PixelFormat::AI88)
|
||||
{
|
||||
data = _currentPageData + CacheTextureWidth * (int)startY * 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
data = _currentPageData + CacheTextureWidth * (int)startY;
|
||||
}
|
||||
_atlasTextures[_currentPage]->updateWithData(data, 0, startY,
|
||||
CacheTextureWidth, CacheTextureHeight - startY);
|
||||
|
||||
|
@ -325,7 +333,15 @@ bool FontAtlas::prepareLetterDefinitions(const std::u16string& utf16String)
|
|||
|
||||
if(existNewLetter)
|
||||
{
|
||||
auto data = _currentPageData + CacheTextureWidth * (int)startY;
|
||||
unsigned char *data = nullptr;
|
||||
if(pixelFormat == Texture2D::PixelFormat::AI88)
|
||||
{
|
||||
data = _currentPageData + CacheTextureWidth * (int)startY * 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
data = _currentPageData + CacheTextureWidth * (int)startY;
|
||||
}
|
||||
_atlasTextures[_currentPage]->updateWithData(data, 0, startY,
|
||||
CacheTextureWidth, _currentPageOrigY - startY + _commonLineHeight);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue