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
This commit is contained in:
Pratik Borhade 2022-08-29 14:39:14 -05:00 committed by Hans Goudey
parent 805d1063a0
commit 68487cff95
Notes: blender-bot 2023-02-13 15:09:39 +01:00
Referenced by issue #98968, Reroute node created within a frame doesn't belongs to the frame automatically
1 changed files with 7 additions and 0 deletions

View File

@ -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;