From 1ee253c014c3280c8d5e8aebdaa880cfcd4cbd11 Mon Sep 17 00:00:00 2001 From: Aurel Wildfellner Date: Tue, 21 Jan 2020 14:22:34 +0100 Subject: Fix T68677: Graph Editor zoom to selected ignores scrollbar occlusion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed by: Sybren Stüvel, Julian Eisel Differential Revision: https://developer.blender.org/D6309 --- source/blender/editors/space_graph/graph_edit.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'source/blender/editors/space_graph/graph_edit.c') diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 98fe8c71454..0dfd4a925aa 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -292,12 +292,11 @@ static int graphkeys_viewall(bContext *C, /* Give some more space at the borders. */ BLI_rctf_scale(&cur_new, 1.1f); - /* Take regions into account, that could block the view. */ + /* Take regions into account, that could block the view. Marker region is supposed to be larger + * than the scrollbar, so priorize it.*/ float pad_top = UI_TIME_SCRUB_MARGIN_Y; - float pad_bottom = 0; - if (!BLI_listbase_is_empty(ED_context_get_markers(C))) { - pad_bottom = UI_MARKER_MARGIN_Y; - } + float pad_bottom = BLI_listbase_is_empty(ED_context_get_markers(C)) ? V2D_SCROLL_HANDLE_HEIGHT : + UI_MARKER_MARGIN_Y; BLI_rctf_pad_y(&cur_new, ac.ar->winy, pad_bottom, pad_top); UI_view2d_smooth_view(C, ac.ar, &cur_new, smooth_viewtx); -- cgit v1.2.3