From 1b994a37f474b0509e1c2ce4ab18dbdbfa9e7b92 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 22 May 2020 12:36:39 +1000 Subject: Fix Python console cursor height --- source/blender/editors/space_console/console_draw.c | 8 ++------ source/blender/editors/space_info/textview.c | 2 +- source/blender/editors/space_info/textview.h | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/source/blender/editors/space_console/console_draw.c b/source/blender/editors/space_console/console_draw.c index 6b741363d42..805e9608fec 100644 --- a/source/blender/editors/space_console/console_draw.c +++ b/source/blender/editors/space_console/console_draw.c @@ -142,10 +142,7 @@ static void console_cursor_wrap_offset( return; } -static void console_textview_draw_cursor(TextViewContext *tvc, - int cwidth, - int columns, - int descender) +static void console_textview_draw_cursor(TextViewContext *tvc, int cwidth, int columns) { int pen[2]; { @@ -171,8 +168,7 @@ static void console_textview_draw_cursor(TextViewContext *tvc, immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_CONSOLE_CURSOR); - immRectf( - pos, pen[0] - U.pixelsize, pen[1], pen[0] + U.pixelsize, pen[1] + tvc->lheight + descender); + immRectf(pos, pen[0] - U.pixelsize, pen[1], pen[0] + U.pixelsize, pen[1] + tvc->lheight); immUnbindProgram(); } diff --git a/source/blender/editors/space_info/textview.c b/source/blender/editors/space_info/textview.c index 5d5c41597b4..8076d3d7eaf 100644 --- a/source/blender/editors/space_info/textview.c +++ b/source/blender/editors/space_info/textview.c @@ -408,7 +408,7 @@ int textview_draw(TextViewContext *tvc, if (do_draw) { /* We always want the cursor to draw. */ if (tvc->draw_cursor && iter_index == 0) { - tvc->draw_cursor(tvc, tds.cwidth, tds.columns, tds.lofs); + tvc->draw_cursor(tvc, tds.cwidth, tds.columns); } /* When drawing, if we pass v2d->cur.ymax, then quit. */ diff --git a/source/blender/editors/space_info/textview.h b/source/blender/editors/space_info/textview.h index 8eef4ef5d56..41f8baf634e 100644 --- a/source/blender/editors/space_info/textview.h +++ b/source/blender/editors/space_info/textview.h @@ -60,7 +60,7 @@ typedef struct TextViewContext { int *r_icon, uchar r_icon_fg[4], uchar r_icon_bg[4]); - void (*draw_cursor)(struct TextViewContext *tvc, int cwidth, int columns, int descender); + void (*draw_cursor)(struct TextViewContext *tvc, int cwidth, int columns); /* constant theme colors */ void (*const_colors)(struct TextViewContext *tvc, unsigned char bg_sel[4]); const void *iter; -- cgit v1.2.3