From 482630652b08ddac65a8e974956a8ed982fa6bea Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 19 Dec 2012 16:16:20 +0000 Subject: Bugfix, in 2.61.1 Overlapping regions now hide automatic when too little space is left. --- source/blender/editors/screen/area.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'source/blender/editors/screen') diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index b681416250e..fbdec3dd8ad 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -876,7 +876,7 @@ static int rct_fits(rcti *rect, char dir, int size) /* ar should be overlapping */ /* function checks if some overlapping region was defined before - on same place */ -static void region_overlap_fix(ARegion *ar) +static void region_overlap_fix(ScrArea *sa, ARegion *ar) { ARegion *ar1 = ar->prev; @@ -890,18 +890,26 @@ static void region_overlap_fix(ARegion *ar) ar1 = ar1->prev; } - /* translate */ + /* translate or close */ if (ar1) { int align1 = ar1->alignment & ~RGN_SPLIT_PREV; if (align1 == RGN_ALIGN_LEFT) { - BLI_rcti_translate(&ar->winrct, ar1->winx, 0); + if (ar->winrct.xmax + ar1->winx > sa->winx - U.widget_unit) + ar->flag |= RGN_FLAG_TOO_SMALL; + else + BLI_rcti_translate(&ar->winrct, ar1->winx, 0); } else if (align1 == RGN_ALIGN_RIGHT) { - BLI_rcti_translate(&ar->winrct, -ar1->winx, 0); + if (ar->winrct.xmin - ar1->winx < U.widget_unit) + ar->flag |= RGN_FLAG_TOO_SMALL; + else + BLI_rcti_translate(&ar->winrct, -ar1->winx, 0); } } + + } /* overlapping regions only in the following restricted cases */ @@ -1097,9 +1105,9 @@ static void region_rect_recursive(wmWindow *win, ScrArea *sa, ARegion *ar, rcti if (ar->winx > 1) ar->sizex = (ar->winx + 0.5f) / UI_DPI_FAC; if (ar->winy > 1) ar->sizey = (ar->winy + 0.5f) / UI_DPI_FAC; - /* exception for multiple aligned overlapping regions on same spot */ + /* exception for multiple overlapping regions on same spot */ if (ar->overlap) - region_overlap_fix(ar); + region_overlap_fix(sa, ar); /* set winrect for azones */ if (ar->flag & (RGN_FLAG_HIDDEN | RGN_FLAG_TOO_SMALL)) { -- cgit v1.2.3