mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 07:17:42 -05:00
Fix TextEdit.get_rect_at_line_column returning negative pos even though cursor is in viewable area of the control
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user