diff options
| author | Rémi Verschelde <remi@verschelde.fr> | 2021-02-11 13:11:50 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-11 13:11:50 +0100 |
| commit | 604188c4116215236b460054f81c9da585dfd678 (patch) | |
| tree | 98f567e0ca53ceaa5581ff27a1a7157b76519fab /scene/gui/graph_edit.cpp | |
| parent | dca3ce441aac377dd23c6d45a00574fb731c9b35 (diff) | |
| parent | fe6c8d48e62be71b971270c9d9d856951922b84a (diff) | |
| download | redot-engine-604188c4116215236b460054f81c9da585dfd678.tar.gz | |
Merge pull request #45870 from gongpha/graphedit-connection-update
Update GraphEdit when GraphNode's slot is updated
Diffstat (limited to 'scene/gui/graph_edit.cpp')
| -rw-r--r-- | scene/gui/graph_edit.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index 56ea4d8d55..6e61950f10 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -385,6 +385,15 @@ void GraphEdit::_graph_node_moved(Node *p_gn) { connections_layer->update(); } +void GraphEdit::_graph_node_slot_updated(int p_index, Node *p_gn) { + GraphNode *gn = Object::cast_to<GraphNode>(p_gn); + ERR_FAIL_COND(!gn); + top_layer->update(); + minimap->update(); + update(); + connections_layer->update(); +} + void GraphEdit::add_child_notify(Node *p_child) { Control::add_child_notify(p_child); @@ -394,6 +403,7 @@ void GraphEdit::add_child_notify(Node *p_child) { if (gn) { gn->set_scale(Vector2(zoom, zoom)); gn->connect("position_offset_changed", callable_mp(this, &GraphEdit::_graph_node_moved), varray(gn)); + gn->connect("slot_updated", callable_mp(this, &GraphEdit::_graph_node_slot_updated), varray(gn)); gn->connect("raise_request", callable_mp(this, &GraphEdit::_graph_node_raised), varray(gn)); gn->connect("item_rect_changed", callable_mp((CanvasItem *)connections_layer, &CanvasItem::update)); gn->connect("item_rect_changed", callable_mp((CanvasItem *)minimap, &GraphEditMinimap::update)); @@ -419,6 +429,7 @@ void GraphEdit::remove_child_notify(Node *p_child) { GraphNode *gn = Object::cast_to<GraphNode>(p_child); if (gn) { gn->disconnect("position_offset_changed", callable_mp(this, &GraphEdit::_graph_node_moved)); + gn->disconnect("slot_updated", callable_mp(this, &GraphEdit::_graph_node_slot_updated)); gn->disconnect("raise_request", callable_mp(this, &GraphEdit::_graph_node_raised)); // In case of the whole GraphEdit being destroyed these references can already be freed. |
