diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-06-29 18:34:46 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-06-29 18:34:46 +0400 |
commit | 83093d677049f6ba085c34d1719906e2ee3cc3d1 (patch) | |
tree | 22c356af6a5657cd8bf1b37ddb3ca5503a243d73 /source/blender/editors/include/ED_node.h | |
parent | 344ca17247accd2848081e69eab00ab7aac4a0ae (diff) |
Extended modes for snapping in the node editor.
The transform operators in nodes will now use the unselected nodes to generate snapping points. Unlike object snapping, node snapping works for the x/y axes separately and snaps node borders to same borders of unselected nodes. The sensitive area for node borders extends over the whole view2D range, to enable simple alignment of nodes in both x and y direction.
For snap points in the node editor an additional enum value is stored to indicate the type of node border (left/right/top/bottom). This works as a constraint on possible node alignments: only same border types align with each other.
Diffstat (limited to 'source/blender/editors/include/ED_node.h')
-rw-r--r-- | source/blender/editors/include/ED_node.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/include/ED_node.h b/source/blender/editors/include/ED_node.h index 0979e3ec92b..6f86d01fb98 100644 --- a/source/blender/editors/include/ED_node.h +++ b/source/blender/editors/include/ED_node.h @@ -41,10 +41,20 @@ struct bNodeTree; struct bNode; struct bNodeTree; struct ScrArea; +struct View2D; + +typedef enum { + NODE_TOP = 1, + NODE_BOTTOM = 2, + NODE_LEFT = 4, + NODE_RIGHT = 8 +} NodeBorder; /* drawnode.c */ void ED_init_node_butfuncs(void); +void drawnodesnap(struct View2D *v2d, const float cent[2], float size, NodeBorder border); + /* node_draw.c */ void ED_node_tree_update(struct SpaceNode *snode, struct Scene *scene); void ED_node_changed_update(struct ID *id, struct bNode *node); |