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,7 +788,9 @@ void Label::enableShadow(const Color4B& shadowColor /* = Color4B::BLACK */,const
//TODO: support blur for shadow
_shadowBlurRadius = 0;
if (_textSprite && _shadowNode)
if (!_systemFontDirty && !_contentDirty && _textSprite)
{
if (_shadowNode)
{
if (shadowColor != _shadowColor4F)
{
@ -801,6 +803,11 @@ void Label::enableShadow(const Color4B& shadowColor /* = Color4B::BLACK */,const
_shadowNode->setPosition(_shadowOffset.width, _shadowOffset.height);
}
}
else
{
createShadowSpriteForSystemFont();
}
}
_shadowColor3B.r = shadowColor.r;
_shadowColor3B.g = shadowColor.g;