mirror of
https://github.com/glest/glest-source.git
synced 2025-08-13 11:54:00 +02:00
- fixed font verticle centering for ftgl
This commit is contained in:
@@ -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());
|
||||
|
Reference in New Issue
Block a user