Merge pull request #6022 from Dhilan007/develop_label4565

closed #4565:fixed logical error in Label::setFontAtlas.
This commit is contained in:
James Chen 2014-03-27 14:39:30 +08:00
commit c62144c350
1 changed files with 10 additions and 1 deletions

View File

@ -392,7 +392,16 @@ void Label::setFontAtlas(FontAtlas* atlas,bool distanceFieldEnabled /* = false *
}
_fontAtlas = atlas;
SpriteBatchNode::initWithTexture(_fontAtlas->getTexture(0), 30);
if (_textureAtlas)
{
_textureAtlas->setTexture(_fontAtlas->getTexture(0));
}
else
{
SpriteBatchNode::initWithTexture(_fontAtlas->getTexture(0), 30);
}
if (_reusedLetter == nullptr)
{
_reusedLetter = Sprite::createWithTexture(_fontAtlas->getTexture(0));