Mouse click deselect removes secondary carets and puts primary caret under mouse position

Fixes and closes #67993.
This commit is contained in:
Alfred Reinold Baudisch 2022-11-05 09:37:19 +01:00
parent ec521a405a
commit 0d2953074b

View file

@ -1854,6 +1854,12 @@ void TextEdit::gui_input(const Ref<InputEvent> &p_gui_input) {
} else {
if (mb->get_button_index() == MouseButton::LEFT) {
if (selection_drag_attempt && is_mouse_over_selection()) {
remove_secondary_carets();
Point2i pos = get_line_column_at_pos(get_local_mouse_pos());
set_caret_line(pos.y, false, true, 0, 0);
set_caret_column(pos.x, true, 0);
deselect();
}
dragging_minimap = false;