diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2020-12-01 09:11:41 +0200 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2020-12-06 20:31:00 +0200 |
commit | c3cc9d82b437023ecdf476be6da16c9a995c4e4b (patch) | |
tree | 7ed28f22b46f93a5e054fe7d95ef7532ddcae5f7 /scene/gui | |
parent | a458e901791818babe198c0177e0a2e851f821c1 (diff) |
[Complex Text Layouts] Align glyph offsets and advances to the pixel grid.
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/line_edit.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 9cf7c105ef..299c1f2f8a 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -841,7 +841,7 @@ void LineEdit::_notification(int p_what) { for (int i = 0; i < glyphs.size(); i++) { bool selected = selection.enabled && glyphs[i].start >= selection.begin && glyphs[i].end <= selection.end; for (int j = 0; j < glyphs[i].repeat; j++) { - if (ceil(ofs.x) >= x_ofs && floor(ofs.x + glyphs[i].advance) <= ofs_max) { + if (ceil(ofs.x) >= x_ofs && (ofs.x + glyphs[i].advance) <= ofs_max) { if (glyphs[i].font_rid != RID()) { TS->font_draw_glyph(glyphs[i].font_rid, ci, glyphs[i].font_size, ofs + Vector2(glyphs[i].x_off, glyphs[i].y_off), glyphs[i].index, selected ? font_color_selected : font_color); } else if ((glyphs[i].flags & TextServer::GRAPHEME_IS_VIRTUAL) != TextServer::GRAPHEME_IS_VIRTUAL) { |