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
path: root/source
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2012-12-13 21:43:12 +0400
committerTon Roosendaal <ton@blender.org>2012-12-13 21:43:12 +0400
commitae2a9a6e7a5e8cf81bb2ffadde05f348ffcac8e1 (patch)
treeac61ff8da161479c6d306fe1ea858d2f3106d5bc /source
parent1d18a77019089d8201c1cffa75be8e24c2c03735 (diff)
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.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/screen/area.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index a0bcab118f5..db57aeb0167 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -874,6 +874,36 @@ 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)
+{
+ 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 @@ static void region_rect_recursive(wmWindow *win, ScrArea *sa, ARegion *ar, rcti
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;