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>2007-08-20 05:02:12 +0400
committerMatt Ebb <matt@mke3.net>2007-08-20 05:02:12 +0400
commit21c567854a35588aef445495d17706ff6c7d2245 (patch)
tree14bbfe1afaac5d2eb8660e7b0c46c2dec61ba548 /source/blender/src/language.c
parent4ef547a79d0bf4282c72b61b87e46dd148640f13 (diff)
Patch #6770 by James C (sheep)
Tooltip getStringSize and getBoundingBox correction Not really any user-visible changes here, but a nice clean-up of internal font drawing functions, in this case used in tooltips. Thanks!
Diffstat (limited to 'source/blender/src/language.c')
-rw-r--r--source/blender/src/language.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/src/language.c b/source/blender/src/language.c
index bdf0dfa3baf..7864468287e 100644
--- a/source/blender/src/language.c
+++ b/source/blender/src/language.c
@@ -33,6 +33,7 @@
#include "DNA_listBase.h"
#include "DNA_userdef_types.h"
+#include "DNA_vec_types.h"
#include "BKE_global.h" /* G */
#include "BKE_utildefines.h"
@@ -169,6 +170,21 @@ float BIF_GetStringWidth(BMF_Font* font, char *str, int translate)
return rt;
}
+void BIF_GetBoundingBox(struct BMF_Font* font, char* str, int translate, rctf *bbox){
+ float dummy;
+#ifdef INTERNATIONAL
+ if(G.ui_international == TRUE)
+ if(translate && (U.transopts & USER_TR_BUTTONS))
+ FTF_GetBoundingBox(str, &bbox->xmin, &bbox->ymin, &dummy, &bbox->xmax, &bbox->ymax, &dummy, FTF_USE_GETTEXT | FTF_INPUT_UTF8);
+ else
+ FTF_GetBoundingBox(str, &bbox->xmin, &bbox->ymin, &dummy, &bbox->xmax, &bbox->ymax, &dummy, FTF_NO_TRANSCONV | FTF_INPUT_UTF8);
+ else
+ BMF_GetStringBoundingBox(font, str, &bbox->xmin, &bbox->ymin, &bbox->xmax, &bbox->ymax);
+#else
+ BMF_GetStringBoundingBox(font, str, &bbox->xmin, &bbox->ymin, &bbox->xmax, &bbox->ymax);
+#endif
+}
+
#ifdef INTERNATIONAL