Merge pull request #68337 from alfredbaudisch/multi-caret-selection-fix

Fixes mouse click deselect for multi and single carets
This commit is contained in:
Rémi Verschelde 2022-11-07 10:20:45 +01:00 committed by GitHub
commit a1bc636098
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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;