Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Ebb <matt@mke3.net>2006-07-31 14:49:35 +0400
committerMatt Ebb <matt@mke3.net>2006-07-31 14:49:35 +0400
commit7bd41a99e0b9122eef590072703d0ea8d7673103 (patch)
treeb8422ff689c3556408f565fa888db513154a17d9 /source/blender/ftfont
parent876885df4523ac0787743cc31161b0d87a6893b2 (diff)
BIF_GetStringWidth() returned garbage when given a 0 length string, which was causing
Diffstat (limited to 'source/blender/ftfont')
-rw-r--r--source/blender/ftfont/intern/FTF_TTFont.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/ftfont/intern/FTF_TTFont.cpp b/source/blender/ftfont/intern/FTF_TTFont.cpp
index 78245709e2d..a4d81fe0133 100644
--- a/source/blender/ftfont/intern/FTF_TTFont.cpp
+++ b/source/blender/ftfont/intern/FTF_TTFont.cpp
@@ -385,6 +385,8 @@ float FTF_TTFont::GetStringWidth(char* str, unsigned int flag)
wchar_t wstr[FTF_MAX_STR_SIZE-1]={'\0'};
int len=0;
+ if (strlen(str)==0) return 0.0;
+
/* note; this utf8towchar() function I totally don't understand... without using translations it
removes special characters completely. So, for now we just skip that then. (ton) */