From d972e4ed69c0447cab1afb5b7ebdc5d2a7a16de4 Mon Sep 17 00:00:00 2001 From: oy Date: Wed, 18 Aug 2010 00:21:38 +0200 Subject: [PATCH] fixed text rendering problem. Closes #12 --- src/engine/client/text.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/engine/client/text.cpp b/src/engine/client/text.cpp index ef741c129..bdf71dbb4 100644 --- a/src/engine/client/text.cpp +++ b/src/engine/client/text.cpp @@ -570,6 +570,8 @@ public: pSizeData = GetSize(pFont, ActualSize); RenderSetup(pFont, ActualSize); + + float Scale = 1/pSizeData->m_FontSize; // set length if(Length < 0) @@ -679,7 +681,7 @@ public: Graphics()->QuadsDrawTL(&QuadItem, 1); } - Advance = pChr->m_AdvanceX + Kerning(pFont, Character, Nextcharacter)/Size; + Advance = pChr->m_AdvanceX + Kerning(pFont, Character, Nextcharacter)*Scale; } if(pCursor->m_Flags&TEXTFLAG_STOP_AT_END && DrawX+(Advance+pChr->m_Width)*Size-pCursor->m_StartX > pCursor->m_LineWidth)