summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-01-06 09:46:55 +0100
committerGitHub <noreply@github.com>2021-01-06 09:46:55 +0100
commit598b52c1ba059f7ec21cd68f1b9035fd0fb85e76 (patch)
tree0fdc10d9e65d00c72797428e371d970b7117668f
parentc197a565f293f98fcc1f8188cf9aedfe174b8382 (diff)
parent715cf48f8162251c4b17410f7f1d7df2a36a0f4b (diff)
Merge pull request #44802 from dakennedyd/script-editor-fix
Makes script editor not draw non existent spaces.
-rw-r--r--scene/gui/text_edit.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 75b875ff0b..7557d36298 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -1285,8 +1285,7 @@ void TextEdit::_notification(int p_what) {
if (draw_tabs && ((glyphs[j].flags & TextServer::GRAPHEME_IS_TAB) == TextServer::GRAPHEME_IS_TAB)) {
int yofs = (text_height - cache.tab_icon->get_height()) / 2 - ldata->get_line_ascent(line_wrap_index);
cache.tab_icon->draw(ci, Point2(char_ofs + char_margin + ofs_x, ofs_y + yofs), current_color);
- }
- if (draw_spaces && ((glyphs[j].flags & TextServer::GRAPHEME_IS_SPACE) == TextServer::GRAPHEME_IS_SPACE)) {
+ } else if (draw_spaces && ((glyphs[j].flags & TextServer::GRAPHEME_IS_SPACE) == TextServer::GRAPHEME_IS_SPACE)) {
int yofs = (text_height - cache.space_icon->get_height()) / 2 - ldata->get_line_ascent(line_wrap_index);
int xofs = (glyphs[j].advance * glyphs[j].repeat - cache.space_icon->get_width()) / 2;
cache.space_icon->draw(ci, Point2(char_ofs + char_margin + ofs_x + xofs, ofs_y + yofs), current_color);