Cleanup: Remove unnecessary node link flag
Links that are currently being dragged are now stored outside of the node tree, so we don't need a flag to distinguish them from "proper" links.
This commit is contained in:
parent
6ecb1cb780
commit
aeea690e00
|
@ -2199,7 +2199,7 @@ void node_draw_link(const bContext &C,
|
|||
}
|
||||
|
||||
/* Links from field to non-field sockets are not allowed. */
|
||||
if (snode.edittree->type == NTREE_GEOMETRY && !(link.flag & NODE_LINK_DRAGGED)) {
|
||||
if (snode.edittree->type == NTREE_GEOMETRY) {
|
||||
if ((link.fromsock && link.fromsock->display_shape == SOCK_DISPLAY_SHAPE_DIAMOND) &&
|
||||
(link.tosock && link.tosock->display_shape == SOCK_DISPLAY_SHAPE_CIRCLE)) {
|
||||
th_col1 = th_col2 = th_col3 = TH_REDALERT;
|
||||
|
|
|
@ -91,7 +91,6 @@ static bNodeLink *create_drag_link(bNode &node, bNodeSocket &sock)
|
|||
oplink->tosock = &sock;
|
||||
}
|
||||
oplink->flag |= NODE_LINK_VALID;
|
||||
oplink->flag |= NODE_LINK_DRAGGED;
|
||||
return oplink;
|
||||
}
|
||||
|
||||
|
@ -903,8 +902,6 @@ static void node_link_exit(bContext &C, wmOperator &op, const bool apply_links)
|
|||
bNodeLinkDrag *nldrag = (bNodeLinkDrag *)op.customdata;
|
||||
|
||||
for (bNodeLink *link : nldrag->links) {
|
||||
link->flag &= ~NODE_LINK_DRAGGED;
|
||||
|
||||
if (apply_links && link->tosock && link->fromsock) {
|
||||
/* before actually adding the link,
|
||||
* let nodes perform special link insertion handling
|
||||
|
@ -1110,7 +1107,6 @@ static std::unique_ptr<bNodeLinkDrag> node_link_init(SpaceNode &snode,
|
|||
*oplink = *link;
|
||||
oplink->next = oplink->prev = nullptr;
|
||||
oplink->flag |= NODE_LINK_VALID;
|
||||
oplink->flag |= NODE_LINK_DRAGGED;
|
||||
|
||||
nldrag->links.append(oplink);
|
||||
nodeRemLink(snode.edittree, link);
|
||||
|
@ -1153,7 +1149,6 @@ static std::unique_ptr<bNodeLinkDrag> node_link_init(SpaceNode &snode,
|
|||
*oplink = *link_to_pick;
|
||||
oplink->next = oplink->prev = nullptr;
|
||||
oplink->flag |= NODE_LINK_VALID;
|
||||
oplink->flag |= NODE_LINK_DRAGGED;
|
||||
|
||||
nldrag->links.append(oplink);
|
||||
nodeRemLink(snode.edittree, link_to_pick);
|
||||
|
|
|
@ -499,7 +499,6 @@ typedef struct bNodeLink {
|
|||
#define NODE_LINK_TEST (1 << 2) /* free test flag, undefined */
|
||||
#define NODE_LINK_TEMP_HIGHLIGHT (1 << 3) /* Link is highlighted for picking. */
|
||||
#define NODE_LINK_MUTED (1 << 4) /* Link is muted. */
|
||||
#define NODE_LINK_DRAGGED (1 << 5) /* Node link is being dragged by the user. */
|
||||
|
||||
/* tree->edit_quality/tree->render_quality */
|
||||
#define NTREE_QUALITY_HIGH 0
|
||||
|
|
Loading…
Reference in New Issue