Skip to content

Commit

Permalink
GH-230 Reconstruct existing node on sync request
Browse files Browse the repository at this point in the history
  • Loading branch information
Naros committed Apr 5, 2024
1 parent 5ccab43 commit 3abdc3d
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/editor/graph/graph_edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -586,20 +586,20 @@ void OrchestratorGraphEdit::_synchronize_graph_connections_with_script()
void OrchestratorGraphEdit::_synchronize_graph_node(Ref<OScriptNode> p_node)
{
const String node_id = itos(p_node->get_id());
if (!has_node(node_id))
{
const Vector2 node_size = p_node->get_size();

if (has_node(node_id))
OrchestratorGraphNode* graph_node = OrchestratorGraphNodeFactory::create_node(this, p_node);
graph_node->set_title(p_node->get_node_title());
graph_node->set_position_offset(p_node->get_position());
graph_node->set_size(node_size.is_zero_approx() ? graph_node->get_size() : node_size);
add_child(graph_node);
}
else
{
WARN_PRINT("_synchronize_graph_node cannot update existing nodes; likely a bug!?");
return;
p_node->reconstruct_node();
}

const Vector2 node_size = p_node->get_size();

OrchestratorGraphNode* graph_node = OrchestratorGraphNodeFactory::create_node(this, p_node);
graph_node->set_title(p_node->get_node_title());
graph_node->set_position_offset(p_node->get_position());
graph_node->set_size(node_size.is_zero_approx() ? graph_node->get_size() : node_size);
add_child(graph_node);
}

void OrchestratorGraphEdit::_synchronize_child_order()
Expand Down

0 comments on commit 3abdc3d

Please sign in to comment.