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_edit.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_edit.c')
-rw-r--r-- | source/blender/editors/space_node/node_edit.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 6db3efd3694..dd8ad318cbd 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -797,8 +797,8 @@ static void node_resize_init(bContext *C, wmOperator *op, wmEvent *UNUSED(event) NodeSizeWidget *nsw = MEM_callocN(sizeof(NodeSizeWidget), "size widget op data"); op->customdata = nsw; - nsw->mxstart = snode->mx; - nsw->mystart = snode->my; + nsw->mxstart = snode->cursor[0]; + nsw->mystart = snode->cursor[1]; /* store old */ nsw->oldlocx = node->locx; @@ -936,8 +936,8 @@ static int node_resize_invoke(bContext *C, wmOperator *op, wmEvent *event) if (node) { /* convert mouse coordinates to v2d space */ UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], - &snode->mx, &snode->my); - dir = node->typeinfo->resize_area_func(node, snode->mx, snode->my); + &snode->cursor[0], &snode->cursor[1]); + dir = node->typeinfo->resize_area_func(node, snode->cursor[0], snode->cursor[1]); if (dir != 0) { node_resize_init(C, op, event, node, dir); return OPERATOR_RUNNING_MODAL; @@ -1051,10 +1051,10 @@ int node_find_indicated_socket(SpaceNode *snode, bNode **nodep, bNodeSocket **so /* check if we click in a socket */ for (node = snode->edittree->nodes.first; node; node = node->next) { - rect.xmin = snode->mx - (NODE_SOCKSIZE + 4); - rect.ymin = snode->my - (NODE_SOCKSIZE + 4); - rect.xmax = snode->mx + (NODE_SOCKSIZE + 4); - rect.ymax = snode->my + (NODE_SOCKSIZE + 4); + rect.xmin = snode->cursor[0] - (NODE_SOCKSIZE + 4); + rect.ymin = snode->cursor[1] - (NODE_SOCKSIZE + 4); + rect.xmax = snode->cursor[0] + (NODE_SOCKSIZE + 4); + rect.ymax = snode->cursor[1] + (NODE_SOCKSIZE + 4); if (!(node->flag & NODE_HIDDEN)) { /* extra padding inside and out - allow dragging on the text areas too */ @@ -2052,8 +2052,8 @@ static int node_clipboard_paste_exec(bContext *C, wmOperator *op) /* place nodes around the mouse cursor. child nodes locations are relative to parent */ if (!new_node->parent) { - new_node->locx += snode->mx - centerx - gnode_x; - new_node->locy += snode->my - centery - gnode_y; + new_node->locx += snode->cursor[0] - centerx - gnode_x; + new_node->locy += snode->cursor[1] - centery - gnode_y; } } @@ -2076,7 +2076,7 @@ static int node_clipboard_paste_invoke(bContext *C, wmOperator *op, wmEvent *eve 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_clipboard_paste_exec(C, op); } |