mirror of https://github.com/axmolengine/axmol.git
fixed opacity of label
This commit is contained in:
parent
442f767c89
commit
462e38cbc6
|
@ -1248,13 +1248,11 @@ bool Label::isOpacityModifyRGB() const
|
|||
|
||||
void Label::setOpacityModifyRGB(bool isOpacityModifyRGB)
|
||||
{
|
||||
_isOpacityModifyRGB = isOpacityModifyRGB;
|
||||
|
||||
for(const auto& child: _children) {
|
||||
child->setOpacityModifyRGB(_isOpacityModifyRGB);
|
||||
if (isOpacityModifyRGB != _isOpacityModifyRGB)
|
||||
{
|
||||
_isOpacityModifyRGB = isOpacityModifyRGB;
|
||||
updateColor();
|
||||
}
|
||||
|
||||
_reusedLetter->setOpacityModifyRGB(true);
|
||||
}
|
||||
|
||||
void Label::updateDisplayedColor(const Color3B& parentColor)
|
||||
|
|
|
@ -577,7 +577,15 @@ void SpriteBatchNode::removeSpriteFromAtlas(Sprite *sprite)
|
|||
void SpriteBatchNode::updateBlendFunc(void)
|
||||
{
|
||||
if (! _textureAtlas->getTexture()->hasPremultipliedAlpha())
|
||||
{
|
||||
_blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED;
|
||||
setOpacityModifyRGB(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
_blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;
|
||||
setOpacityModifyRGB(true);
|
||||
}
|
||||
}
|
||||
|
||||
// CocosNodeTexture protocol
|
||||
|
|
Loading…
Reference in New Issue