diff options
author | Paulb23 <p_batty@hotmail.co.uk> | 2017-01-28 14:36:57 +0000 |
---|---|---|
committer | Paulb23 <p_batty@hotmail.co.uk> | 2017-01-28 14:36:57 +0000 |
commit | 6b42cd5fe637d6d0fe30fa397eca659d295ad956 (patch) | |
tree | 75661bac42b8d3126e0d29d5893ecbb00eb88cbd /scene/gui | |
parent | 96de0141ccef3bb035574010816dafdbfc17eb63 (diff) |
Fixed line lenght guideline drawing with color option
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/text_edit.cpp | 17 | ||||
-rw-r--r-- | scene/gui/text_edit.h | 1 |
2 files changed, 10 insertions, 8 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index d1a8c458ba..6036b3f9df 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -482,14 +482,6 @@ void TextEdit::_notification(int p_what) { Color color = cache.font_color; int in_region=-1; - if (line_length_guideline) { - int x=xmargin_beg+cache.font->get_char_size('0').width*line_length_guideline_col-cursor.x_ofs; - if (x>xmargin_beg && x<xmargin_end) { - Color guideline_color(color.r,color.g,color.b,color.a*0.25f); - VisualServer::get_singleton()->canvas_item_add_line(ci,Point2(x,0),Point2(x,cache.size.height),guideline_color); - } - } - if (syntax_coloring) { if (cache.background_color.a>0.01) { @@ -1080,6 +1072,14 @@ void TextEdit::_notification(int p_what) { } } + if (line_length_guideline) { + int x=xmargin_beg+cache.font->get_char_size('0').width*line_length_guideline_col-cursor.x_ofs; + if (x>xmargin_beg && x<xmargin_end) { + VisualServer::get_singleton()->canvas_item_add_line(ci,Point2(x,0),Point2(x,cache.size.height),cache.line_length_guideline_color); + } + } + + bool completion_below = false; if (completion_active) { // code completion box @@ -3484,6 +3484,7 @@ void TextEdit::_update_caches() { cache.selection_color=get_color("selection_color"); cache.mark_color=get_color("mark_color"); cache.current_line_color=get_color("current_line_color"); + cache.line_length_guideline_color=get_color("line_length_guideline_color"); cache.breakpoint_color=get_color("breakpoint_color"); cache.brace_mismatch_color=get_color("brace_mismatch_color"); cache.word_highlighted_color=get_color("word_highlighted_color"); diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index 6113fd72c2..437e22ca40 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -91,6 +91,7 @@ class TextEdit : public Control { Color mark_color; Color breakpoint_color; Color current_line_color; + Color line_length_guideline_color; Color brace_mismatch_color; Color word_highlighted_color; Color search_result_color; |