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:
authorCampbell Barton <ideasman42@gmail.com>2019-05-03 06:04:37 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-05-03 06:04:37 +0300
commit70682d11b8a8b3bca327a309f2e1e8383b920387 (patch)
tree3de183e21e545da5df17e6afe0edf2561db0319b /source/blender/editors/screen
parenta01bcfa6366f893fbc8fdbf537d91ece4832ea03 (diff)
Cleanup: replace RGN_ALIGN_ENUM_MASK
This was only used once, other checks were masking out RGN_SPLIT_PREV which isn't future proof (if other flags are added). Add RGN_ALIGN_ENUM_FROM_MASK macro, use it everywhere we need to check the alignment enum.
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r--source/blender/editors/screen/area.c8
-rw-r--r--source/blender/editors/screen/screen_ops.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 38684afec39..9a74ffc38d9 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -1110,7 +1110,7 @@ static int rct_fits(const rcti *rect, char dir, int size)
static void region_overlap_fix(ScrArea *sa, ARegion *ar)
{
ARegion *ar1;
- const int align = ar->alignment & ~RGN_SPLIT_PREV;
+ const int align = RGN_ALIGN_ENUM_FROM_MASK(ar->alignment);
int align1 = 0;
/* find overlapping previous region on same place */
@@ -1227,7 +1227,7 @@ static void region_rect_recursive(
}
}
- int alignment = ar->alignment & ~RGN_SPLIT_PREV;
+ int alignment = RGN_ALIGN_ENUM_FROM_MASK(ar->alignment);
/* set here, assuming userpref switching forces to call this again */
ar->overlap = ED_region_is_overlap(sa->spacetype, ar->regiontype);
@@ -1690,7 +1690,7 @@ void ED_area_update_region_sizes(wmWindowManager *wm, wmWindow *win, ScrArea *ar
}
/* Some AZones use View2D data which is only updated in region init, so call that first! */
- region_azones_add(screen, area, ar, ar->alignment & ~RGN_SPLIT_PREV);
+ region_azones_add(screen, area, ar, RGN_ALIGN_ENUM_FROM_MASK(ar->alignment));
}
ED_area_azones_update(area, &win->eventstate->x);
@@ -1761,7 +1761,7 @@ void ED_area_initialize(wmWindowManager *wm, wmWindow *win, ScrArea *sa)
}
/* Some AZones use View2D data which is only updated in region init, so call that first! */
- region_azones_add(screen, sa, ar, ar->alignment & ~RGN_SPLIT_PREV);
+ region_azones_add(screen, sa, ar, RGN_ALIGN_ENUM_FROM_MASK(ar->alignment));
}
/* Avoid re-initializing tools while resizing the window. */
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 9f452dd79e0..a87660d2cb7 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -2431,7 +2431,7 @@ static int area_max_regionsize(ScrArea *sa, ARegion *scalear, AZEdge edge)
/* regions in regions. */
if (scalear->alignment & RGN_SPLIT_PREV) {
- const int align = scalear->alignment & RGN_ALIGN_ENUM_MASK;
+ const int align = RGN_ALIGN_ENUM_FROM_MASK(scalear->alignment);
if (ELEM(align, RGN_ALIGN_TOP, RGN_ALIGN_BOTTOM)) {
ARegion *ar = scalear->prev;