From 53ad9d77c23f8f0410a93ebc9da065344d5307b8 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Wed, 23 Nov 2011 20:51:58 +0000 Subject: [PATCH] - fixed font verticle centering for ftgl --- source/glest_game/graphics/renderer.cpp | 26 ++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/source/glest_game/graphics/renderer.cpp b/source/glest_game/graphics/renderer.cpp index ff2e5ca15..21b6dc295 100644 --- a/source/glest_game/graphics/renderer.cpp +++ b/source/glest_game/graphics/renderer.cpp @@ -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());