diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-09-11 08:14:27 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-09-11 08:14:27 +0400 |
commit | f81f6c5019bc84c0839210c75a608bcf17e91df7 (patch) | |
tree | c2463c9b462c2435688921a06a5dff04d7cb652b /source/blender/editors/space_info/textview.c | |
parent | a4f12a3e31d7c5b763fc75a984e0e9983c707e03 (diff) |
take the decender into account when drawing console text.
also add data types wm and mask to dataname() and unshadow var in ghost/x11
Diffstat (limited to 'source/blender/editors/space_info/textview.c')
-rw-r--r-- | source/blender/editors/space_info/textview.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/editors/space_info/textview.c b/source/blender/editors/space_info/textview.c index e53cbdd04af..e23f792d0b5 100644 --- a/source/blender/editors/space_info/textview.c +++ b/source/blender/editors/space_info/textview.c @@ -57,6 +57,7 @@ static void console_font_begin(TextViewContext *sc) typedef struct ConsoleDrawContext { int cwidth; int lheight; + int lofs; /* text vertical offset */ int console_width; /* number of characters that fit into the width of the console (fixed width) */ int winx; int ymin, ymax; @@ -192,7 +193,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, int str glColor3ubv(fg); /* last part needs no clipping */ - BLF_position(mono, cdc->xy[0], cdc->xy[1], 0); + BLF_position(mono, cdc->xy[0], cdc->lofs + cdc->xy[1], 0); BLF_draw_mono(mono, s, len, cdc->cwidth); if (cdc->sel[0] != cdc->sel[1]) { @@ -208,7 +209,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, int str len = offsets[i] - offsets[i - 1]; s = str + offsets[i - 1]; - BLF_position(mono, cdc->xy[0], cdc->xy[1], 0); + BLF_position(mono, cdc->xy[0], cdc->lofs + cdc->xy[1], 0); BLF_draw_mono(mono, s, len, cdc->cwidth); if (cdc->sel[0] != cdc->sel[1]) { @@ -239,7 +240,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, int str glColor3ubv(fg); - BLF_position(mono, cdc->xy[0], cdc->xy[1], 0); + BLF_position(mono, cdc->xy[0], cdc->lofs + cdc->xy[1], 0); BLF_draw_mono(mono, str, str_len, cdc->cwidth); if (cdc->sel[0] != cdc->sel[1]) { @@ -291,6 +292,7 @@ int textview_draw(TextViewContext *tvc, const int draw, int mval[2], void **mous cdc.cwidth = (int)BLF_fixed_width(mono); assert(cdc.cwidth > 0); cdc.lheight = tvc->lheight; + cdc.lofs = -BLF_descender(mono); /* note, scroll bar must be already subtracted () */ cdc.console_width = (tvc->winx - (CONSOLE_DRAW_MARGIN * 2) ) / cdc.cwidth; CLAMP(cdc.console_width, 1, INT_MAX); /* avoid divide by zero on small windows */ |