Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurel Wildfellner <aurel.w@gmail.com>2020-01-21 16:22:34 +0300
committerJulian Eisel <eiseljulian@gmail.com>2020-01-21 16:25:43 +0300
commit1ee253c014c3280c8d5e8aebdaa880cfcd4cbd11 (patch)
treebd64563f05eadebaf72dc9fc8758f989533fdba1 /source/blender/editors/space_graph/graph_edit.c
parent4c8de1040daec4616d7d6b0f43284c38001a3272 (diff)
Fix T68677: Graph Editor zoom to selected ignores scrollbar occlusion
Reviewed by: Sybren Stüvel, Julian Eisel Differential Revision: https://developer.blender.org/D6309
Diffstat (limited to 'source/blender/editors/space_graph/graph_edit.c')
-rw-r--r--source/blender/editors/space_graph/graph_edit.c9
1 files changed, 4 insertions, 5 deletions
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);