diff options
author | Pratik Borhade <PratikPB2123> | 2022-08-29 22:39:14 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-08-29 22:45:01 +0300 |
commit | 68487cff95b335491e001ded8620b4b7aa3380db (patch) | |
tree | 4845e3fa5875274204b5ef2c85a60a87f3ab5ec2 /source | |
parent | 805d1063a052d07e26e9c510d1b293b7b95172ed (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 a89b5444a4d..e96efb888f3 100644 --- a/source/blender/editors/space_node/node_add.cc +++ b/source/blender/editors/space_node/node_add.cc @@ -192,6 +192,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; |