|
@@ -267,6 +267,7 @@ void AnimationNodeStateMachineEditor::_state_machine_gui_input(const Ref<InputEv
|
|
for (int i = node_rects.size() - 1; i >= 0; i--) { //inverse to draw order
|
|
for (int i = node_rects.size() - 1; i >= 0; i--) { //inverse to draw order
|
|
if (node_rects[i].node.has_point(mb->get_position())) { //select node since nothing else was selected
|
|
if (node_rects[i].node.has_point(mb->get_position())) { //select node since nothing else was selected
|
|
connecting = true;
|
|
connecting = true;
|
|
|
|
+ connection_follows_cursor = true;
|
|
connecting_from = node_rects[i].node_name;
|
|
connecting_from = node_rects[i].node_name;
|
|
connecting_to = mb->get_position();
|
|
connecting_to = mb->get_position();
|
|
connecting_to_node = StringName();
|
|
connecting_to_node = StringName();
|
|
@@ -296,6 +297,7 @@ void AnimationNodeStateMachineEditor::_state_machine_gui_input(const Ref<InputEv
|
|
_open_menu(mb->get_position());
|
|
_open_menu(mb->get_position());
|
|
}
|
|
}
|
|
connecting_to_node = StringName();
|
|
connecting_to_node = StringName();
|
|
|
|
+ connection_follows_cursor = false;
|
|
state_machine_draw->queue_redraw();
|
|
state_machine_draw->queue_redraw();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -332,7 +334,7 @@ void AnimationNodeStateMachineEditor::_state_machine_gui_input(const Ref<InputEv
|
|
}
|
|
}
|
|
|
|
|
|
// Move mouse while connecting
|
|
// Move mouse while connecting
|
|
- if (mm.is_valid() && connecting && !read_only) {
|
|
|
|
|
|
+ if (mm.is_valid() && connecting && connection_follows_cursor && !read_only) {
|
|
connecting_to = mm->get_position();
|
|
connecting_to = mm->get_position();
|
|
connecting_to_node = StringName();
|
|
connecting_to_node = StringName();
|
|
state_machine_draw->queue_redraw();
|
|
state_machine_draw->queue_redraw();
|