diff options
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r-- | source/blender/editors/screen/area.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 80c14371c16..fc839d5cd63 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -2934,6 +2934,16 @@ static const char *region_panels_collect_categories(ARegion *region, return NULL; } +static int panel_draw_width_from_max_width_get(const ARegion *region, + const PanelType *panel_type, + const int max_width) +{ + /* With a background, we want some extra padding. */ + return UI_panel_should_show_background(region, panel_type) ? + max_width - UI_PANEL_MARGIN_X * 2.0f : + max_width; +} + /** * \param contexts: A NULL terminated array of context strings to match against. * Matching against any of these strings will draw the panel. @@ -2982,7 +2992,6 @@ void ED_region_panels_layout_ex(const bContext *C, } const int width_no_header = BLI_rctf_size_x(&v2d->cur) - margin_x; - const int width = width_no_header - UI_PANEL_MARGIN_X * 2.0f; /* Works out to 10 * UI_UNIT_X or 20 * UI_UNIT_X. */ const int em = (region->type->prefsizex) ? 10 : 20; @@ -3010,6 +3019,7 @@ void ED_region_panels_layout_ex(const bContext *C, continue; } } + const int width = panel_draw_width_from_max_width_get(region, pt, width_no_header); if (panel && UI_panel_is_dragging(panel)) { /* Prevent View2d.tot rectangle size changes while dragging panels. */ @@ -3040,6 +3050,7 @@ void ED_region_panels_layout_ex(const bContext *C, !STREQ(category, panel->type->category)) { continue; } + const int width = panel_draw_width_from_max_width_get(region, panel->type, width_no_header); if (panel && UI_panel_is_dragging(panel)) { /* Prevent View2d.tot rectangle size changes while dragging panels. */ |