diff --git a/cocos/2d/CCLabelTTF.cpp b/cocos/2d/CCLabelTTF.cpp index e59caa4285..c7e85ebd38 100644 --- a/cocos/2d/CCLabelTTF.cpp +++ b/cocos/2d/CCLabelTTF.cpp @@ -280,9 +280,8 @@ const Size& LabelTTF::getContentSize() const Rect LabelTTF::getBoundingBox() const { - Size size = getContentSize(); - Rect rect = Node::getBoundingBox(); - return rect; + const_cast(this)->setContentSize(_renderLabel->getContentSize()); + return Node::getBoundingBox(); } #if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))