Browse Source

Fixed BMFont y coordinates.

--HG--
branch : minor
Alex Szpakowski 8 years ago
parent
commit
69a2da76dc
1 changed files with 6 additions and 2 deletions
  1. 6 2
      src/modules/graphics/Font.cpp

+ 6 - 2
src/modules/graphics/Font.cpp

@@ -379,7 +379,11 @@ std::vector<Font::DrawCommand> Font::generateVertices(const ColoredCodepoints &c
 	float dx = offset.x;
 	float dx = offset.x;
 	float dy = offset.y;
 	float dy = offset.y;
 
 
-	float lineheight = getBaseline();
+	float heightoffset = 0.0f;
+
+	if (rasterizers[0]->getDataType() == font::Rasterizer::DATA_TRUETYPE)
+		heightoffset = getBaseline();
+
 	int maxwidth = 0;
 	int maxwidth = 0;
 
 
 	// Keeps track of when we need to switch textures in our vertex array.
 	// Keeps track of when we need to switch textures in our vertex array.
@@ -461,7 +465,7 @@ std::vector<Font::DrawCommand> Font::generateVertices(const ColoredCodepoints &c
 			{
 			{
 				vertices.push_back(glyph.vertices[j]);
 				vertices.push_back(glyph.vertices[j]);
 				vertices.back().x += dx;
 				vertices.back().x += dx;
-				vertices.back().y += dy + lineheight;
+				vertices.back().y += dy + heightoffset;
 				vertices.back().color = curcolor;
 				vertices.back().color = curcolor;
 			}
 			}