[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52980] trunk/blender/source/blender/ editors/screen/area.c: Bug fix, irc report:

Ton Roosendaal ton at blender.org
Thu Dec 13 18:43:13 CET 2012


Revision: 52980
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52980
Author:   ton
Date:     2012-12-13 17:43:12 +0000 (Thu, 13 Dec 2012)
Log Message:
-----------
Bug fix, irc report:

Overlapping regions, when you both want them on the same side they should not overlap
each other! (Try F5 on a region to flip position).

Code for subdivision is in need for some cleanup - a branching recursion is needed.

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-13 17:12:00 UTC (rev 52979)
+++ trunk/blender/source/blender/editors/screen/area.c	2012-12-13 17:43:12 UTC (rev 52980)
@@ -874,6 +874,36 @@
 
 /* *************************************************************** */
 
+/* ar should be overlapping */
+/* function checks if some overlapping region was defined before - on same place */
+static void region_overlap_fix(ARegion *ar)
+{
+	ARegion *ar1 = ar->prev;
+	
+	/* find overlapping previous region on same place */
+	while (ar1) {
+		if (ar1->overlap) {
+			if ((ar1->alignment & RGN_SPLIT_PREV)==0)
+				if (BLI_rcti_isect(&ar1->winrct, &ar->winrct, NULL))
+					break;
+		}
+		ar1 = ar1->prev;
+	}
+	
+	/* translate */
+	if (ar1) {
+		int align1 = ar1->alignment & ~RGN_SPLIT_PREV;
+
+		if (align1 == RGN_ALIGN_LEFT) {
+			BLI_rcti_translate(&ar->winrct, ar1->winx, 0);
+		}
+		else if (align1 == RGN_ALIGN_RIGHT) {
+			BLI_rcti_translate(&ar->winrct, -ar1->winx, 0);
+		}
+	}
+
+}
+
 /* overlapping regions only in the following restricted cases */
 static int region_is_overlap(wmWindow *win, ScrArea *sa, ARegion *ar)
 {
@@ -1061,6 +1091,10 @@
 	ar->winx = BLI_rcti_size_x(&ar->winrct) + 1;
 	ar->winy = BLI_rcti_size_y(&ar->winrct) + 1;
 	
+	/* exception for multiple aligned overlapping regions on same spot */
+	if (ar->overlap)
+		region_overlap_fix(ar);
+
 	/* set winrect for azones */
 	if (ar->flag & (RGN_FLAG_HIDDEN | RGN_FLAG_TOO_SMALL)) {
 		ar->winrct = *remainder;




More information about the Bf-blender-cvs mailing list