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/space_node/node_draw.c | |
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/space_node/node_draw.c')
-rw-r--r-- | source/blender/editors/space_node/node_draw.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index f9aa0dfd582..17d7530d2a7 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -65,6 +65,7 @@ #include "ED_node.h" #include "ED_gpencil.h" +#include "ED_space_api.h" #include "UI_interface.h" #include "UI_interface_icons.h" @@ -1087,6 +1088,8 @@ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d) //uiFreeBlocksWin(&sa->uiblocks, sa->win); + ED_region_draw_cb_draw(C, ar, REGION_DRAW_PRE_VIEW); + /* only set once */ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_MAP1_VERTEX_3); @@ -1139,6 +1142,8 @@ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d) glDisable(GL_LINE_SMOOTH); glDisable(GL_BLEND); + ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_VIEW); + /* draw grease-pencil ('canvas' strokes) */ if (snode->nodetree) draw_gpencil_view2d(C, 1); |