diff options
| author | Paulb23 | 2016-05-30 16:28:31 +0100 |
|---|---|---|
| committer | Rémi Verschelde | 2016-06-04 22:20:02 +0200 |
| commit | 7928b5fef61a6cdb52cb2529001e4ecf74fc1cdd (patch) | |
| tree | 3d77e9584063765a36491f753ec37a714ae05c85 /scene/gui/text_edit.cpp | |
| parent | 8b8a1a0cbbb17e5cb4466352ab44888164dd04da (diff) | |
| download | godot-7928b5fef61a6cdb52cb2529001e4ecf74fc1cdd.tar.gz godot-7928b5fef61a6cdb52cb2529001e4ecf74fc1cdd.tar.zst godot-7928b5fef61a6cdb52cb2529001e4ecf74fc1cdd.zip | |
Current line draws behind line numbers and breakpont gutter
(cherry picked from commit 6ae126ef9b2d654dc3575aea18bbb280992e0bc5)
Diffstat (limited to 'scene/gui/text_edit.cpp')
| -rw-r--r-- | scene/gui/text_edit.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index dacaf0573..f75e986a9 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -696,15 +696,6 @@ void TextEdit::_notification(int p_what) { highlighted_text_col = _get_column_pos_of_word(highlighted_text, str, 0); } - if (cache.line_number_w) { - String fc = String::num(line+1); - while (fc.length() < line_number_char_count) { - fc="0"+fc; - } - - cache.font->draw(ci,Point2(cache.style_normal->get_margin(MARGIN_LEFT)+cache.breakpoint_gutter_width,ofs_y+cache.font->get_ascent()),fc,cache.line_number_color); - } - const Map<int,Text::ColorRegionInfo>& cri_map=text.get_color_region_info(line); @@ -716,8 +707,14 @@ void TextEdit::_notification(int p_what) { if (text.is_breakpoint(line)) { VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(xmargin_beg, ofs_y,xmargin_end-xmargin_beg,get_row_height()),cache.breakpoint_color); + } + + if (line==cursor.line) { + VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(0, ofs_y,xmargin_end,get_row_height()),cache.current_line_color); + } - // draw breakpoint marker + // draw breakpoint marker + if (text.is_breakpoint(line)) { if (draw_breakpoint_gutter) { int vertical_gap = cache.breakpoint_gutter_width / 2; int marker_size = cache.breakpoint_gutter_width - vertical_gap; @@ -727,10 +724,13 @@ void TextEdit::_notification(int p_what) { } - if (line==cursor.line) { - - VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(xmargin_beg, ofs_y,xmargin_end-xmargin_beg,get_row_height()),cache.current_line_color); + if (cache.line_number_w) { + String fc = String::num(line+1); + while (fc.length() < line_number_char_count) { + fc="0"+fc; + } + cache.font->draw(ci,Point2(cache.style_normal->get_margin(MARGIN_LEFT)+cache.breakpoint_gutter_width,ofs_y+cache.font->get_ascent()),fc,cache.line_number_color); } for (int j=0;j<str.length();j++) { |
