From c6a39cd9524b82335b47889e8d77618cc20547f7 Mon Sep 17 00:00:00 2001 From: Hendrik Brucker Date: Thu, 2 Jun 2022 13:14:46 +0200 Subject: Fix enclosed nodes calculation of GraphEdit comment nodes --- scene/gui/graph_edit.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index 446d9e800a..8ad55fc6ef 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -508,8 +508,9 @@ void GraphEdit::_notification(int p_what) { void GraphEdit::_update_comment_enclosed_nodes_list(GraphNode *p_node, HashMap> &p_comment_enclosed_nodes) { Rect2 comment_node_rect = p_node->get_rect(); - Vector enclosed_nodes; + comment_node_rect.size *= zoom; + Vector enclosed_nodes; for (int i = 0; i < get_child_count(); i++) { GraphNode *gn = Object::cast_to(get_child(i)); if (!gn || gn->is_selected()) { @@ -517,6 +518,8 @@ void GraphEdit::_update_comment_enclosed_nodes_list(GraphNode *p_node, HashMapget_rect(); + node_rect.size *= zoom; + bool included = comment_node_rect.encloses(node_rect); if (included) { enclosed_nodes.push_back(gn); -- cgit v1.2.3