diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-12 12:31:23 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-12 12:31:23 +0400 |
commit | 993dfd7d2a2eb18949a6c7680e05a950e7a1e9c8 (patch) | |
tree | 7987ef9027f960a2885a9129071602325bcbef1c /source/blender/editors | |
parent | 92119982cb2073829560c54991179359f1c1fca1 (diff) |
add bli rect funcs BLI_rctf_init_minmax, BLI_rcti_init_minmax
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/screen/area.c | 28 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_utils.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_buttons.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_select.c | 6 |
5 files changed, 21 insertions, 21 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index a79d38d4081..714700ec8f1 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -607,7 +607,7 @@ static void area_azone_initialize(ScrArea *sa) az->y1 = sa->totrct.ymin - 1; az->x2 = sa->totrct.xmin + (AZONESPOT - 1); az->y2 = sa->totrct.ymin + (AZONESPOT - 1); - BLI_init_rcti(&az->rect, az->x1, az->x2, az->y1, az->y2); + BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2); az = (AZone *)MEM_callocN(sizeof(AZone), "actionzone"); BLI_addtail(&(sa->actionzones), az); @@ -616,7 +616,7 @@ static void area_azone_initialize(ScrArea *sa) az->y1 = sa->totrct.ymax + 1; az->x2 = sa->totrct.xmax - (AZONESPOT - 1); az->y2 = sa->totrct.ymax - (AZONESPOT - 1); - BLI_init_rcti(&az->rect, az->x1, az->x2, az->y1, az->y2); + BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2); } #define AZONEPAD_EDGE 4 @@ -650,7 +650,7 @@ static void region_azone_edge(AZone *az, ARegion *ar) break; } - BLI_init_rcti(&az->rect, az->x1, az->x2, az->y1, az->y2); + BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2); } static void region_azone_icon(ScrArea *sa, AZone *az, ARegion *ar) @@ -692,7 +692,7 @@ static void region_azone_icon(ScrArea *sa, AZone *az, ARegion *ar) break; } - BLI_init_rcti(&az->rect, az->x1, az->x2, az->y1, az->y2); + BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2); /* if more azones on 1 spot, set offset */ for (azt = sa->actionzones.first; azt; azt = azt->next) { @@ -706,7 +706,7 @@ static void region_azone_icon(ScrArea *sa, AZone *az, ARegion *ar) az->y1 -= AZONESPOT; az->y2 -= AZONESPOT; } - BLI_init_rcti(&az->rect, az->x1, az->x2, az->y1, az->y2); + BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2); } } } @@ -753,7 +753,7 @@ static void region_azone_tab_plus(ScrArea *sa, AZone *az, ARegion *ar) break; } /* rect needed for mouse pointer test */ - BLI_init_rcti(&az->rect, az->x1, az->x2, az->y1, az->y2); + BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2); } @@ -798,7 +798,7 @@ static void region_azone_tab(ScrArea *sa, AZone *az, ARegion *ar) break; } /* rect needed for mouse pointer test */ - BLI_init_rcti(&az->rect, az->x1, az->x2, az->y1, az->y2); + BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2); } #define AZONEPAD_TRIAW 16 @@ -843,7 +843,7 @@ static void region_azone_tria(ScrArea *sa, AZone *az, ARegion *ar) break; } /* rect needed for mouse pointer test */ - BLI_init_rcti(&az->rect, az->x1, az->x2, az->y1, az->y2); + BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2); } @@ -911,7 +911,7 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int return; /* no returns in function, winrct gets set in the end again */ - BLI_init_rcti(&ar->winrct, 0, 0, 0, 0); + BLI_rcti_init(&ar->winrct, 0, 0, 0, 0); /* for test; allow split of previously defined region */ if (ar->alignment & RGN_SPLIT_PREV) @@ -947,7 +947,7 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int else if (alignment == RGN_ALIGN_NONE) { /* typically last region */ ar->winrct = *remainder; - BLI_init_rcti(remainder, 0, 0, 0, 0); + BLI_rcti_init(remainder, 0, 0, 0, 0); } else if (alignment == RGN_ALIGN_TOP || alignment == RGN_ALIGN_BOTTOM) { @@ -1007,7 +1007,7 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int remainder->xmin = ar->winrct.xmax + 1; } else { - BLI_init_rcti(remainder, 0, 0, 0, 0); + BLI_rcti_init(remainder, 0, 0, 0, 0); } } else { @@ -1016,7 +1016,7 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int remainder->ymin = ar->winrct.ymax + 1; } else { - BLI_init_rcti(remainder, 0, 0, 0, 0); + BLI_rcti_init(remainder, 0, 0, 0, 0); } } } @@ -1036,7 +1036,7 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int if (count != 4) { /* let's stop adding regions */ - BLI_init_rcti(remainder, 0, 0, 0, 0); + BLI_rcti_init(remainder, 0, 0, 0, 0); if (G.debug & G_DEBUG) printf("region quadsplit failed\n"); } @@ -1058,7 +1058,7 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int else { /* right top */ ar->winrct.xmin = 1 + (remainder->xmin + remainder->xmax) / 2; ar->winrct.ymin = 1 + (remainder->ymin + remainder->ymax) / 2; - BLI_init_rcti(remainder, 0, 0, 0, 0); + BLI_rcti_init(remainder, 0, 0, 0, 0); } quad++; diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c index 082e40f8e4c..26c51596a5e 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -41,6 +41,7 @@ #include "BLI_math.h" #include "BLI_utildefines.h" +#include "BLI_rect.h" #include "BKE_brush.h" #include "BKE_context.h" @@ -80,8 +81,7 @@ int paint_convert_bb_to_rect(rcti *rect, float projection_mat[4][4]; int i, j, k; - rect->xmin = rect->ymin = INT_MAX; - rect->xmax = rect->ymax = INT_MIN; + BLI_rcti_init_minmax(rect); /* return zero if the bounding box has non-positive volume */ if (bb_min[0] > bb_max[0] || bb_min[1] > bb_max[1] || bb_min[2] > bb_max[2]) diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 2d778b94216..9591e624296 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -81,7 +81,7 @@ static FileSelection find_file_mouse_rect(SpaceFile *sfile, struct ARegion *ar, UI_view2d_region_to_view(v2d, rect->xmin, rect->ymin, &fxmin, &fymin); UI_view2d_region_to_view(v2d, rect->xmax, rect->ymax, &fxmax, &fymax); - BLI_init_rcti(&rect_view, (int)(v2d->tot.xmin + fxmin), (int)(v2d->tot.xmin + fxmax), (int)(v2d->tot.ymax - fymin), (int)(v2d->tot.ymax - fymax)); + BLI_rcti_init(&rect_view, (int)(v2d->tot.xmin + fxmin), (int)(v2d->tot.xmin + fxmax), (int)(v2d->tot.ymax - fymin), (int)(v2d->tot.ymax - fymax)); sel = ED_fileselect_layout_offset_rect(sfile->layout, &rect_view); diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index 116e155f501..99969405f9c 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -276,7 +276,7 @@ static void preview_cb(struct ScrArea *sa, struct uiBlock *block) /* while dragging we need to update the rects, otherwise it doesn't end with correct one */ - BLI_init_rctf(&dispf, 15.0f, (block->maxx - block->minx) - 15.0f, 15.0f, (block->maxy - block->miny) - 15.0f); + BLI_rctf_init(&dispf, 15.0f, (block->maxx - block->minx) - 15.0f, 15.0f, (block->maxy - block->miny) - 15.0f); ui_graphics_to_window_rct(sa->win, &dispf, disprect); /* correction for gla draw */ diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 43add69987b..39ec7514a88 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -1130,19 +1130,19 @@ static short mixed_bones_object_selectbuffer(ViewContext *vc, unsigned int *buff short a, hits15, hits9 = 0, hits5 = 0; short has_bones15 = 0, has_bones9 = 0, has_bones5 = 0; - BLI_init_rcti(&rect, mval[0] - 14, mval[0] + 14, mval[1] - 14, mval[1] + 14); + BLI_rcti_init(&rect, mval[0] - 14, mval[0] + 14, mval[1] - 14, mval[1] + 14); hits15 = view3d_opengl_select(vc, buffer, MAXPICKBUF, &rect); if (hits15 > 0) { for (a = 0; a < hits15; a++) if (buffer[4 * a + 3] & 0xFFFF0000) has_bones15 = 1; offs = 4 * hits15; - BLI_init_rcti(&rect, mval[0] - 9, mval[0] + 9, mval[1] - 9, mval[1] + 9); + BLI_rcti_init(&rect, mval[0] - 9, mval[0] + 9, mval[1] - 9, mval[1] + 9); hits9 = view3d_opengl_select(vc, buffer + offs, MAXPICKBUF - offs, &rect); if (hits9 > 0) { for (a = 0; a < hits9; a++) if (buffer[offs + 4 * a + 3] & 0xFFFF0000) has_bones9 = 1; offs += 4 * hits9; - BLI_init_rcti(&rect, mval[0] - 5, mval[0] + 5, mval[1] - 5, mval[1] + 5); + BLI_rcti_init(&rect, mval[0] - 5, mval[0] + 5, mval[1] - 5, mval[1] + 5); hits5 = view3d_opengl_select(vc, buffer + offs, MAXPICKBUF - offs, &rect); if (hits5 > 0) { for (a = 0; a < hits5; a++) if (buffer[offs + 4 * a + 3] & 0xFFFF0000) has_bones5 = 1; |