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:
authorCampbell Barton <ideasman42@gmail.com>2012-06-20 23:23:12 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-06-20 23:23:12 +0400
commitcf129d8cb5e5f03e613af8ad9174a004d7d34b01 (patch)
tree8be889ea4b26ccd726c05e5871fdf043e86ae7b0 /source/blender/editors/interface/view2d.c
parent850d73414716351421245102f4d2255691987b8a (diff)
avoid calls to BLF_height_default in a loop calling with the same value, also quiet warning.
Diffstat (limited to 'source/blender/editors/interface/view2d.c')
-rw-r--r--source/blender/editors/interface/view2d.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index b2227405d8b..51e1b30f0bf 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -2078,18 +2078,21 @@ void UI_view2d_text_cache_draw(ARegion *ar)
{
View2DString *v2s;
int col_pack_prev = 0;
+
+ /* investigate using BLF_ascender() */
+ const float default_height = strings.first ? BLF_height_default("28") : 0.0f;
// glMatrixMode(GL_PROJECTION);
// glPushMatrix();
// glMatrixMode(GL_MODELVIEW);
// glPushMatrix();
ED_region_pixelspace(ar);
-
+
for (v2s = strings.first; v2s; v2s = v2s->next) {
const char *str = (const char *)(v2s + 1);
int xofs = 0, yofs;
- yofs = ceil(0.5f * (v2s->rect.ymax - v2s->rect.ymin - BLF_height_default("28")));
+ yofs = ceil(0.5f * (v2s->rect.ymax - v2s->rect.ymin - default_height));
if (yofs < 1) yofs = 1;
if (col_pack_prev != v2s->col.pack) {