Fix T68677: Graph Editor zoom to selected ignores scrollbar occlusion

Reviewed by: Sybren Stüvel, Julian Eisel

Differential Revision: https://developer.blender.org/D6309
This commit is contained in:
2020-01-21 14:22:34 +01:00
committed by Julian Eisel
parent 4c8de1040d
commit 1ee253c014

View File

@@ -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);