diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index b2bed1122c..b2753ea359 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -1444,6 +1444,7 @@ void Label::enableUnderline() if (!_underlineNode) { _underlineNode = DrawNode::create(); + _underlineNode->setGlobalZOrder(getGlobalZOrder()); addChild(_underlineNode, 100000); _contentDirty = true; } @@ -2435,6 +2436,11 @@ void Label::setGlobalZOrder(float globalZOrder) _shadowNode->setGlobalZOrder(globalZOrder); } } + + if (_underlineNode) + { + _underlineNode->setGlobalZOrder(globalZOrder); + } } float Label::getRenderingFontSize()const