diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-01-11 08:34:15 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-01-11 08:34:15 +0400 |
commit | f68e9db583489d541d535791536ea20bc1ae1d76 (patch) | |
tree | 06c933c703688e927b7adf3995b74437e06400a4 /source/blender/editors | |
parent | a4d5ef8c7d6b8d1e73126b124aad3b4580370fa3 (diff) |
add padding for node view-all, view-home operators.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_graph/graph_edit.c | 9 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_view.c | 3 |
2 files changed, 4 insertions, 8 deletions
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 21b0ed99f0b..b92430ce0e9 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -217,7 +217,6 @@ void GRAPH_OT_previewrange_set(wmOperatorType *ot) static int graphkeys_viewall(bContext *C, const short do_sel_only, const short include_handles) { bAnimContext ac; - float extra; rctf cur_new; /* get editor data */ @@ -230,13 +229,7 @@ static int graphkeys_viewall(bContext *C, const short do_sel_only, const short i &cur_new.ymin, &cur_new.ymax, do_sel_only, include_handles); - extra = 0.1f * BLI_rctf_size_x(&cur_new); - cur_new.xmin -= extra; - cur_new.xmax += extra; - - extra = 0.1f * BLI_rctf_size_y(&cur_new); - cur_new.ymin -= extra; - cur_new.ymax += extra; + BLI_rctf_scale(&cur_new, 1.1f); UI_view2d_smooth_view(C, ac.ar, &cur_new); diff --git a/source/blender/editors/space_node/node_view.c b/source/blender/editors/space_node/node_view.c index 492ff0dcbd4..a69e73c1489 100644 --- a/source/blender/editors/space_node/node_view.c +++ b/source/blender/editors/space_node/node_view.c @@ -118,6 +118,9 @@ static int space_node_view_flag(bContext *C, SpaceNode *snode, ARegion *ar, cons cur_new.xmin = cur_new.xmin - width_new / 2.0f; cur_new.xmax = cur_new.xmax + width_new / 2.0f; } + + /* add some padding */ + BLI_rctf_scale(&cur_new, 1.1f); } UI_view2d_smooth_view(C, ar, &cur_new); |