瀏覽代碼

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

undefined
Sam Hocevar 10 年之前
父節點
當前提交
591db6b866
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. +1
    -1
      src/text.cpp

+ 1
- 1
src/text.cpp 查看文件

@@ -102,7 +102,7 @@ void Text::TickDraw(float seconds, Scene &scene)
{
Font *font = Forge::GetFont(data->m_font);
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;

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


Loading…
取消
儲存