diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-12 05:07:31 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-12 05:07:31 +0400 |
commit | 9cce2d864554cb78abfb5e2909dfb1a506933d3c (patch) | |
tree | 57f1037cb16ce26791f4bb1cd5fb0a88293d8af9 /source/blender/editors/space_node/node_view.c | |
parent | 1aaaf67a9e42cfbba6d8c955a9e0a7519b296933 (diff) |
smooth-view for 2d views, graph editor, sequencer, node view, works with border zoom, view selected, view all.
Diffstat (limited to 'source/blender/editors/space_node/node_view.c')
-rw-r--r-- | source/blender/editors/space_node/node_view.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/editors/space_node/node_view.c b/source/blender/editors/space_node/node_view.c index 7ad283b9869..0566611dc0e 100644 --- a/source/blender/editors/space_node/node_view.c +++ b/source/blender/editors/space_node/node_view.c @@ -43,6 +43,8 @@ #include "ED_space_api.h" #include "ED_image.h" +#include "UI_view2d.h" + #include "RNA_access.h" #include "RNA_define.h" @@ -61,7 +63,7 @@ /* **************** View All Operator ************** */ -static int space_node_view_flag(SpaceNode *snode, ARegion *ar, const int node_flag) +static int space_node_view_flag(bContext *C, SpaceNode *snode, ARegion *ar, const int node_flag) { bNode *node; rctf cur_new; @@ -118,8 +120,7 @@ static int space_node_view_flag(SpaceNode *snode, ARegion *ar, const int node_fl } } - ar->v2d.tot = ar->v2d.cur = cur_new; - UI_view2d_curRect_validate(&ar->v2d); + UI_view2d_smooth_view(C, ar, &cur_new); } return (tot != 0); @@ -134,7 +135,7 @@ static int node_view_all_exec(bContext *C, wmOperator *UNUSED(op)) snode->xof = 0; snode->yof = 0; - if (space_node_view_flag(snode, ar, 0)) { + if (space_node_view_flag(C, snode, ar, 0)) { ED_region_tag_redraw(ar); return OPERATOR_FINISHED; @@ -164,7 +165,7 @@ static int node_view_selected_exec(bContext *C, wmOperator *UNUSED(op)) ARegion *ar = CTX_wm_region(C); SpaceNode *snode = CTX_wm_space_node(C); - if (space_node_view_flag(snode, ar, NODE_SELECT)) { + if (space_node_view_flag(C, snode, ar, NODE_SELECT)) { ED_region_tag_redraw(ar); return OPERATOR_FINISHED; |