closed #4565:fixed logical error in Label::setFontAtlas.

This commit is contained in:
Dhilan007 2014-03-27 14:28:32 +08:00
parent b1859a4cac
commit 8a8fa743eb
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));