diff options
author | Pratik Borhade <PratikPB2123> | 2022-08-29 22:39:14 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-08-29 22:39:14 +0300 |
commit | 50e5c787995c2a1a96edfef5479fe40c3a307c7f (patch) | |
tree | b58b638a2a6123bb5acb7e45818366ed976499ca /source | |
parent | 7fbf72f148dc9eada86cfcb345310c98f76962b8 (diff) |
Fix T98968: Node reroute tool doesn't add to frames
If reroute node lies in side the frame node boundaries then set
frame node as the parent of reroute.
Differential Revision: https://developer.blender.org/D15739
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_node/node_add.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/node_add.cc b/source/blender/editors/space_node/node_add.cc index 0d498d07aff..02684d92eaf 100644 --- a/source/blender/editors/space_node/node_add.cc +++ b/source/blender/editors/space_node/node_add.cc @@ -211,6 +211,13 @@ static bNodeSocketLink *add_reroute_do_socket_section(bContext *C, reroute_node->locx = insert_point[0] / UI_DPI_FAC; reroute_node->locy = insert_point[1] / UI_DPI_FAC; + + LISTBASE_FOREACH_BACKWARD (bNode *, frame_node, &ntree->nodes) { + if (frame_node->type == NODE_FRAME && BLI_rctf_isect_pt_v(&frame_node->totr, insert_point)) { + nodeAttachNode(reroute_node, frame_node); + break; + } + } } return socklink; |