diff options
author | Julian Eisel <julian@blender.org> | 2021-11-25 19:26:53 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-11-25 19:26:53 +0300 |
commit | 4a3f99ad5a2e6e87156baa5c6f2184df8ea09683 (patch) | |
tree | 295575c89f2435f8a74ca99a7a2d2d9430f81421 /source/blender/editors/screen | |
parent | 3652f5f758aafa2103519c3c0663ba8643b554c1 (diff) | |
parent | 5a11c6e558c6581cc07d2a1d67db460241255f09 (diff) |
Merge branch 'blender-v3.0-release'
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 38eadf95bde..0190e7b7cee 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. */ |