From 4e331f1f54d2b9ef5be82de6917a8f28e74baa81 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Fri, 25 Mar 2016 14:37:41 +1300 Subject: [PATCH] Possible workaround for #738 Align text rendering to character, not tile size --- src/graphics/engine/text.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/graphics/engine/text.cpp b/src/graphics/engine/text.cpp index b5b55ec3..c1317f1e 100644 --- a/src/graphics/engine/text.cpp +++ b/src/graphics/engine/text.cpp @@ -940,16 +940,14 @@ void CText::DrawCharAndAdjustPos(UTF8Char ch, FontType font, float size, Math::P CharTexture tex = GetCharTexture(ch, font, size); Math::Point charInterfaceSize = m_engine->WindowToInterfaceSize(tex.charSize); - Math::Point texInterfaceSize = m_engine->WindowToInterfaceSize(tex.tileSize); - Math::Point p1(pos.x, pos.y + charInterfaceSize.y - texInterfaceSize.y); - Math::Point p2(pos.x + texInterfaceSize.x, pos.y + charInterfaceSize.y); + Math::Point p1(pos.x, pos.y); + Math::Point p2(pos.x + charInterfaceSize.x, pos.y + charInterfaceSize.y); Math::Point texCoord1(static_cast(tex.charPos.x) / FONT_TEXTURE_SIZE.x, static_cast(tex.charPos.y) / FONT_TEXTURE_SIZE.y); - Math::Point texCoord2(static_cast(tex.charPos.x + tex.tileSize.x) / FONT_TEXTURE_SIZE.x, - static_cast(tex.charPos.y + tex.tileSize.y) / FONT_TEXTURE_SIZE.y); - + Math::Point texCoord2(static_cast(tex.charPos.x + tex.charSize.x) / FONT_TEXTURE_SIZE.x, + static_cast(tex.charPos.y + tex.charSize.y) / FONT_TEXTURE_SIZE.y); Math::Vector n(0.0f, 0.0f, -1.0f); // normal Vertex quad[4] =