Merge pull request #61629 from Geometror/fix-graphedit-comment-nodes

This commit is contained in:
Rémi Verschelde 2022-06-02 18:18:33 +02:00 committed by GitHub
commit d9277fdab8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -508,8 +508,9 @@ void GraphEdit::_notification(int p_what) {
void GraphEdit::_update_comment_enclosed_nodes_list(GraphNode *p_node, HashMap<StringName, Vector<GraphNode *>> &p_comment_enclosed_nodes) { void GraphEdit::_update_comment_enclosed_nodes_list(GraphNode *p_node, HashMap<StringName, Vector<GraphNode *>> &p_comment_enclosed_nodes) {
Rect2 comment_node_rect = p_node->get_rect(); Rect2 comment_node_rect = p_node->get_rect();
Vector<GraphNode *> enclosed_nodes; comment_node_rect.size *= zoom;
Vector<GraphNode *> enclosed_nodes;
for (int i = 0; i < get_child_count(); i++) { for (int i = 0; i < get_child_count(); i++) {
GraphNode *gn = Object::cast_to<GraphNode>(get_child(i)); GraphNode *gn = Object::cast_to<GraphNode>(get_child(i));
if (!gn || gn->is_selected()) { if (!gn || gn->is_selected()) {
@ -517,6 +518,8 @@ void GraphEdit::_update_comment_enclosed_nodes_list(GraphNode *p_node, HashMap<S
} }
Rect2 node_rect = gn->get_rect(); Rect2 node_rect = gn->get_rect();
node_rect.size *= zoom;
bool included = comment_node_rect.encloses(node_rect); bool included = comment_node_rect.encloses(node_rect);
if (included) { if (included) {
enclosed_nodes.push_back(gn); enclosed_nodes.push_back(gn);