summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-08-13 12:21:23 +0200
committerGitHub <noreply@github.com>2018-08-13 12:21:23 +0200
commit9ce33978db6c07561a8b6907111cf74aa9b671de (patch)
treef6338267930137c151910d4c5af929451635e27a /scene
parentec1e8843cf91bb898f54cc56ba2c6b4a8df3c612 (diff)
parent501fc98c63bd8d28ac403bac028af9d70e70f768 (diff)
Merge pull request #20666 from Calinou/script-editor-underline-hidpi
Scale underlines in the script editor with the editor scale
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/text_edit.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index d3de68ee24..c702bc70d0 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -1177,7 +1177,12 @@ void TextEdit::_notification(int p_what) {
int yofs = ofs_y + (get_row_height() - cache.font->get_height()) / 2;
int w = drawer.draw_char(ci, Point2i(char_ofs + char_margin + ofs_x, yofs + ascent), str[j], str[j + 1], in_selection && override_selected_font_color ? cache.font_selected_color : color);
if (underlined) {
- draw_rect(Rect2(char_ofs + char_margin + ofs_x, yofs + ascent + 2, w, 1), in_selection && override_selected_font_color ? cache.font_selected_color : color);
+ float line_width = 1.0;
+#ifdef TOOLS_ENABLED
+ line_width *= EDSCALE;
+#endif
+
+ draw_rect(Rect2(char_ofs + char_margin + ofs_x, yofs + ascent + 2, w, line_width), in_selection && override_selected_font_color ? cache.font_selected_color : color);
}
} else if (draw_tabs && str[j] == '\t') {
int yofs = (get_row_height() - cache.tab_icon->get_height()) / 2;