diff --git a/graph_node_renderer/deck_renderer_graph_edit.gd b/graph_node_renderer/deck_renderer_graph_edit.gd index 99d0103..39ab6c3 100644 --- a/graph_node_renderer/deck_renderer_graph_edit.gd +++ b/graph_node_renderer/deck_renderer_graph_edit.gd @@ -126,13 +126,13 @@ func get_node_renderer(node: DeckNode) -> DeckNodeRendererGraphNode: func _on_scroll_offset_changed(offset: Vector2) -> void: deck.set_meta("offset", offset) + ## Setups all the data from the set [member deck] in this [DeckRendererGraphEdit] func initialize_from_deck() -> void: change_dirty = false for i in get_children(): i.queue_free() - scroll_offset = deck.get_meta("offset", Vector2()) is_group = deck.is_group for node_id in deck.nodes: var node_renderer: DeckNodeRendererGraphNode = NODE_SCENE.instantiate() @@ -143,6 +143,10 @@ func initialize_from_deck() -> void: dirty = false refresh_connections() + + var ofs = deck.get_meta("offset", Vector2()) + set_scroll_offset.call_deferred(ofs) + ## Loops through all [DeckNode]s in [member Deck.nodes] and calls ## [method GraphEdit.connect_node] for all the connections that exist in each