[Bf-blender-cvs] [1ee253c014c] master: Fix T68677: Graph Editor zoom to selected ignores scrollbar occlusion

Aurel Wildfellner noreply at git.blender.org
Tue Jan 21 14:26:05 CET 2020


Commit: 1ee253c014c3280c8d5e8aebdaa880cfcd4cbd11
Author: Aurel Wildfellner
Date:   Tue Jan 21 14:22:34 2020 +0100
Branches: master
https://developer.blender.org/rB1ee253c014c3280c8d5e8aebdaa880cfcd4cbd11

Fix T68677: Graph Editor zoom to selected ignores scrollbar occlusion

Reviewed by: Sybren Stüvel, Julian Eisel

Differential Revision: https://developer.blender.org/D6309

===================================================================

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



More information about the Bf-blender-cvs mailing list