[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53185] trunk/blender/source/blender/ editors/screen/area.c: Bugfix, in 2.61.1
Ton Roosendaal
ton at blender.org
Wed Dec 19 17:16:22 CET 2012
Revision: 53185
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53185
Author: ton
Date: 2012-12-19 16:16:20 +0000 (Wed, 19 Dec 2012)
Log Message:
-----------
Bugfix, in 2.61.1
Overlapping regions now hide automatic when too little space is left.
Modified Paths:
--------------
trunk/blender/source/blender/editors/screen/area.c
Modified: trunk/blender/source/blender/editors/screen/area.c
===================================================================
--- trunk/blender/source/blender/editors/screen/area.c 2012-12-19 15:44:47 UTC (rev 53184)
+++ trunk/blender/source/blender/editors/screen/area.c 2012-12-19 16:16:20 UTC (rev 53185)
@@ -876,7 +876,7 @@
/* 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 @@
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 @@
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)) {
More information about the Bf-blender-cvs
mailing list