diff options
author | andreymal <andriyano-31@mail.ru> | 2014-03-02 04:15:59 +0400 |
---|---|---|
committer | andreymal <andriyano-31@mail.ru> | 2014-03-02 04:15:59 +0400 |
commit | e9960f53730f84c299147cb996fb656da48dfa66 (patch) | |
tree | 7a94c266f6aa6e74a971de1aacc2bfb4bade357f | |
parent | 14709427c46897a37991a35beecb351428265a7f (diff) | |
download | colobot-e9960f53730f84c299147cb996fb656da48dfa66.tar.gz colobot-e9960f53730f84c299147cb996fb656da48dfa66.tar.bz2 colobot-e9960f53730f84c299147cb996fb656da48dfa66.zip |
GetStringWidth fix
-rw-r--r-- | src/graphics/engine/text.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/graphics/engine/text.cpp b/src/graphics/engine/text.cpp index ffd2eb2..581ff01 100644 --- a/src/graphics/engine/text.cpp +++ b/src/graphics/engine/text.cpp @@ -333,7 +333,7 @@ float CText::GetStringWidth(std::string text, FontType font, float size) // Skip special chars for (char& c : text) { - if (c < 32) + if (c < 32 && c >= 0) c = ':'; } @@ -351,7 +351,7 @@ float CText::GetCharWidth(UTF8Char ch, FontType font, float size, float offset) if (font == FONT_BUTTON) return 0.0f; int width = 1; - if (ch.c1 < 32) + if (ch.c1 < 32 && ch.c1 >= 0) { if (ch.c1 == '\t') width = m_tabSize; |