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:
minggo 2014-06-09 14:17:46 +08:00
commit 59c7b7e9a0
1 changed files with 19 additions and 3 deletions

View File

@ -265,7 +265,15 @@ bool FontAtlas::prepareLetterDefinitions(const std::u16string& utf16String)
_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);
}