From 69a2da76dc5e96e27b98e43d578f7dde8cfccfbb Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Fri, 19 May 2017 19:22:04 -0300 Subject: [PATCH] Fixed BMFont y coordinates. --HG-- branch : minor --- src/modules/graphics/Font.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/graphics/Font.cpp b/src/modules/graphics/Font.cpp index f38024e6a..e0cbb9e9a 100644 --- a/src/modules/graphics/Font.cpp +++ b/src/modules/graphics/Font.cpp @@ -379,7 +379,11 @@ std::vector Font::generateVertices(const ColoredCodepoints &c float dx = offset.x; float dy = offset.y; - float lineheight = getBaseline(); + float heightoffset = 0.0f; + + if (rasterizers[0]->getDataType() == font::Rasterizer::DATA_TRUETYPE) + heightoffset = getBaseline(); + int maxwidth = 0; // Keeps track of when we need to switch textures in our vertex array. @@ -461,7 +465,7 @@ std::vector Font::generateVertices(const ColoredCodepoints &c { vertices.push_back(glyph.vertices[j]); vertices.back().x += dx; - vertices.back().y += dy + lineheight; + vertices.back().y += dy + heightoffset; vertices.back().color = curcolor; }