From e9960f53730f84c299147cb996fb656da48dfa66 Mon Sep 17 00:00:00 2001 From: andreymal Date: Sun, 2 Mar 2014 04:15:59 +0400 Subject: GetStringWidth fix --- src/graphics/engine/text.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/graphics') 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; -- cgit v1.2.3-1-g7c22