CCLabelTTF can't determine height automatic

Hi dear.

I want break line on CCLabelTTF and I found a article here.
http://cocos2d-x.org/projects/cocos2d-x/wiki/How_does_CCLabelTTF_support_line_breaks_and_wrapping

but It doesn’t work for me, CCLabelTTF should calculate height of texture automatic if passed CGSize(width,0), but the current result same as CGSize(0,0) was passed, is it a bug or it is a removed feature?

cocos2d-x version:408c3fd date:2012-7-18

ken zhang wrote:

Hi dear.
>
I want break line on CCLabelTTF and I found a article here.
http://cocos2d-x.org/projects/cocos2d-x/wiki/How_does_CCLabelTTF_support_line_breaks_and_wrapping
>
but It doesn’t work for me, CCLabelTTF should calculate height of texture automatic if passed CGSize(width,0), but the current result same as CGSize(0,0) was passed, is it a bug or it is a removed feature?
>
>
cocos2d-x version:408c3fd date:2012-7-18

Fixed:

void CCLabelTTF::updateTexture()
{
    CCTexture2D *tex;
    if (m_tDimensions.width == 0 || m_tDimensions.height == 0)
    {
        tex = new CCTexture2D();
        tex->initWithString(m_string.c_str(), m_pFontName->c_str(), m_fFontSize * CC_CONTENT_SCALE_FACTOR()) ;
    }

replace

 if (m_tDimensions.width == 0 || m_tDimensions.height == 0) 

to

if (m_tDimensions.width == 0 && m_tDimensions.height == 0)