summaryrefslogtreecommitdiffstats
path: root/src/graphics
diff options
context:
space:
mode:
authorandreymal <andriyano-31@mail.ru>2014-03-02 04:15:59 +0400
committerandreymal <andriyano-31@mail.ru>2014-03-02 04:15:59 +0400
commite9960f53730f84c299147cb996fb656da48dfa66 (patch)
tree7a94c266f6aa6e74a971de1aacc2bfb4bade357f /src/graphics
parent14709427c46897a37991a35beecb351428265a7f (diff)
downloadcolobot-e9960f53730f84c299147cb996fb656da48dfa66.tar.gz
colobot-e9960f53730f84c299147cb996fb656da48dfa66.tar.bz2
colobot-e9960f53730f84c299147cb996fb656da48dfa66.zip
GetStringWidth fix
Diffstat (limited to 'src/graphics')
-rw-r--r--src/graphics/engine/text.cpp4
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;