cocos2d-x 3.0 Label having wrong position

It seems that the new Label class positions itself incorrectly.

I have this code:

Scale9Sprite * box = Scale9Sprite::create( "boxSprite.png" );
box -> setPreferredSize( Size( 300, 100 ) );
box -> setPosition( Point( 160, 240 );
this -> addChild( box );

float labelWidth = box -> getContentSize().width * 0.80f;
Label * text = Label::createWithTTF( "16_chars_long_ff", "ArialRounded.ttf", 28 );
text  -> setAlignment( TextHAlignment::LEFT );
text -> setColor( Color3B::BLACK );
text -> setAnchorPoint( Point::ANCHOR_BOTTOM_LEFT );
text -> setWidth( labelWidth );
text -> setPosition( Point::ZERO );
box -> addChild( text );

Color4B boundingBoxColor = Color4B::create( 255, 0, 0, 180 );
Size boundingBoxSize = text -> getContentSize();
LayerColor * boundingBox = LayerColor::create( boundingBoxColor, boundingBoxSize.width, boundingBoxSize.height );
boundingBox -> setPosition( text -> getPosition() );
box -> addChild( boundingBox );

The above code is supposed to position the label in the bottom-left corner of the sprite, as well as a semi-transparent red box in the same position. However, the label is positioned above the intended point, as if there was an empty line below the first line. But if you take the label’s size (as shown by the boundingBox object), it shows the proper content size.

This is what it looks like when ran:

Is this a bug? Or was it intended?

@lance_gray I think the issue have been fixed.What’s the version of cocos2d-x you’re using?Please use getBoundingBox for get the BBOX of label.
auto textboundingBox = label2->getBoundingBox(); LayerColor * boundingBox = LayerColor::create( Color4B( 255, 0, 0, 180 ), textboundingBox.size.width, textboundingBox.size.height); boundingBox->setPosition( textboundingBox.origin.x,textboundingBox.origin.y); addChild( boundingBox );

I’m using cocos2d-x 3.0 beta1 (the first beta that came out).
I’ll try this out and see what happens.

EDIT:
It’s the same result.
Is this the fix in 3.0 beta2 you mentioned?

[FIX] Label: Missing line breaks and wrong alignment.