alignText is not correctly?

magistr

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.
(labelSize.y*=0.8)

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);
labelSize.y*=0.8;


Why???

kungfoomasta

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.