Skip to content

Commit

Permalink
Merge pull request #79175 from MewPurPur/curve-deselect
Browse files Browse the repository at this point in the history
Deselect curve point with RMB on the empty space
  • Loading branch information
YuriSizov committed Jul 24, 2023
2 parents 52078dc + d8d53e3 commit fefd02b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion editor/plugins/curve_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,9 @@ void CurveEdit::gui_input(const Ref<InputEvent> &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);
Expand Down

0 comments on commit fefd02b

Please sign in to comment.