Label:Fixed the shadow effect of system font might not be shown.

This commit is contained in:
WenhaiLin 2015-04-17 15:26:43 +08:00
parent 0ac99002d5
commit 5a438ed9a1
1 changed files with 13 additions and 6 deletions

View File

@ -788,17 +788,24 @@ void Label::enableShadow(const Color4B& shadowColor /* = Color4B::BLACK */,const
//TODO: support blur for shadow
_shadowBlurRadius = 0;
if (_textSprite && _shadowNode)
if (!_systemFontDirty && !_contentDirty && _textSprite)
{
if (shadowColor != _shadowColor4F)
if (_shadowNode)
{
Node::removeChild(_shadowNode, true);
_shadowNode = nullptr;
createShadowSpriteForSystemFont();
if (shadowColor != _shadowColor4F)
{
Node::removeChild(_shadowNode, true);
_shadowNode = nullptr;
createShadowSpriteForSystemFont();
}
else
{
_shadowNode->setPosition(_shadowOffset.width, _shadowOffset.height);
}
}
else
{
_shadowNode->setPosition(_shadowOffset.width, _shadowOffset.height);
createShadowSpriteForSystemFont();
}
}