summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-07-01 07:27:50 +0200
committerGitHub <noreply@github.com>2019-07-01 07:27:50 +0200
commit4f79812d41a2aa8d3329543ec0f223be1ec1132f (patch)
tree357c6b02cb9cff0a5114fff50201e9836a18f52f
parent95cb95e2d1f6f84c7739f50fb973a07d09041398 (diff)
parenta2f8297480f03b1c01170edc907497a25520472c (diff)
Merge pull request #30213 from Calinou/fix-line-length-guideline-drawing
Draw the script editor's line length guideline below characters
-rw-r--r--scene/gui/text_edit.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index fdd21f525b..f9bdce5fef 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -681,6 +681,13 @@ 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, size.height), cache.line_length_guideline_color);
+ }
+ }
+
int brace_open_match_line = -1;
int brace_open_match_column = -1;
bool brace_open_matching = false;
@@ -1339,13 +1346,6 @@ 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, size.height), cache.line_length_guideline_color);
- }
- }
-
bool completion_below = false;
if (completion_active) {
// code completion box