summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-11-07 10:20:45 +0100
committerGitHub <noreply@github.com>2022-11-07 10:20:45 +0100
commita1bc636098c91ed47a8d9a23e07a4c85b64c1884 (patch)
tree3cf7df97745d9fb85b8043dc110256e288281ef5 /scene
parent92557a52b7c1fcaecbf41ea0af00dab4889cb1df (diff)
parent0d2953074b863861fed351c520449d860de72c99 (diff)
Merge pull request #68337 from alfredbaudisch/multi-caret-selection-fix
Fixes mouse click deselect for multi and single carets
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/text_edit.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 1b8444abf4..56f7281721 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -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;