diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-08-08 21:37:02 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-08-08 21:37:02 +0400 |
commit | 543cee14ca9a6b89a1b26ccbfda1d58743db71af (patch) | |
tree | 0cac00be9012018f670e11747b3cb7af04f46bf1 /source/blender/editors/space_node/node_relationships.c | |
parent | de131177b0ccfa9c65b9edca97f6349ebc3b6b07 (diff) |
Renamed the mx/my coordinates in SpaceNode to more descriptive 'cursor'. This follows the naming in the View3D space, since this vector is used for essentially the same purpose (adding nodes at a specific location), although not used for any transform origin and not displayed in the editor.
Note: While renaming DNA properties is usually dangerous and can break files, in this case it is possible because the mx/my values are only used at runtime.
Diffstat (limited to 'source/blender/editors/space_node/node_relationships.c')
-rw-r--r-- | source/blender/editors/space_node/node_relationships.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/space_node/node_relationships.c b/source/blender/editors/space_node/node_relationships.c index d82118facd1..6295a568113 100644 --- a/source/blender/editors/space_node/node_relationships.c +++ b/source/blender/editors/space_node/node_relationships.c @@ -437,10 +437,10 @@ static int outside_group_rect(SpaceNode *snode) { bNode *gnode = node_tree_get_editgroup(snode->nodetree); if (gnode) { - return (snode->mx < gnode->totr.xmin || - snode->mx >= gnode->totr.xmax || - snode->my < gnode->totr.ymin || - snode->my >= gnode->totr.ymax); + return (snode->cursor[0] < gnode->totr.xmin || + snode->cursor[0] >= gnode->totr.xmax || + snode->cursor[1] < gnode->totr.ymin || + snode->cursor[1] >= gnode->totr.ymax); } return 0; } @@ -462,7 +462,7 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event) in_out = nldrag->in_out; UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], - &snode->mx, &snode->my); + &snode->cursor[0], &snode->cursor[1]); switch (event->type) { case MOUSEMOVE: @@ -708,7 +708,7 @@ static int node_link_invoke(bContext *C, wmOperator *op, wmEvent *event) int detach = RNA_boolean_get(op->ptr, "detach"); UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], - &snode->mx, &snode->my); + &snode->cursor[0], &snode->cursor[1]); ED_preview_kill_jobs(C); @@ -1139,7 +1139,7 @@ static int node_attach_exec(bContext *C, wmOperator *UNUSED(op)) /* skip selected, those are the nodes we want to attach */ if ((frame->type != NODE_FRAME) || (frame->flag & NODE_SELECT)) continue; - if (BLI_in_rctf(&frame->totr, snode->mx, snode->my)) + if (BLI_in_rctf(&frame->totr, snode->cursor[0], snode->cursor[1])) break; } if (frame) { @@ -1185,7 +1185,7 @@ static int node_attach_invoke(bContext *C, wmOperator *op, wmEvent *event) SpaceNode *snode = CTX_wm_space_node(C); /* convert mouse coordinates to v2d space */ - UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &snode->mx, &snode->my); + UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &snode->cursor[0], &snode->cursor[1]); return node_attach_exec(C, op); } |