Fix GraphEdit reconnecting to disconnected port, cherry-picked for 3.x

This commit is contained in:
Yuri Roubinsky 2020-07-05 09:47:58 +03:00 committed by Lightning_A
parent 0b7384621e
commit 3ad676cbbe

View file

@ -677,7 +677,7 @@ void GraphEdit::_top_layer_input(const Ref<InputEvent> &p_ev) {
connecting_to = mm->get_position();
connecting_target = false;
top_layer->update();
connecting_valid = click_pos.distance_to(connecting_to) > 20.0 * zoom;
connecting_valid = just_disconnected || click_pos.distance_to(connecting_to) > 20.0 * zoom;
if (connecting_valid) {
Ref<Texture> port = get_icon("port", "GraphNode");