diff options
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r-- | source/blender/editors/space_graph/graph_edit.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 8329218eea9..90cba617129 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -55,6 +55,7 @@ #include "DEG_depsgraph_build.h" #include "UI_view2d.h" +#include "UI_interface.h" #include "ED_anim_api.h" #include "ED_keyframing.h" @@ -282,10 +283,18 @@ static int graphkeys_viewall(bContext *C, do_sel_only, include_handles); + /* Give some more space at the borders. */ BLI_rctf_scale(&cur_new, 1.1f); - UI_view2d_smooth_view(C, ac.ar, &cur_new, smooth_viewtx); + /* Take regions into account, that could block the view. */ + float padding_top = UI_SCRUBBING_MARGIN_Y; + float padding_bottom = 0; + if (!BLI_listbase_is_empty(ED_context_get_markers(C))) { + padding_bottom = UI_MARKER_MARGIN_Y; + } + BLI_rctf_padding_y(&cur_new, ac.ar->sizey * UI_DPI_FAC, padding_top, padding_bottom); + UI_view2d_smooth_view(C, ac.ar, &cur_new, smooth_viewtx); return OPERATOR_FINISHED; } |