From d8d53e3370e8abeeabc27683c3a3ca6e21da34f0 Mon Sep 17 00:00:00 2001 From: MewPurPur Date: Sat, 8 Jul 2023 00:31:17 +0300 Subject: [PATCH] Deselect curve point with RMB on the empty space --- editor/plugins/curve_editor_plugin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index a1a692bdd1f0..5448b99b9141 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -184,7 +184,9 @@ void CurveEdit::gui_input(const Ref &p_event) { toggle_linear(selected_index, selected_tangent_index); } else { int point_to_remove = get_point_at(mpos); - if (point_to_remove != -1) { + if (point_to_remove == -1) { + set_selected_index(-1); // Nothing on the place of the click, just deselect the point. + } else { if (grabbing == GRAB_ADD) { curve->remove_point(point_to_remove); // Point is temporary, so remove directly from curve. set_selected_index(-1);