-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix TextEdit.get_rect_at_line_column returning
negative pos even though cursor is in viewable area of the control
#81354
Conversation
TextEdit.get_rect_at_line_column returning
negative pos even though cursor is in viewable area of the control
6ec4135
to
bd56765
Compare
@AThousandShips: done, ready for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look okay to me, would be good to add a unit test to capture this behaviour
EDIT: aaah! because I would do it, but this does not make any sense in my head: if you drag the mouse from column 1 to 7 you should get text_edit->set_text("this is some text\nfor selection");
text_edit->grab_focus();
MessageQueue::get_singleton()->flush();
SEND_GUI_MOUSE_BUTTON_EVENT(text_edit->get_pos_at_line_column(0, 1), MouseButton::LEFT, MouseButtonMask::LEFT, Key::NONE);
SEND_GUI_MOUSE_MOTION_EVENT(text_edit->get_pos_at_line_column(0, 7), MouseButtonMask::LEFT, Key::NONE);
CHECK(text_edit->has_selection());
CHECK(text_edit->get_selected_text() == "for s"); |
bd56765
to
f044890
Compare
46e56db
to
f3d37a3
Compare
f3d37a3
to
332bc46
Compare
8bcfa11
to
60b2b94
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style looks good!
…gh cursor is in viewable area of the control
60b2b94
to
6170381
Compare
TextEdit.get_rect_at_line_column returning
negative pos even though cursor is in viewable area of the controlTextEdit.get_rect_at_line_column returning
negative pos even though cursor is in viewable area of the control
Thanks! |
Sister PR of #81352 (for Godot 3.x)
When both are merged, #81349 can be closed
Production edit: Fixes #81349
Before fix:
textedit-bug_godot-4.webm
After fix:
after.webm