diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-06-28 12:47:22 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-06-28 12:47:22 +0400 |
commit | 855b6391ea3ee5eef819cfa73c72e016e461d74b (patch) | |
tree | b969e7905ded2e174478a26224e46c902a302e25 /source/blender/editors/space_node/node_draw.c | |
parent | edf244cbf70d569484b937f58aa9fd69b4243bd5 (diff) |
Basic snapping in node transform operator.
Snapping actually was working already, but grid spacing was set to 1.0, which is basically pixel size in the node editor. Increased this to 1x grid step for fine snapping and 5x grid step for rough snapping.
Grid drawing in node editor now draws 2 levels in slightly different shades to indicate the different snapping modes better.
Node editor also supports the general use_snap tool setting to enable automatic snapping during transform. For now only the incremental snapping is supported, in future could be extended to enable alignment between nodes in a number of ways.
Diffstat (limited to 'source/blender/editors/space_node/node_draw.c')
-rw-r--r-- | source/blender/editors/space_node/node_draw.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index c65bbd6e15f..f9aa0dfd582 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -1095,7 +1095,9 @@ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d) snode->aspect= (v2d->cur.xmax - v2d->cur.xmin)/((float)ar->winx); // XXX snode->curfont= uiSetCurFont_ext(snode->aspect); - UI_view2d_constant_grid_draw(v2d); + /* grid */ + UI_view2d_multi_grid_draw(v2d, 25.0f, 5, 2); + /* backdrop */ draw_nodespace_back_pix(ar, snode, color_manage); |