[Bf-blender-cvs] [5a11c6e558c] blender-v3.0-release: Fix missing margin below panels

Julian Eisel noreply at git.blender.org
Thu Nov 25 17:21:10 CET 2021


Commit: 5a11c6e558c6581cc07d2a1d67db460241255f09
Author: Julian Eisel
Date:   Thu Nov 25 17:15:48 2021 +0100
Branches: blender-v3.0-release
https://developer.blender.org/rB5a11c6e558c6581cc07d2a1d67db460241255f09

Fix missing margin below panels

A minor cosmetic fix. When the view was scrolled all the way to the
bottom, the lowest panel would end right on the view edge. The
scrollable view should get the same margin at the bottom as used at the
top.

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

M	source/blender/editors/interface/interface_panel.c

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

diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index d1daf5b48bf..06edf46fab7 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -1827,6 +1827,7 @@ static void ui_panels_size(ARegion *region, int *r_x, int *r_y)
 {
   int sizex = 0;
   int sizey = 0;
+  bool has_panel_with_background = false;
 
   /* Compute size taken up by panels, for setting in view2d. */
   LISTBASE_FOREACH (Panel *, panel, &region->panels) {
@@ -1836,6 +1837,9 @@ static void ui_panels_size(ARegion *region, int *r_x, int *r_y)
 
       sizex = max_ii(sizex, pa_sizex);
       sizey = min_ii(sizey, pa_sizey);
+      if (UI_panel_should_show_background(region, panel->type)) {
+        has_panel_with_background = true;
+      }
     }
   }
 
@@ -1845,6 +1849,11 @@ static void ui_panels_size(ARegion *region, int *r_x, int *r_y)
   if (sizey == 0) {
     sizey = -UI_PANEL_WIDTH;
   }
+  /* Extra margin after the list so the view scrolls a few pixels further than the panel border.
+   * Also makes the bottom match the top margin. */
+  if (has_panel_with_background) {
+    sizey -= UI_PANEL_MARGIN_Y;
+  }
 
   *r_x = sizex;
   *r_y = sizey;



More information about the Bf-blender-cvs mailing list