summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2023-04-02 20:53:00 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2023-04-02 20:53:13 +0300
commitefe04af446cd042c6505722ef2608aa03dc63435 (patch)
tree2e2551de37383f6bc3387e1db848f0fa4409d5fc
parentdf7834ac96398da0cb6b09f77ec010d4dff467f7 (diff)
downloadredot-engine-efe04af446cd042c6505722ef2608aa03dc63435.tar.gz
[TextEdit] Fix block caret size at the end of the line.
-rw-r--r--scene/gui/text_edit.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 30bac0f58c..0560b9f2e4 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -1385,7 +1385,7 @@ void TextEdit::_notification(int p_what) {
ts_caret.l_caret.position.y += ts_caret.l_caret.size.y;
ts_caret.l_caret.size.y = caret_width;
}
- if (ts_caret.l_caret.position.x >= TS->shaped_text_get_size(rid).x) {
+ if (Math::ceil(ts_caret.l_caret.position.x) >= TS->shaped_text_get_size(rid).x) {
ts_caret.l_caret.size.x = font->get_char_size('m', font_size).x;
} else {
ts_caret.l_caret.size.x = 3 * caret_width;