fix for own bug for font buffer drawing (only effected the bottom line of the stamp)
authorCampbell Barton <ideasman42@gmail.com>
Tue, 14 Sep 2010 12:35:02 +0000 (12:35 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 14 Sep 2010 12:35:02 +0000 (12:35 +0000)
source/blender/blenfont/intern/blf_font.c

index 4c7e641058509f50bb1531a546790d48b33a855c..04f40ac825b7d23adf08992cc0ed42c1447920f8 100644 (file)
@@ -200,9 +200,14 @@ void blf_font_buffer(FontBLF *font, char *str)
                }
 
                chx= pen_x + ((int)g->pos_x);
+               chy= (int)font->pos[1] + g->height;
 
-               pen_y= (int)font->pos[1] - (g->height - ((int)g->pos_y));
-               chy= pen_y - ((int)g->pos_y);
+               if (g->pitch < 0) {
+                       pen_y = (int)font->pos[1] + (g->height - (int)g->pos_y);
+               }
+               else {
+                       pen_y = (int)font->pos[1] - (g->height - (int)g->pos_y);
+               }
 
                if ((chx + g->width) >= 0 && chx < font->bw && (pen_y + g->height) >= 0 && pen_y < font->bh) {
                        /* dont draw beyond the buffer bounds */