From c243d240282452ae5451b3b48d4f5bdc68695026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lera=20Elvo=C3=A9?= Date: Sat, 2 Dec 2023 01:14:19 +0300 Subject: [PATCH] refresh visual connections in deck renderer when duplicating nodes --- graph_node_renderer/deck_renderer_graph_edit.gd | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/graph_node_renderer/deck_renderer_graph_edit.gd b/graph_node_renderer/deck_renderer_graph_edit.gd index caa55ad..8d84fa6 100644 --- a/graph_node_renderer/deck_renderer_graph_edit.gd +++ b/graph_node_renderer/deck_renderer_graph_edit.gd @@ -151,8 +151,7 @@ func _on_deck_node_added(node: DeckNode) -> void: inst.node = node add_child(inst) inst.position_offset = inst.node.position_as_vector2() - clear_connections() - refresh_connections() + ## Connected to [signal Deck.node_added], used to remove the specified ## [DeckNodeRendererGraphNode] and queue_free it. @@ -258,8 +257,12 @@ func _on_paste_nodes_request() -> void: if snapping_enabled: node_pos = node_pos.snapped(Vector2(snapping_distance, snapping_distance)) + clear_connections() + deck.paste_nodes_from_json(clip, node_pos) + refresh_connections() + func _on_duplicate_nodes_request() -> void: var selected := get_selected_nodes() @@ -272,4 +275,8 @@ func _on_duplicate_nodes_request() -> void: return x.node._id )) + clear_connections() + deck.duplicate_nodes(selected_ids) + + refresh_connections()