- fixed font verticle centering for ftgl

This commit is contained in:
Mark Vejvoda
2011-11-23 20:51:58 +00:00
parent 115ef63f57
commit 53ad9d77c2

View File

@@ -1953,22 +1953,22 @@ Vec2f Renderer::getCentered3DPos(const string &text, Font3D *font, Vec2f &pos, i
if(lineHeight < h) {
//printf("line %d, lineHeight [%f] h [%d] text [%s]\n",__LINE__,lineHeight,h,text.c_str());
if(Font::forceFTGLFonts == true) {
//if(Font::forceFTGLFonts == true) {
// First go to top of bounding box
pos.y += (h - lineHeight);
pos.y -= ((h - lineHeight) / Font::scaleFontValueCenterHFactor);
}
else {
pos.y += (float)(((float)h) / 2.0);
float heightGap = (float)(((float)h - lineHeight) / 2.0);
pos.y -= heightGap;
//printf("h = %d lineHeight = %f heightGap = %f\n",h,lineHeight,heightGap);
// Now calculate till we get text to middle
//pos.y -= (realHeight / 2);
//pos.y += (lineHeight / 2);
}
// }
// else {
// pos.y += (float)(((float)h) / 2.0);
// float heightGap = (float)(((float)h - lineHeight) / 2.0);
// pos.y -= heightGap;
//
// //printf("h = %d lineHeight = %f heightGap = %f\n",h,lineHeight,heightGap);
//
// // Now calculate till we get text to middle
// //pos.y -= (realHeight / 2);
// //pos.y += (lineHeight / 2);
// }
}
else if(lineHeight > h) {
//printf("line %d, lineHeight [%f] h [%d] text [%s]\n",__LINE__,lineHeight,h,text.c_str());