Bugfix, in 2.61.1
Overlapping regions now hide automatic when too little space is left.
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user