diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-05-20 11:05:09 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-05-20 11:16:52 +0300 |
commit | db6e267bfc73767446515be3f802065abbf633e8 (patch) | |
tree | 81c2fe4f7692b970c7298b9e481efe647cd030eb /source/blender/editors/space_console | |
parent | 5fe7605f3df5a2a0c6a77cfe082ce15f6ebc25f8 (diff) |
Fix T74298: Incorrect cursor position in Python console
Diffstat (limited to 'source/blender/editors/space_console')
-rw-r--r-- | source/blender/editors/space_console/console_draw.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/editors/space_console/console_draw.c b/source/blender/editors/space_console/console_draw.c index 6c56e8dfb79..6b741363d42 100644 --- a/source/blender/editors/space_console/console_draw.c +++ b/source/blender/editors/space_console/console_draw.c @@ -91,7 +91,6 @@ void console_scrollback_prompt_end(SpaceConsole *sc, ConsoleLine *cl_dummy) static int console_textview_begin(TextViewContext *tvc) { SpaceConsole *sc = (SpaceConsole *)tvc->arg1; - tvc->lheight = sc->lheight * UI_DPI_FAC; tvc->sel_start = sc->sel_start; tvc->sel_end = sc->sel_end; @@ -157,10 +156,10 @@ static void console_textview_draw_cursor(TextViewContext *tvc, console_cursor_wrap_offset(sc->prompt, columns, &offl, &offc, NULL); console_cursor_wrap_offset(cl->line, columns, &offl, &offc, cl->line + cl->cursor); pen[0] = cwidth * offc; - pen[1] = -2 - (tvc->lheight + descender) * offl; + pen[1] = -tvc->lheight * offl; console_cursor_wrap_offset(cl->line + cl->cursor, columns, &offl, &offc, NULL); - pen[1] += (tvc->lheight + descender) * offl; + pen[1] += tvc->lheight * offl; pen[0] += tvc->draw_rect.xmin; pen[1] += tvc->draw_rect.ymin; @@ -229,7 +228,7 @@ static int console_textview_main__internal(SpaceConsole *sc, /* view */ tvc.sel_start = sc->sel_start; tvc.sel_end = sc->sel_end; - tvc.lheight = sc->lheight * 1.2f * UI_DPI_FAC; + tvc.lheight = sc->lheight * UI_DPI_FAC; tvc.scroll_ymin = v2d->cur.ymin; tvc.scroll_ymax = v2d->cur.ymax; |