diff options
author | Red Mser <RedMser> | 2022-06-28 08:15:31 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-06-28 08:20:06 +0300 |
commit | e6d50cdd431fd56bc76699aeaab7ea840db1eb2d (patch) | |
tree | 000323e759ddc62eeb97359fcdaf061c3a23d557 /source | |
parent | ca9e1f6391e9f944b524529d6d4eeec13be75c26 (diff) |
Fix textview selection rendering in front of text
Selection of Python Console renders in front of the text.
Since the default theme uses a low opacity selection color,
it isn't obvious, but increasing alpha to 100% shows it clearly.
Ref D13111
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_info/textview.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/editors/space_info/textview.c b/source/blender/editors/space_info/textview.c index 8fc61f78a6c..bc2b539474c 100644 --- a/source/blender/editors/space_info/textview.c +++ b/source/blender/editors/space_info/textview.c @@ -245,9 +245,6 @@ static bool textview_draw_string(TextViewDrawState *tds, const int final_offset = offsets[tot_lines - 1]; len = str_len - final_offset; s = str + final_offset; - BLF_position(tds->font_id, tds->xy[0], tds->lofs + line_bottom + tds->row_vpadding, 0); - BLF_color4ubv(tds->font_id, fg); - BLF_draw_mono(tds->font_id, s, len, tds->cwidth); if (tds->sel[0] != tds->sel[1]) { textview_step_sel(tds, -final_offset); @@ -255,6 +252,10 @@ static bool textview_draw_string(TextViewDrawState *tds, textview_draw_sel(s, pos, len, tds, bg_sel); } + BLF_position(tds->font_id, tds->xy[0], tds->lofs + line_bottom + tds->row_vpadding, 0); + BLF_color4ubv(tds->font_id, fg); + BLF_draw_mono(tds->font_id, s, len, tds->cwidth); + tds->xy[1] += tds->lheight; BLF_color4ubv(tds->font_id, fg); @@ -263,14 +264,14 @@ static bool textview_draw_string(TextViewDrawState *tds, len = offsets[i] - offsets[i - 1]; s = str + offsets[i - 1]; - BLF_position(tds->font_id, tds->xy[0], tds->lofs + tds->xy[1], 0); - BLF_draw_mono(tds->font_id, s, len, tds->cwidth); - if (tds->sel[0] != tds->sel[1]) { textview_step_sel(tds, len); textview_draw_sel(s, tds->xy, len, tds, bg_sel); } + BLF_position(tds->font_id, tds->xy[0], tds->lofs + tds->xy[1], 0); + BLF_draw_mono(tds->font_id, s, len, tds->cwidth); + tds->xy[1] += tds->lheight; /* Check if we're out of view bounds. */ |