diff options
| author | Juan Linietsky | 2016-09-03 14:58:23 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2016-09-03 14:58:23 -0300 |
| commit | 5028d7510d1036cfb027d3dd2158d3d22afb530b (patch) | |
| tree | 787348324806cbc035f4d7374d66cbf9282db11c /scene/gui/graph_edit.cpp | |
| parent | ee37c2f4330e9bd247576b5834cd2660cb520e13 (diff) | |
| download | godot-5028d7510d1036cfb027d3dd2158d3d22afb530b.tar.gz godot-5028d7510d1036cfb027d3dd2158d3d22afb530b.tar.zst godot-5028d7510d1036cfb027d3dd2158d3d22afb530b.zip | |
Diffstat (limited to 'scene/gui/graph_edit.cpp')
| -rw-r--r-- | scene/gui/graph_edit.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index 2307b3334..8b03dbbc2 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -425,6 +425,7 @@ void GraphEdit::_top_layer_input(const InputEvent& p_ev) { connecting_color=to->cast_to<GraphNode>()->get_connection_input_color(E->get().to_port); connecting_target=false; connecting_to=pos; + just_disconected=true; emit_signal("disconnection_request",E->get().from,E->get().from_port,E->get().to,E->get().to_port); to = get_node(String(connecting_from)); //maybe it was erased @@ -446,6 +447,7 @@ void GraphEdit::_top_layer_input(const InputEvent& p_ev) { connecting_color=gn->get_connection_output_color(j); connecting_target=false; connecting_to=pos; + just_disconected=false; return; } @@ -474,6 +476,7 @@ void GraphEdit::_top_layer_input(const InputEvent& p_ev) { connecting_color=fr->cast_to<GraphNode>()->get_connection_output_color(E->get().from_port); connecting_target=false; connecting_to=pos; + just_disconected=true; emit_signal("disconnection_request",E->get().from,E->get().from_port,E->get().to,E->get().to_port); fr = get_node(String(connecting_from)); //maybe it was erased @@ -496,6 +499,8 @@ void GraphEdit::_top_layer_input(const InputEvent& p_ev) { connecting_color=gn->get_connection_input_color(j); connecting_target=false; connecting_to=pos; + just_disconected=true; + return; } @@ -568,7 +573,7 @@ void GraphEdit::_top_layer_input(const InputEvent& p_ev) { } emit_signal("connection_request",from,from_slot,to,to_slot); - } else { + } else if (!just_disconected) { String from = connecting_from; int from_slot = connecting_index; Vector2 ofs = Vector2(p_ev.mouse_button.x,p_ev.mouse_button.y); @@ -1323,6 +1328,7 @@ GraphEdit::GraphEdit() { zoom_hb->add_child(snap_amount); setting_scroll_ofs=false; + just_disconected=false; |
