diff --git a/src/editor/graph/graph_edit.cpp b/src/editor/graph/graph_edit.cpp index f8e0f8ac..a4140e95 100644 --- a/src/editor/graph/graph_edit.cpp +++ b/src/editor/graph/graph_edit.cpp @@ -517,12 +517,16 @@ void OrchestratorGraphEdit::_move_selected(const Vector2& p_delta) { for (int i = 0; i < get_child_count(); i++) { - if (OrchestratorGraphNode* node = Object::cast_to(get_child(i))) + GraphElement* element = Object::cast_to(get_child(i)); + if (!element || !element->is_selected()) + continue; + + if (OrchestratorGraphNode* node = Object::cast_to(element)) { node->set_position_offset(node->get_position_offset() + p_delta); node->get_script_node()->set_position(node->get_position_offset()); } - else if (OrchestratorGraphKnot* knot = Object::cast_to(get_child(i))) + else if (OrchestratorGraphKnot* knot = Object::cast_to(element)) { knot->set_position_offset(knot->get_knot()->point + p_delta); }