diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-20 19:29:02 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-20 19:29:02 +0400 |
commit | 26f073b327ac31d683e1719ce8371b6e28bf01d6 (patch) | |
tree | fecb4fdc3f279436ab3814e60266633ba02de50a /source/blender/editors/screen | |
parent | 831eaf2d7feb63ee6df55a2b00e1d76f793c0a5c (diff) |
macros for rectangle center and size
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r-- | source/blender/editors/screen/area.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 6f5f5c7dfa3..2c32295fe36 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1010,7 +1010,7 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int if (alignment == RGN_ALIGN_HSPLIT) { if (rct_fits(remainder, 'h', prefsizex) > 4) { - ar->winrct.xmax = (remainder->xmin + remainder->xmax) / 2; + ar->winrct.xmax = BLI_RCT_CENTER_X(remainder); remainder->xmin = ar->winrct.xmax + 1; } else { @@ -1019,7 +1019,7 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int } else { if (rct_fits(remainder, 'v', prefsizey) > 4) { - ar->winrct.ymax = (remainder->ymin + remainder->ymax) / 2; + ar->winrct.ymax = BLI_RCT_CENTER_Y(remainder); remainder->ymin = ar->winrct.ymax + 1; } else { @@ -1051,20 +1051,20 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int } if (quad) { if (quad == 1) { /* left bottom */ - ar->winrct.xmax = (remainder->xmin + remainder->xmax) / 2; - ar->winrct.ymax = (remainder->ymin + remainder->ymax) / 2; + ar->winrct.xmax = BLI_RCT_CENTER_X(remainder); + ar->winrct.ymax = BLI_RCT_CENTER_Y(remainder); } else if (quad == 2) { /* left top */ - ar->winrct.xmax = (remainder->xmin + remainder->xmax) / 2; - ar->winrct.ymin = 1 + (remainder->ymin + remainder->ymax) / 2; + ar->winrct.xmax = BLI_RCT_CENTER_X(remainder); + ar->winrct.ymin = BLI_RCT_CENTER_Y(remainder) + 1; } else if (quad == 3) { /* right bottom */ - ar->winrct.xmin = 1 + (remainder->xmin + remainder->xmax) / 2; - ar->winrct.ymax = (remainder->ymin + remainder->ymax) / 2; + ar->winrct.xmin = BLI_RCT_CENTER_X(remainder) + 1; + ar->winrct.ymax = BLI_RCT_CENTER_Y(remainder); } else { /* right top */ - ar->winrct.xmin = 1 + (remainder->xmin + remainder->xmax) / 2; - ar->winrct.ymin = 1 + (remainder->ymin + remainder->ymax) / 2; + ar->winrct.xmin = BLI_RCT_CENTER_X(remainder) + 1; + ar->winrct.ymin = BLI_RCT_CENTER_Y(remainder) + 1; BLI_rcti_init(remainder, 0, 0, 0, 0); } |