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_info/textview.c | |
parent | 5fe7605f3df5a2a0c6a77cfe082ce15f6ebc25f8 (diff) |
Fix T74298: Incorrect cursor position in Python console
Diffstat (limited to 'source/blender/editors/space_info/textview.c')
-rw-r--r-- | source/blender/editors/space_info/textview.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/source/blender/editors/space_info/textview.c b/source/blender/editors/space_info/textview.c index c842fa8b4ac..3c0ef4a6386 100644 --- a/source/blender/editors/space_info/textview.c +++ b/source/blender/editors/space_info/textview.c @@ -394,26 +394,27 @@ int textview_draw(TextViewContext *tvc, tvc->line_get(tvc, &ext_line, &ext_len); - if (!textview_draw_string(&tds, - ext_line, - ext_len, - (data_flag & TVC_LINE_FG) ? fg : NULL, - (data_flag & TVC_LINE_BG) ? bg : NULL, - (data_flag & TVC_LINE_ICON) ? icon : 0, - (data_flag & TVC_LINE_ICON_FG) ? icon_fg : NULL, - (data_flag & TVC_LINE_ICON_BG) ? icon_bg : NULL, - bg_sel)) { - /* When drawing, if we pass v2d->cur.ymax, then quit. */ - if (do_draw) { - /* Past the y limits. */ - break; - } - } + const bool is_out_of_view_y = !textview_draw_string( + &tds, + ext_line, + ext_len, + (data_flag & TVC_LINE_FG) ? fg : NULL, + (data_flag & TVC_LINE_BG) ? bg : NULL, + (data_flag & TVC_LINE_ICON) ? icon : 0, + (data_flag & TVC_LINE_ICON_FG) ? icon_fg : NULL, + (data_flag & TVC_LINE_ICON_BG) ? icon_bg : NULL, + bg_sel); 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); } + + /* When drawing, if we pass v2d->cur.ymax, then quit. */ + if (is_out_of_view_y) { + break; + } } if ((mval[1] != INT_MAX) && (mval[1] >= y_prev && mval[1] <= xy[1])) { |