Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2012-12-19 20:16:20 +0400
committerTon Roosendaal <ton@blender.org>2012-12-19 20:16:20 +0400
commit482630652b08ddac65a8e974956a8ed982fa6bea (patch)
tree9c1af2d868a78cb4f72a8ef3adacbce68c83f587 /source/blender/editors/screen
parent9aa6698bd055450b358b191e8ef0bbb823af53e4 (diff)
Bugfix, in 2.61.1
Overlapping regions now hide automatic when too little space is left.
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r--source/blender/editors/screen/area.c20
1 files changed, 14 insertions, 6 deletions
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)) {