summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMJacred <loesch.benny92@gmx.de>2023-09-11 12:32:36 +0200
committerMJacred <loesch.benny92@gmx.de>2023-09-11 12:32:36 +0200
commit6170381bd754490aee34e5a34558460d5c2f33f9 (patch)
tree216568a2c9eb010627fef9f403df3ba6c1f8629a /tests
parent332bc469c46e1372cdf3222bd3d31c382afc2784 (diff)
downloadredot-engine-6170381bd754490aee34e5a34558460d5c2f33f9.tar.gz
Fix TextEdit.get_rect_at_line_column returning negative pos even though cursor is in viewable area of the control
Diffstat (limited to 'tests')
-rw-r--r--tests/scene/test_text_edit.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/scene/test_text_edit.h b/tests/scene/test_text_edit.h
index 79766cd919..7e9b472af1 100644
--- a/tests/scene/test_text_edit.h
+++ b/tests/scene/test_text_edit.h
@@ -3241,6 +3241,15 @@ TEST_CASE("[SceneTree][TextEdit] mouse") {
SceneTree::get_singleton()->get_root()->add_child(text_edit);
text_edit->set_size(Size2(800, 200));
+
+ CHECK(text_edit->get_rect_at_line_column(0, 0).get_position() == Point2i(0, 0));
+
+ text_edit->set_line(0, "A");
+ MessageQueue::get_singleton()->flush();
+ CHECK(text_edit->get_rect_at_line_column(0, 1).get_position().x > 0);
+
+ text_edit->clear(); // Necessary, otherwise the following test cases fail.
+
text_edit->set_line(0, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec vasius mattis leo, sed porta ex lacinia bibendum. Nunc bibendum pellentesque.");
MessageQueue::get_singleton()->flush();