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>2010-09-10 08:04:48 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-09-10 08:04:48 +0400
commitcf4e32a06c84bdc3e735e4fccb693a400a8e4cbe (patch)
tree69d91cf3b33f89e6a8877235e8605b6986c73fb7 /source/blender/blenfont
parent5bf97d7786424a06f912bf90822fd7ec4ebda6ba (diff)
remove redundant buffer character positioning code & remove attr keyword argument from property definitions.
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r--source/blender/blenfont/intern/blf_font.c28
1 files changed, 3 insertions, 25 deletions
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c
index f5de632db47..4c7e6410585 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -155,7 +155,7 @@ void blf_font_buffer(FontBLF *font, char *str)
FT_Vector delta;
FT_UInt glyph_index;
float a, *fbuf;
- int pen_x, y, x, yb, diff;
+ int pen_x, y, x, yb;
int i, has_kerning, st, chx, chy;
if (!font->glyph_cache || (!font->b_fbuf && !font->b_cbuf))
@@ -186,8 +186,6 @@ void blf_font_buffer(FontBLF *font, char *str)
if (!g)
continue;
- pen_y= (int)font->pos[1];
-
if (has_kerning && g_prev) {
delta.x= 0;
delta.y= 0;
@@ -202,16 +200,9 @@ void blf_font_buffer(FontBLF *font, char *str)
}
chx= pen_x + ((int)g->pos_x);
- diff= g->height - ((int)g->pos_y);
- if (g->pitch < 0) {
- pen_y += diff;
- chy= pen_y - ((int)g->pos_y);
- }
- else {
- pen_y -= diff;
- chy= pen_y + ((int)g->pos_y);
- }
+ pen_y= (int)font->pos[1] - (g->height - ((int)g->pos_y));
+ chy= pen_y - ((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 */
@@ -279,19 +270,6 @@ void blf_font_buffer(FontBLF *font, char *str)
}
}
- if (diff > 0) {
- if (g->pitch < 0)
- pen_x -= diff;
- else
- pen_y += diff;
- }
- else if (diff < 0) {
- if (g->pitch < 0)
- pen_x += diff;
- else
- pen_y -= diff;
- }
-
pen_x += g->advance;
g_prev= g;
}