alignText is not correctly?


15-07-2007 13:46:16

I am create very simple label background: rectangle with 1px border
After, I am try to align text:
Vertical: buttom
Horizontal: right

But text does not aligned by buttom line.

All problem in text Height.
I am experiment with labelSize and to come to conclusion:
if incrase labelsize by Y, it works correctly.

void Label::alignText(HorizontalAlignment ha, VerticalAlignment va)
mHorizontalAlignment = ha;
mVerticalAlignment = va;

Ogre::Vector2 relativeLabelPos = mTextWidget->getPosition();
Ogre::Vector2 labelPos = mTextWidget->getPosition(QGUI_GMM_ABSOLUTE);
Ogre::Vector2 labelSize = mTextWidget->getSize(QGUI_GMM_ABSOLUTE);



15-07-2007 23:06:48

Obviously, if you make the label height bigger, the vertical positioning will be affected. . .

Last I checked vertical positioning is working correctly. What is the word you are trying to align? Keep in mind that it will look different if none of the words have letters that have have hanging parts, such as: p,g,q,j,y,etc.