Browse Source

text: fix a minor accuracy issue in the text alignment logic.

undefined
Sam Hocevar 9 years ago
parent
commit
591db6b866
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/text.cpp

+ 1
- 1
src/text.cpp View File

@@ -102,7 +102,7 @@ void Text::TickDraw(float seconds, Scene &scene)
{ {
Font *font = Forge::GetFont(data->m_font); Font *font = Forge::GetFont(data->m_font);
vec3 delta(0.0f); vec3 delta(0.0f);
float text_width = length * font->GetSize().x
float text_width = (length - 0.5f) * font->GetSize().x
+ (length - 1) * data->m_spacing; + (length - 1) * data->m_spacing;


if (data->m_align == TextAlign::Right) if (data->m_align == TextAlign::Right)


Loading…
Cancel
Save