code cleanup: rename BLI_in_rctf() --> BLI_rctf_isect_pt(), to conform with our naming convention.

This commit is contained in:
Campbell Barton 2012-08-23 18:25:45 +00:00
parent dfbc793d88
commit 56b28635e7
28 changed files with 99 additions and 99 deletions

@ -437,13 +437,13 @@ int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)
y2 = y + g->pos_y - g->height; y2 = y + g->pos_y - g->height;
if (font->flags & BLF_CLIPPING) { if (font->flags & BLF_CLIPPING) {
if (!BLI_in_rctf(&font->clip_rec, dx + font->pos[0], y1 + font->pos[1])) if (!BLI_rctf_isect_pt(&font->clip_rec, dx + font->pos[0], y1 + font->pos[1]))
return 0; return 0;
if (!BLI_in_rctf(&font->clip_rec, dx + font->pos[0], y2 + font->pos[1])) if (!BLI_rctf_isect_pt(&font->clip_rec, dx + font->pos[0], y2 + font->pos[1]))
return 0; return 0;
if (!BLI_in_rctf(&font->clip_rec, dx1 + font->pos[0], y2 + font->pos[1])) if (!BLI_rctf_isect_pt(&font->clip_rec, dx1 + font->pos[0], y2 + font->pos[1]))
return 0; return 0;
if (!BLI_in_rctf(&font->clip_rec, dx1 + font->pos[0], y1 + font->pos[1])) if (!BLI_rctf_isect_pt(&font->clip_rec, dx1 + font->pos[0], y1 + font->pos[1]))
return 0; return 0;
} }

@ -1196,7 +1196,7 @@ static float maskrasterize_layer_isect(unsigned int *face, float (*cos)[3], cons
BLI_INLINE unsigned int layer_bucket_index_from_xy(MaskRasterLayer *layer, const float xy[2]) BLI_INLINE unsigned int layer_bucket_index_from_xy(MaskRasterLayer *layer, const float xy[2])
{ {
BLI_assert(BLI_in_rctf_v(&layer->bounds, xy)); BLI_assert(BLI_rctf_isect_pt_v(&layer->bounds, xy));
return ( (unsigned int)((xy[0] - layer->bounds.xmin) * layer->buckets_xy_scalar[0])) + return ( (unsigned int)((xy[0] - layer->bounds.xmin) * layer->buckets_xy_scalar[0])) +
(((unsigned int)((xy[1] - layer->bounds.ymin) * layer->buckets_xy_scalar[1])) * layer->buckets_x); (((unsigned int)((xy[1] - layer->bounds.ymin) * layer->buckets_xy_scalar[1])) * layer->buckets_x);
@ -1233,7 +1233,7 @@ static float layer_bucket_depth_from_xy(MaskRasterLayer *layer, const float xy[2
float BKE_maskrasterize_handle_sample(MaskRasterHandle *mr_handle, const float xy[2]) float BKE_maskrasterize_handle_sample(MaskRasterHandle *mr_handle, const float xy[2])
{ {
/* can't do this because some layers may invert */ /* can't do this because some layers may invert */
/* if (BLI_in_rctf_v(&mr_handle->bounds, xy)) */ /* if (BLI_rctf_isect_pt_v(&mr_handle->bounds, xy)) */
const unsigned int layers_tot = mr_handle->layers_tot; const unsigned int layers_tot = mr_handle->layers_tot;
unsigned int i; unsigned int i;
@ -1246,7 +1246,7 @@ float BKE_maskrasterize_handle_sample(MaskRasterHandle *mr_handle, const float x
float value_layer; float value_layer;
/* also used as signal for unused layer (when render is disabled) */ /* also used as signal for unused layer (when render is disabled) */
if (layer->alpha != 0.0f && BLI_in_rctf_v(&layer->bounds, xy)) { if (layer->alpha != 0.0f && BLI_rctf_isect_pt_v(&layer->bounds, xy)) {
value_layer = 1.0f - layer_bucket_depth_from_xy(layer, xy); value_layer = 1.0f - layer_bucket_depth_from_xy(layer, xy);
switch (layer->falloff) { switch (layer->falloff) {

@ -57,16 +57,16 @@ void BLI_rctf_interp(struct rctf *rect, const struct rctf *rect_a, const struct
//void BLI_rcti_interp(struct rctf *rect, struct rctf *rect_a, struct rctf *rect_b, float fac); //void BLI_rcti_interp(struct rctf *rect, struct rctf *rect_a, struct rctf *rect_b, float fac);
int BLI_rctf_compare(const struct rctf *rect_a, const struct rctf *rect_b, const float limit); int BLI_rctf_compare(const struct rctf *rect_a, const struct rctf *rect_b, const float limit);
int BLI_rcti_compare(const struct rcti *rect_a, const struct rcti *rect_b); int BLI_rcti_compare(const struct rcti *rect_a, const struct rcti *rect_b);
int BLI_in_rcti(const struct rcti *rect, const int x, const int y); int BLI_rctf_isect(const struct rctf *src1, const struct rctf *src2, struct rctf *dest);
int BLI_in_rcti_v(const struct rcti *rect, const int xy[2]); int BLI_rcti_isect(const struct rcti *src1, const struct rcti *src2, struct rcti *dest);
int BLI_in_rctf(const struct rctf *rect, const float x, const float y); int BLI_rcti_isect_pt(const struct rcti *rect, const int x, const int y);
int BLI_in_rctf_v(const struct rctf *rect, const float xy[2]); int BLI_rcti_isect_pt_v(const struct rcti *rect, const int xy[2]);
int BLI_rctf_isect_pt(const struct rctf *rect, const float x, const float y);
int BLI_rctf_isect_pt_v(const struct rctf *rect, const float xy[2]);
int BLI_rcti_isect_segment(const struct rcti *rect, const int s1[2], const int s2[2]); int BLI_rcti_isect_segment(const struct rcti *rect, const int s1[2], const int s2[2]);
#if 0 /* NOT NEEDED YET */ #if 0 /* NOT NEEDED YET */
int BLI_rctf_isect_segment(struct rcti *rect, int s1[2], int s2[2]); int BLI_rctf_isect_segment(struct rcti *rect, int s1[2], int s2[2]);
#endif #endif
int BLI_rctf_isect(const struct rctf *src1, const struct rctf *src2, struct rctf *dest);
int BLI_rcti_isect(const struct rcti *src1, const struct rcti *src2, struct rcti *dest);
void BLI_rctf_union(struct rctf *rctf1, const struct rctf *rctf2); void BLI_rctf_union(struct rctf *rctf1, const struct rctf *rctf2);
void BLI_rcti_union(struct rcti *rcti1, const struct rcti *rcti2); void BLI_rcti_union(struct rcti *rcti1, const struct rcti *rcti2);
void BLI_rcti_rctf_copy(struct rcti *dst, const struct rctf *src); void BLI_rcti_rctf_copy(struct rcti *dst, const struct rctf *src);
@ -88,4 +88,4 @@ void print_rcti(const char *str, const struct rcti *rect);
} }
#endif #endif
#endif #endif /* __BLI_RECT_H__ */

@ -58,7 +58,7 @@ int BLI_rctf_is_empty(const rctf *rect)
return ((rect->xmax <= rect->xmin) || (rect->ymax <= rect->ymin)); return ((rect->xmax <= rect->xmin) || (rect->ymax <= rect->ymin));
} }
int BLI_in_rcti(const rcti *rect, const int x, const int y) int BLI_rcti_isect_pt(const rcti *rect, const int x, const int y)
{ {
if (x < rect->xmin) return 0; if (x < rect->xmin) return 0;
if (x > rect->xmax) return 0; if (x > rect->xmax) return 0;
@ -74,7 +74,7 @@ int BLI_in_rcti(const rcti *rect, const int x, const int y)
* *
* \return True if \a rect is empty. * \return True if \a rect is empty.
*/ */
int BLI_in_rcti_v(const rcti *rect, const int xy[2]) int BLI_rcti_isect_pt_v(const rcti *rect, const int xy[2])
{ {
if (xy[0] < rect->xmin) return 0; if (xy[0] < rect->xmin) return 0;
if (xy[0] > rect->xmax) return 0; if (xy[0] > rect->xmax) return 0;
@ -83,7 +83,7 @@ int BLI_in_rcti_v(const rcti *rect, const int xy[2])
return 1; return 1;
} }
int BLI_in_rctf(const rctf *rect, const float x, const float y) int BLI_rctf_isect_pt(const rctf *rect, const float x, const float y)
{ {
if (x < rect->xmin) return 0; if (x < rect->xmin) return 0;
if (x > rect->xmax) return 0; if (x > rect->xmax) return 0;
@ -92,7 +92,7 @@ int BLI_in_rctf(const rctf *rect, const float x, const float y)
return 1; return 1;
} }
int BLI_in_rctf_v(const rctf *rect, const float xy[2]) int BLI_rctf_isect_pt_v(const rctf *rect, const float xy[2])
{ {
if (xy[0] < rect->xmin) return 0; if (xy[0] < rect->xmin) return 0;
if (xy[0] > rect->xmax) return 0; if (xy[0] > rect->xmax) return 0;
@ -124,7 +124,7 @@ int BLI_rcti_isect_segment(const rcti *rect, const int s1[2], const int s2[2])
if (s1[1] > rect->ymax && s2[1] > rect->ymax) return 0; if (s1[1] > rect->ymax && s2[1] > rect->ymax) return 0;
/* if either points intersect then we definetly intersect */ /* if either points intersect then we definetly intersect */
if (BLI_in_rcti_v(rect, s1) || BLI_in_rcti_v(rect, s2)) { if (BLI_rcti_isect_pt_v(rect, s1) || BLI_rcti_isect_pt_v(rect, s2)) {
return 1; return 1;
} }
else { else {

@ -505,7 +505,7 @@ static short ok_bezier_region(KeyframeEditData *ked, BezTriple *bezt)
if (ked->data) { if (ked->data) {
short ok = 0; short ok = 0;
#define KEY_CHECK_OK(_index) BLI_in_rctf_v(ked->data, bezt->vec[_index]) #define KEY_CHECK_OK(_index) BLI_rctf_isect_pt_v(ked->data, bezt->vec[_index])
KEYFRAME_OK_CHECKS(KEY_CHECK_OK); KEYFRAME_OK_CHECKS(KEY_CHECK_OK);
#undef KEY_CHECK_OK #undef KEY_CHECK_OK

@ -825,7 +825,7 @@ static void gp_stroke_eraser_dostroke(tGPsdata *p, int mval[], int mvalo[], shor
} }
/* do boundbox check first */ /* do boundbox check first */
if (BLI_in_rcti(rect, x0, y0)) { if (BLI_rcti_isect_pt(rect, x0, y0)) {
/* only check if point is inside */ /* only check if point is inside */
if ( ((x0 - mval[0]) * (x0 - mval[0]) + (y0 - mval[1]) * (y0 - mval[1])) <= rad * rad) { if ( ((x0 - mval[0]) * (x0 - mval[0]) + (y0 - mval[1]) * (y0 - mval[1])) <= rad * rad) {
/* free stroke */ /* free stroke */
@ -874,7 +874,7 @@ static void gp_stroke_eraser_dostroke(tGPsdata *p, int mval[], int mvalo[], shor
} }
/* check that point segment of the boundbox of the eraser stroke */ /* check that point segment of the boundbox of the eraser stroke */
if (BLI_in_rcti(rect, x0, y0) || BLI_in_rcti(rect, x1, y1)) { if (BLI_rcti_isect_pt(rect, x0, y0) || BLI_rcti_isect_pt(rect, x1, y1)) {
/* check if point segment of stroke had anything to do with /* check if point segment of stroke had anything to do with
* eraser region (either within stroke painted, or on its lines) * eraser region (either within stroke painted, or on its lines)
* - this assumes that linewidth is irrelevant * - this assumes that linewidth is irrelevant

@ -120,8 +120,8 @@ enum {
/* Macros: */ /* Macros: */
/* test if mouse in a scrollbar (assume that scroller availability has been tested) */ /* test if mouse in a scrollbar (assume that scroller availability has been tested) */
#define IN_2D_VERT_SCROLL(v2d, co) (BLI_in_rcti_v(&v2d->vert, co)) #define IN_2D_VERT_SCROLL(v2d, co) (BLI_rcti_isect_pt_v(&v2d->vert, co))
#define IN_2D_HORIZ_SCROLL(v2d, co) (BLI_in_rcti_v(&v2d->hor, co)) #define IN_2D_HORIZ_SCROLL(v2d, co) (BLI_rcti_isect_pt_v(&v2d->hor, co))
/* ------------------------------------------ */ /* ------------------------------------------ */
/* Type definitions: */ /* Type definitions: */

@ -698,7 +698,7 @@ static int ui_but_mouse_inside_icon(uiBut *but, ARegion *ar, wmEvent *event)
rect.xmax -= delta / 2; rect.xmax -= delta / 2;
} }
return BLI_in_rcti(&rect, x, y); return BLI_rcti_isect_pt(&rect, x, y);
} }
static int ui_but_start_drag(bContext *C, uiBut *but, uiHandleButtonData *data, wmEvent *event) static int ui_but_start_drag(bContext *C, uiBut *but, uiHandleButtonData *data, wmEvent *event)
@ -4918,7 +4918,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event)
static int ui_but_contains_pt(uiBut *but, int mx, int my) static int ui_but_contains_pt(uiBut *but, int mx, int my)
{ {
return BLI_in_rctf(&but->rect, mx, my); return BLI_rctf_isect_pt(&but->rect, mx, my);
} }
static uiBut *ui_but_find_activated(ARegion *ar) static uiBut *ui_but_find_activated(ARegion *ar)
@ -4994,7 +4994,7 @@ static int ui_mouse_inside_region(ARegion *ar, int x, int y)
uiBlock *block; uiBlock *block;
/* check if the mouse is in the region */ /* check if the mouse is in the region */
if (!BLI_in_rcti(&ar->winrct, x, y)) { if (!BLI_rcti_isect_pt(&ar->winrct, x, y)) {
for (block = ar->uiblocks.first; block; block = block->next) for (block = ar->uiblocks.first; block; block = block->next)
block->auto_open = FALSE; block->auto_open = FALSE;
@ -5033,7 +5033,7 @@ static int ui_mouse_inside_region(ARegion *ar, int x, int y)
} }
/* check if in the rect */ /* check if in the rect */
if (!BLI_in_rcti(&mask_rct, mx, my)) if (!BLI_rcti_isect_pt(&mask_rct, mx, my))
return 0; return 0;
} }
@ -5086,7 +5086,7 @@ static uiBut *ui_but_find_mouse_over(ARegion *ar, int x, int y)
/* CLIP_EVENTS prevents the event from reaching other blocks */ /* CLIP_EVENTS prevents the event from reaching other blocks */
if (block->flag & UI_BLOCK_CLIP_EVENTS) { if (block->flag & UI_BLOCK_CLIP_EVENTS) {
/* check if mouse is inside block */ /* check if mouse is inside block */
if (BLI_in_rctf(&block->rect, mx, my)) { if (BLI_rctf_isect_pt(&block->rect, mx, my)) {
break; break;
} }
} }
@ -6100,7 +6100,7 @@ static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle
ui_window_to_block(ar, block, &mx, &my); ui_window_to_block(ar, block, &mx, &my);
/* check if mouse is inside block */ /* check if mouse is inside block */
inside = BLI_in_rctf(&block->rect, mx, my); inside = BLI_rctf_isect_pt(&block->rect, mx, my);
/* if there's an active modal button, don't check events or outside, except for search menu */ /* if there's an active modal button, don't check events or outside, except for search menu */
but = ui_but_find_activated(ar); but = ui_but_find_activated(ar);
@ -6349,7 +6349,7 @@ static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle
uiSafetyRct *saferct = block->saferct.first; uiSafetyRct *saferct = block->saferct.first;
if (ELEM3(event->type, LEFTMOUSE, MIDDLEMOUSE, RIGHTMOUSE) && event->val == KM_PRESS) { if (ELEM3(event->type, LEFTMOUSE, MIDDLEMOUSE, RIGHTMOUSE) && event->val == KM_PRESS) {
if (saferct && !BLI_in_rctf(&saferct->parent, event->x, event->y)) { if (saferct && !BLI_rctf_isect_pt(&saferct->parent, event->x, event->y)) {
if (block->flag & (UI_BLOCK_OUT_1)) if (block->flag & (UI_BLOCK_OUT_1))
menu->menuretval = UI_RETURN_OK; menu->menuretval = UI_RETURN_OK;
else else
@ -6382,9 +6382,9 @@ static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle
* events we check all preceding block rects too to make * events we check all preceding block rects too to make
* arrow keys navigation work */ * arrow keys navigation work */
if (event->type != MOUSEMOVE || saferct == block->saferct.first) { if (event->type != MOUSEMOVE || saferct == block->saferct.first) {
if (BLI_in_rctf(&saferct->parent, (float)event->x, (float)event->y)) if (BLI_rctf_isect_pt(&saferct->parent, (float)event->x, (float)event->y))
break; break;
if (BLI_in_rctf(&saferct->safety, (float)event->x, (float)event->y)) if (BLI_rctf_isect_pt(&saferct->safety, (float)event->x, (float)event->y))
break; break;
} }
} }

@ -140,10 +140,10 @@ static void eyedropper_color_sample_fl(bContext *C, Eyedropper *UNUSED(eye), int
wmWindow *win = CTX_wm_window(C); wmWindow *win = CTX_wm_window(C);
ScrArea *sa; ScrArea *sa;
for (sa = win->screen->areabase.first; sa; sa = sa->next) { for (sa = win->screen->areabase.first; sa; sa = sa->next) {
if (BLI_in_rcti(&sa->totrct, mx, my)) { if (BLI_rcti_isect_pt(&sa->totrct, mx, my)) {
if (sa->spacetype == SPACE_IMAGE) { if (sa->spacetype == SPACE_IMAGE) {
ARegion *ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); ARegion *ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
if (BLI_in_rcti(&ar->winrct, mx, my)) { if (BLI_rcti_isect_pt(&ar->winrct, mx, my)) {
SpaceImage *sima = sa->spacedata.first; SpaceImage *sima = sa->spacedata.first;
int mval[2] = {mx - ar->winrct.xmin, int mval[2] = {mx - ar->winrct.xmin,
my - ar->winrct.ymin}; my - ar->winrct.ymin};
@ -155,7 +155,7 @@ static void eyedropper_color_sample_fl(bContext *C, Eyedropper *UNUSED(eye), int
} }
else if (sa->spacetype == SPACE_NODE) { else if (sa->spacetype == SPACE_NODE) {
ARegion *ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); ARegion *ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
if (BLI_in_rcti(&ar->winrct, mx, my)) { if (BLI_rcti_isect_pt(&ar->winrct, mx, my)) {
SpaceNode *snode = sa->spacedata.first; SpaceNode *snode = sa->spacedata.first;
int mval[2] = {mx - ar->winrct.xmin, int mval[2] = {mx - ar->winrct.xmin,
my - ar->winrct.ymin}; my - ar->winrct.ymin};
@ -167,7 +167,7 @@ static void eyedropper_color_sample_fl(bContext *C, Eyedropper *UNUSED(eye), int
} }
else if (sa->spacetype == SPACE_CLIP) { else if (sa->spacetype == SPACE_CLIP) {
ARegion *ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); ARegion *ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
if (BLI_in_rcti(&ar->winrct, mx, my)) { if (BLI_rcti_isect_pt(&ar->winrct, mx, my)) {
SpaceClip *sc = sa->spacedata.first; SpaceClip *sc = sa->spacedata.first;
int mval[2] = {mx - ar->winrct.xmin, int mval[2] = {mx - ar->winrct.xmin,
my - ar->winrct.ymin}; my - ar->winrct.ymin};

@ -979,7 +979,7 @@ static void ui_do_drag(const bContext *C, wmEvent *event, Panel *panel)
short align = panel_aligned(sa, ar), dx = 0, dy = 0; short align = panel_aligned(sa, ar), dx = 0, dy = 0;
/* first clip for window, no dragging outside */ /* first clip for window, no dragging outside */
if (!BLI_in_rcti_v(&ar->winrct, &event->x)) if (!BLI_rcti_isect_pt_v(&ar->winrct, &event->x))
return; return;
dx = (event->x - data->startx) & ~(PNL_GRID - 1); dx = (event->x - data->startx) & ~(PNL_GRID - 1);

@ -899,7 +899,7 @@ int ui_searchbox_inside(ARegion *ar, int x, int y)
{ {
uiSearchboxData *data = ar->regiondata; uiSearchboxData *data = ar->regiondata;
return(BLI_in_rcti(&data->bbox, x - ar->winrct.xmin, y - ar->winrct.ymin)); return(BLI_rcti_isect_pt(&data->bbox, x - ar->winrct.xmin, y - ar->winrct.ymin));
} }
/* string validated to be of correct length (but->hardmax) */ /* string validated to be of correct length (but->hardmax) */
@ -935,13 +935,13 @@ void ui_searchbox_event(bContext *C, ARegion *ar, uiBut *but, wmEvent *event)
ui_searchbox_select(C, ar, but, 1); ui_searchbox_select(C, ar, but, 1);
break; break;
case MOUSEMOVE: case MOUSEMOVE:
if (BLI_in_rcti(&ar->winrct, event->x, event->y)) { if (BLI_rcti_isect_pt(&ar->winrct, event->x, event->y)) {
rcti rect; rcti rect;
int a; int a;
for (a = 0; a < data->items.totitem; a++) { for (a = 0; a < data->items.totitem; a++) {
ui_searchbox_butrect(&rect, data, a); ui_searchbox_butrect(&rect, data, a);
if (BLI_in_rcti(&rect, event->x - ar->winrct.xmin, event->y - ar->winrct.ymin)) { if (BLI_rcti_isect_pt(&rect, event->x - ar->winrct.xmin, event->y - ar->winrct.ymin)) {
if (data->active != a + 1) { if (data->active != a + 1) {
data->active = a + 1; data->active = a + 1;
ui_searchbox_select(C, ar, but, 0); ui_searchbox_select(C, ar, but, 0);

@ -440,7 +440,7 @@ static int border_select_exec(bContext *C, wmOperator *op)
/* TODO: handles? */ /* TODO: handles? */
/* TODO: uw? */ /* TODO: uw? */
if (BLI_in_rctf_v(&rectf, point_deform->bezt.vec[1])) { if (BLI_rctf_isect_pt_v(&rectf, point_deform->bezt.vec[1])) {
BKE_mask_point_select_set(point, mode == GESTURE_MODAL_SELECT); BKE_mask_point_select_set(point, mode == GESTURE_MODAL_SELECT);
BKE_mask_point_select_set_handle(point, mode == GESTURE_MODAL_SELECT); BKE_mask_point_select_set_handle(point, mode == GESTURE_MODAL_SELECT);
} }
@ -525,7 +525,7 @@ static int do_lasso_select_mask(bContext *C, int mcords[][2], short moves, short
point_deform->bezt.vec[1][0], point_deform->bezt.vec[1][1], point_deform->bezt.vec[1][0], point_deform->bezt.vec[1][1],
&screen_co[0], &screen_co[1]); &screen_co[0], &screen_co[1]);
if (BLI_in_rcti(&rect, screen_co[0], screen_co[1]) && if (BLI_rcti_isect_pt(&rect, screen_co[0], screen_co[1]) &&
BLI_lasso_is_point_inside(mcords, moves, screen_co[0], screen_co[1], INT_MAX)) BLI_lasso_is_point_inside(mcords, moves, screen_co[0], screen_co[1], INT_MAX))
{ {
BKE_mask_point_select_set(point, select); BKE_mask_point_select_set(point, select);

@ -161,7 +161,7 @@ void ED_area_overdraw_flush(ScrArea *sa, ARegion *ar)
ys = (az->y1 + az->y2) / 2; ys = (az->y1 + az->y2) / 2;
/* test if inside */ /* test if inside */
if (BLI_in_rcti(&ar->winrct, xs, ys)) { if (BLI_rcti_isect_pt(&ar->winrct, xs, ys)) {
az->do_draw = TRUE; az->do_draw = TRUE;
} }
} }

@ -1267,7 +1267,7 @@ void ED_screen_set_subwinactive(bContext *C, wmEvent *event)
} }
if (sa) { if (sa) {
for (ar = sa->regionbase.first; ar; ar = ar->next) { for (ar = sa->regionbase.first; ar; ar = ar->next) {
if (BLI_in_rcti_v(&ar->winrct, &event->x)) if (BLI_rcti_isect_pt_v(&ar->winrct, &event->x))
scr->subwinactive = ar->swinid; scr->subwinactive = ar->swinid;
} }
} }

@ -521,7 +521,7 @@ static ScrArea *screen_areahascursor(bScreen *scr, int x, int y)
ScrArea *sa = NULL; ScrArea *sa = NULL;
sa = scr->areabase.first; sa = scr->areabase.first;
while (sa) { while (sa) {
if (BLI_in_rcti(&sa->totrct, x, y)) break; if (BLI_rcti_isect_pt(&sa->totrct, x, y)) break;
sa = sa->next; sa = sa->next;
} }
@ -540,7 +540,7 @@ static int actionzone_area_poll(bContext *C)
int y = win->eventstate->y; int y = win->eventstate->y;
for (az = sa->actionzones.first; az; az = az->next) for (az = sa->actionzones.first; az; az = az->next)
if (BLI_in_rcti(&az->rect, x, y)) if (BLI_rcti_isect_pt(&az->rect, x, y))
return 1; return 1;
} }
return 0; return 0;
@ -551,7 +551,7 @@ AZone *is_in_area_actionzone(ScrArea *sa, const int xy[2])
AZone *az = NULL; AZone *az = NULL;
for (az = sa->actionzones.first; az; az = az->next) { for (az = sa->actionzones.first; az; az = az->next) {
if (BLI_in_rcti_v(&az->rect, xy)) { if (BLI_rcti_isect_pt_v(&az->rect, xy)) {
if (az->type == AZONE_AREA) { if (az->type == AZONE_AREA) {
/* no triangle intersect but a hotspot circle based on corner */ /* no triangle intersect but a hotspot circle based on corner */
int radius = (xy[0] - az->x1) * (xy[0] - az->x1) + (xy[1] - az->y1) * (xy[1] - az->y1); int radius = (xy[0] - az->x1) * (xy[0] - az->x1) + (xy[1] - az->y1) * (xy[1] - az->y1);

@ -1615,7 +1615,7 @@ static int line_clip_rect2f(
if (fabsf(l1[0] - l2[0]) < PROJ_GEOM_TOLERANCE) { /* this is a single point (or close to)*/ if (fabsf(l1[0] - l2[0]) < PROJ_GEOM_TOLERANCE) { /* this is a single point (or close to)*/
if (BLI_in_rctf_v(rect, l1)) { if (BLI_rctf_isect_pt_v(rect, l1)) {
copy_v2_v2(l1_clip, l1); copy_v2_v2(l1_clip, l1);
copy_v2_v2(l2_clip, l2); copy_v2_v2(l2_clip, l2);
return 1; return 1;
@ -1643,7 +1643,7 @@ static int line_clip_rect2f(
} }
if (fabsf(l1[1] - l2[1]) < PROJ_GEOM_TOLERANCE) { /* this is a single point (or close to)*/ if (fabsf(l1[1] - l2[1]) < PROJ_GEOM_TOLERANCE) { /* this is a single point (or close to)*/
if (BLI_in_rctf_v(rect, l1)) { if (BLI_rctf_isect_pt_v(rect, l1)) {
copy_v2_v2(l1_clip, l1); copy_v2_v2(l1_clip, l1);
copy_v2_v2(l2_clip, l2); copy_v2_v2(l2_clip, l2);
return 1; return 1;
@ -1667,12 +1667,12 @@ static int line_clip_rect2f(
/* Done with vertical lines */ /* Done with vertical lines */
/* are either of the points inside the rectangle ? */ /* are either of the points inside the rectangle ? */
if (BLI_in_rctf_v(rect, l1)) { if (BLI_rctf_isect_pt_v(rect, l1)) {
copy_v2_v2(l1_clip, l1); copy_v2_v2(l1_clip, l1);
ok1 = 1; ok1 = 1;
} }
if (BLI_in_rctf_v(rect, l2)) { if (BLI_rctf_isect_pt_v(rect, l2)) {
copy_v2_v2(l2_clip, l2); copy_v2_v2(l2_clip, l2);
ok2 = 1; ok2 = 1;
} }
@ -1820,7 +1820,7 @@ static int project_bucket_isect_circle(const float cent[2], const float radius_s
* this is even less work then an intersection test * this is even less work then an intersection test
*/ */
#if 0 #if 0
if (BLI_in_rctf_v(bucket_bounds, cent)) if (BLI_rctf_isect_pt_v(bucket_bounds, cent))
return 1; return 1;
#endif #endif
@ -1987,9 +1987,9 @@ static void project_bucket_clip_face(
float bucket_bounds_ss[4][2]; float bucket_bounds_ss[4][2];
/* get the UV space bounding box */ /* get the UV space bounding box */
inside_bucket_flag |= BLI_in_rctf_v(bucket_bounds, v1coSS); inside_bucket_flag |= BLI_rctf_isect_pt_v(bucket_bounds, v1coSS);
inside_bucket_flag |= BLI_in_rctf_v(bucket_bounds, v2coSS) << 1; inside_bucket_flag |= BLI_rctf_isect_pt_v(bucket_bounds, v2coSS) << 1;
inside_bucket_flag |= BLI_in_rctf_v(bucket_bounds, v3coSS) << 2; inside_bucket_flag |= BLI_rctf_isect_pt_v(bucket_bounds, v3coSS) << 2;
if (inside_bucket_flag == ISECT_ALL3) { if (inside_bucket_flag == ISECT_ALL3) {
/* all screenspace points are inside the bucket bounding box, this means we don't need to clip and can simply return the UVs */ /* all screenspace points are inside the bucket bounding box, this means we don't need to clip and can simply return the UVs */
@ -2816,7 +2816,7 @@ static int project_bucket_face_isect(ProjPaintState *ps, int bucket_x, int bucke
fidx = mf->v4 ? 3 : 2; fidx = mf->v4 ? 3 : 2;
do { do {
v = ps->screenCoords[(*(&mf->v1 + fidx))]; v = ps->screenCoords[(*(&mf->v1 + fidx))];
if (BLI_in_rctf_v(&bucket_bounds, v)) { if (BLI_rctf_isect_pt_v(&bucket_bounds, v)) {
return 1; return 1;
} }
} while (fidx--); } while (fidx--);

@ -321,7 +321,7 @@ static void border_select_cb(void *userdata, MovieTrackingTrack *UNUSED(track),
{ {
BorderSelectuserData *data = (BorderSelectuserData *) userdata; BorderSelectuserData *data = (BorderSelectuserData *) userdata;
if (BLI_in_rctf(&data->rect, scene_framenr, val)) { if (BLI_rctf_isect_pt(&data->rect, scene_framenr, val)) {
int flag = 0; int flag = 0;
if (coord == 0) if (coord == 0)

@ -363,7 +363,7 @@ static int border_select_exec(bContext *C, wmOperator *op)
MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr); MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr);
if (MARKER_VISIBLE(sc, track, marker)) { if (MARKER_VISIBLE(sc, track, marker)) {
if (BLI_in_rctf_v(&rectf, marker->pos)) { if (BLI_rctf_isect_pt_v(&rectf, marker->pos)) {
if (mode == GESTURE_MODAL_SELECT) if (mode == GESTURE_MODAL_SELECT)
BKE_tracking_track_flag_set(track, TRACK_AREA_ALL, SELECT); BKE_tracking_track_flag_set(track, TRACK_AREA_ALL, SELECT);
else else
@ -441,7 +441,7 @@ static int do_lasso_select_marker(bContext *C, int mcords[][2], short moves, sho
/* marker in screen coords */ /* marker in screen coords */
ED_clip_point_stable_pos__reverse(sc, ar, marker->pos, screen_co); ED_clip_point_stable_pos__reverse(sc, ar, marker->pos, screen_co);
if (BLI_in_rcti(&rect, screen_co[0], screen_co[1]) && if (BLI_rcti_isect_pt(&rect, screen_co[0], screen_co[1]) &&
BLI_lasso_is_point_inside(mcords, moves, screen_co[0], screen_co[1], V2D_IS_CLIPPED)) BLI_lasso_is_point_inside(mcords, moves, screen_co[0], screen_co[1], V2D_IS_CLIPPED))
{ {
if (select) if (select)

@ -327,7 +327,7 @@ static int file_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
rect.xmin = rect.xmax = event->mval[0]; rect.xmin = rect.xmax = event->mval[0];
rect.ymin = rect.ymax = event->mval[1]; rect.ymin = rect.ymax = event->mval[1];
if (!BLI_in_rcti(&ar->v2d.mask, rect.xmin, rect.ymin)) if (!BLI_rcti_isect_pt(&ar->v2d.mask, rect.xmin, rect.ymin))
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
/* single select, deselect all selected first */ /* single select, deselect all selected first */
@ -525,7 +525,7 @@ int file_highlight_set(SpaceFile *sfile, ARegion *ar, int mx, int my)
mx -= ar->winrct.xmin; mx -= ar->winrct.xmin;
my -= ar->winrct.ymin; my -= ar->winrct.ymin;
if (BLI_in_rcti(&ar->v2d.mask, mx, my)) { if (BLI_rcti_isect_pt(&ar->v2d.mask, mx, my)) {
float fx, fy; float fx, fy;
int active_file; int active_file;

@ -454,7 +454,7 @@ static int node_resize_area_default(bNode *node, int x, int y)
rctf totr = node->totr; rctf totr = node->totr;
/* right part of node */ /* right part of node */
totr.xmin = node->totr.xmax - 20.0f; totr.xmin = node->totr.xmax - 20.0f;
if (BLI_in_rctf(&totr, x, y)) if (BLI_rctf_isect_pt(&totr, x, y))
return NODE_RESIZE_RIGHT; return NODE_RESIZE_RIGHT;
else else
return 0; return 0;

@ -476,12 +476,12 @@ void node_update_default(const bContext *C, bNodeTree *ntree, bNode *node)
int node_select_area_default(bNode *node, int x, int y) int node_select_area_default(bNode *node, int x, int y)
{ {
return BLI_in_rctf(&node->totr, x, y); return BLI_rctf_isect_pt(&node->totr, x, y);
} }
int node_tweak_area_default(bNode *node, int x, int y) int node_tweak_area_default(bNode *node, int x, int y)
{ {
return BLI_in_rctf(&node->totr, x, y); return BLI_rctf_isect_pt(&node->totr, x, y);
} }
int node_get_colorid(bNode *node) int node_get_colorid(bNode *node)
@ -989,7 +989,7 @@ void node_set_cursor(wmWindow *win, SpaceNode *snode)
else { else {
/* check nodes front to back */ /* check nodes front to back */
for (node = ntree->nodes.last; node; node = node->prev) { for (node = ntree->nodes.last; node; node = node->prev) {
if (BLI_in_rctf(&node->totr, snode->cursor[0], snode->cursor[1])) if (BLI_rctf_isect_pt(&node->totr, snode->cursor[0], snode->cursor[1]))
break; /* first hit on node stops */ break; /* first hit on node stops */
} }
if (node) { if (node) {

@ -1037,11 +1037,11 @@ static int UNUSED_FUNCTION(node_mouse_groupheader) (SpaceNode * snode)
// XXX areamouseco_to_ipoco(G.v2d, mval, &mx, &my); // XXX areamouseco_to_ipoco(G.v2d, mval, &mx, &my);
/* click in header or outside? */ /* click in header or outside? */
if (BLI_in_rctf(&gnode->totr, mx, my) == 0) { if (BLI_rctf_isect_pt(&gnode->totr, mx, my) == 0) {
rctf rect = gnode->totr; rctf rect = gnode->totr;
rect.ymax += NODE_DY; rect.ymax += NODE_DY;
if (BLI_in_rctf(&rect, mx, my) == 0) if (BLI_rctf_isect_pt(&rect, mx, my) == 0)
snode_make_group_editable(snode, NULL); /* toggles, so exits editmode */ snode_make_group_editable(snode, NULL); /* toggles, so exits editmode */
// else // else
// XXX transform_nodes(snode->nodetree, 'g', "Move group"); // XXX transform_nodes(snode->nodetree, 'g', "Move group");
@ -1085,7 +1085,7 @@ int node_find_indicated_socket(SpaceNode *snode, bNode **nodep, bNodeSocket **so
if (in_out & SOCK_IN) { if (in_out & SOCK_IN) {
for (sock = node->inputs.first; sock; sock = sock->next) { for (sock = node->inputs.first; sock; sock = sock->next) {
if (!nodeSocketIsHidden(sock)) { if (!nodeSocketIsHidden(sock)) {
if (BLI_in_rctf(&rect, sock->locx, sock->locy)) { if (BLI_rctf_isect_pt(&rect, sock->locx, sock->locy)) {
if (node == visible_node(snode, &rect)) { if (node == visible_node(snode, &rect)) {
*nodep = node; *nodep = node;
*sockp = sock; *sockp = sock;
@ -1098,7 +1098,7 @@ int node_find_indicated_socket(SpaceNode *snode, bNode **nodep, bNodeSocket **so
if (in_out & SOCK_OUT) { if (in_out & SOCK_OUT) {
for (sock = node->outputs.first; sock; sock = sock->next) { for (sock = node->outputs.first; sock; sock = sock->next) {
if (!nodeSocketIsHidden(sock)) { if (!nodeSocketIsHidden(sock)) {
if (BLI_in_rctf(&rect, sock->locx, sock->locy)) { if (BLI_rctf_isect_pt(&rect, sock->locx, sock->locy)) {
if (node == visible_node(snode, &rect)) { if (node == visible_node(snode, &rect)) {
*nodep = node; *nodep = node;
*sockp = sock; *sockp = sock;
@ -1116,7 +1116,7 @@ int node_find_indicated_socket(SpaceNode *snode, bNode **nodep, bNodeSocket **so
if (in_out & SOCK_IN) { if (in_out & SOCK_IN) {
for (sock = snode->edittree->outputs.first; sock; sock = sock->next) { for (sock = snode->edittree->outputs.first; sock; sock = sock->next) {
if (!nodeSocketIsHidden(sock)) { if (!nodeSocketIsHidden(sock)) {
if (BLI_in_rctf(&rect, sock->locx, sock->locy)) { if (BLI_rctf_isect_pt(&rect, sock->locx, sock->locy)) {
*nodep = NULL; /* NULL node pointer indicates group socket */ *nodep = NULL; /* NULL node pointer indicates group socket */
*sockp = sock; *sockp = sock;
return 1; return 1;
@ -1127,7 +1127,7 @@ int node_find_indicated_socket(SpaceNode *snode, bNode **nodep, bNodeSocket **so
if (in_out & SOCK_OUT) { if (in_out & SOCK_OUT) {
for (sock = snode->edittree->inputs.first; sock; sock = sock->next) { for (sock = snode->edittree->inputs.first; sock; sock = sock->next) {
if (!nodeSocketIsHidden(sock)) { if (!nodeSocketIsHidden(sock)) {
if (BLI_in_rctf(&rect, sock->locx, sock->locy)) { if (BLI_rctf_isect_pt(&rect, sock->locx, sock->locy)) {
*nodep = NULL; /* NULL node pointer indicates group socket */ *nodep = NULL; /* NULL node pointer indicates group socket */
*sockp = sock; *sockp = sock;
return 1; return 1;

@ -1140,7 +1140,7 @@ static int node_attach_exec(bContext *C, wmOperator *UNUSED(op))
/* skip selected, those are the nodes we want to attach */ /* skip selected, those are the nodes we want to attach */
if ((frame->type != NODE_FRAME) || (frame->flag & NODE_SELECT)) if ((frame->type != NODE_FRAME) || (frame->flag & NODE_SELECT))
continue; continue;
if (BLI_in_rctf(&frame->totr, snode->cursor[0], snode->cursor[1])) if (BLI_rctf_isect_pt(&frame->totr, snode->cursor[0], snode->cursor[1]))
break; break;
} }
if (frame) { if (frame) {

@ -563,7 +563,7 @@ static int do_lasso_select_node(bContext *C, int mcords[][2], short moves, short
cent[0], cent[1], cent[0], cent[1],
&screen_co[0], &screen_co[1]); &screen_co[0], &screen_co[1]);
if (BLI_in_rcti(&rect, screen_co[0], screen_co[1]) && if (BLI_rcti_isect_pt(&rect, screen_co[0], screen_co[1]) &&
BLI_lasso_is_point_inside(mcords, moves, screen_co[0], screen_co[1], INT_MAX)) BLI_lasso_is_point_inside(mcords, moves, screen_co[0], screen_co[1], INT_MAX))
{ {
if (select) if (select)

@ -291,7 +291,7 @@ static int view3d_selectable_data(bContext *C)
/* helper also for borderselect */ /* helper also for borderselect */
static int edge_fully_inside_rect(rcti *rect, short x1, short y1, short x2, short y2) static int edge_fully_inside_rect(rcti *rect, short x1, short y1, short x2, short y2)
{ {
return BLI_in_rcti(rect, x1, y1) && BLI_in_rcti(rect, x2, y2); return BLI_rcti_isect_pt(rect, x1, y1) && BLI_rcti_isect_pt(rect, x2, y2);
} }
static int edge_inside_rect(rcti *rect, short x1, short y1, short x2, short y2) static int edge_inside_rect(rcti *rect, short x1, short y1, short x2, short y2)
@ -394,7 +394,7 @@ static void do_lasso_select_mesh__doSelectVert(void *userData, BMVert *eve, int
{ {
LassoSelectUserData *data = userData; LassoSelectUserData *data = userData;
if (BLI_in_rcti(data->rect, x, y) && if (BLI_rcti_isect_pt(data->rect, x, y) &&
BLI_lasso_is_point_inside(data->mcords, data->moves, x, y, IS_CLIPPED)) BLI_lasso_is_point_inside(data->mcords, data->moves, x, y, IS_CLIPPED))
{ {
BM_vert_select_set(data->vc->em->bm, eve, data->select); BM_vert_select_set(data->vc->em->bm, eve, data->select);
@ -425,7 +425,7 @@ static void do_lasso_select_mesh__doSelectFace(void *userData, BMFace *efa, int
{ {
LassoSelectUserData *data = userData; LassoSelectUserData *data = userData;
if (BLI_in_rcti(data->rect, x, y) && if (BLI_rcti_isect_pt(data->rect, x, y) &&
BLI_lasso_is_point_inside(data->mcords, data->moves, x, y, IS_CLIPPED)) BLI_lasso_is_point_inside(data->mcords, data->moves, x, y, IS_CLIPPED))
{ {
BM_face_select_set(data->vc->em->bm, efa, data->select); BM_face_select_set(data->vc->em->bm, efa, data->select);
@ -769,7 +769,7 @@ static void do_lasso_select_node(int mcords[][2], short moves, short select)
node_centf[1] = BLI_RCT_CENTER_Y(&node->totr); node_centf[1] = BLI_RCT_CENTER_Y(&node->totr);
ipoco_to_areaco_noclip(G.v2d, node_centf, node_cent); ipoco_to_areaco_noclip(G.v2d, node_centf, node_cent);
if (BLI_in_rcti_v(&rect, node_cent) && BLI_lasso_is_point_inside(mcords, moves, node_cent[0], node_cent[1])) { if (BLI_rcti_isect_pt_v(&rect, node_cent) && BLI_lasso_is_point_inside(mcords, moves, node_cent[0], node_cent[1])) {
if (select) { if (select) {
node->flag |= SELECT; node->flag |= SELECT;
} }
@ -1552,7 +1552,7 @@ static void do_nurbs_box_select__doSelect(void *userData, Nurb *UNUSED(nu), BPoi
Object *obedit = data->vc->obedit; Object *obedit = data->vc->obedit;
Curve *cu = (Curve *)obedit->data; Curve *cu = (Curve *)obedit->data;
if (BLI_in_rcti(data->rect, x, y)) { if (BLI_rcti_isect_pt(data->rect, x, y)) {
if (bp) { if (bp) {
bp->f1 = data->select ? (bp->f1 | SELECT) : (bp->f1 & ~SELECT); bp->f1 = data->select ? (bp->f1 | SELECT) : (bp->f1 & ~SELECT);
if (bp == cu->lastsel && !(bp->f1 & 1)) cu->lastsel = NULL; if (bp == cu->lastsel && !(bp->f1 & 1)) cu->lastsel = NULL;
@ -1599,7 +1599,7 @@ static void do_lattice_box_select__doSelect(void *userData, BPoint *bp, int x, i
{ {
BoxSelectUserData *data = userData; BoxSelectUserData *data = userData;
if (BLI_in_rcti(data->rect, x, y)) { if (BLI_rcti_isect_pt(data->rect, x, y)) {
bp->f1 = data->select ? (bp->f1 | SELECT) : (bp->f1 & ~SELECT); bp->f1 = data->select ? (bp->f1 | SELECT) : (bp->f1 & ~SELECT);
} }
} }
@ -1624,7 +1624,7 @@ static void do_mesh_box_select__doSelectVert(void *userData, BMVert *eve, int x,
{ {
BoxSelectUserData *data = userData; BoxSelectUserData *data = userData;
if (BLI_in_rcti(data->rect, x, y)) { if (BLI_rcti_isect_pt(data->rect, x, y)) {
BM_vert_select_set(data->vc->em->bm, eve, data->select); BM_vert_select_set(data->vc->em->bm, eve, data->select);
} }
} }
@ -1650,7 +1650,7 @@ static void do_mesh_box_select__doSelectFace(void *userData, BMFace *efa, int x,
{ {
BoxSelectUserData *data = userData; BoxSelectUserData *data = userData;
if (BLI_in_rcti(data->rect, x, y)) { if (BLI_rcti_isect_pt(data->rect, x, y)) {
BM_face_select_set(data->vc->em->bm, efa, data->select); BM_face_select_set(data->vc->em->bm, efa, data->select);
} }
} }

@ -2567,7 +2567,7 @@ static int border_select_exec(bContext *C, wmOperator *op)
tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY); tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
if (uvedit_face_visible_test(scene, ima, efa, tf)) { if (uvedit_face_visible_test(scene, ima, efa, tf)) {
uv_poly_center(em, efa, cent); uv_poly_center(em, efa, cent);
if (BLI_in_rctf_v(&rectf, cent)) { if (BLI_rctf_isect_pt_v(&rectf, cent)) {
BM_elem_flag_enable(efa, BM_ELEM_TAG); BM_elem_flag_enable(efa, BM_ELEM_TAG);
change = 1; change = 1;
} }
@ -2592,13 +2592,13 @@ static int border_select_exec(bContext *C, wmOperator *op)
if (!pinned || (ts->uv_flag & UV_SYNC_SELECTION) ) { if (!pinned || (ts->uv_flag & UV_SYNC_SELECTION) ) {
/* UV_SYNC_SELECTION - can't do pinned selection */ /* UV_SYNC_SELECTION - can't do pinned selection */
if (BLI_in_rctf_v(&rectf, luv->uv)) { if (BLI_rctf_isect_pt_v(&rectf, luv->uv)) {
if (select) uvedit_uv_select_enable(em, scene, l, FALSE); if (select) uvedit_uv_select_enable(em, scene, l, FALSE);
else uvedit_uv_select_disable(em, scene, l); else uvedit_uv_select_disable(em, scene, l);
} }
} }
else if (pinned) { else if (pinned) {
if ((luv->flag & MLOOPUV_PINNED) && BLI_in_rctf_v(&rectf, luv->uv)) { if ((luv->flag & MLOOPUV_PINNED) && BLI_rctf_isect_pt_v(&rectf, luv->uv)) {
if (select) uvedit_uv_select_enable(em, scene, l, FALSE); if (select) uvedit_uv_select_enable(em, scene, l, FALSE);
else uvedit_uv_select_disable(em, scene, l); else uvedit_uv_select_disable(em, scene, l);
} }
@ -2771,7 +2771,7 @@ static int do_lasso_select_mesh_uv(bContext *C, int mcords[][2], short moves, sh
float cent[2]; float cent[2];
uv_poly_center(em, efa, cent); uv_poly_center(em, efa, cent);
UI_view2d_view_to_region(&ar->v2d, cent[0], cent[1], &screen_uv[0], &screen_uv[1]); UI_view2d_view_to_region(&ar->v2d, cent[0], cent[1], &screen_uv[0], &screen_uv[1]);
if (BLI_in_rcti_v(&rect, screen_uv) && if (BLI_rcti_isect_pt_v(&rect, screen_uv) &&
BLI_lasso_is_point_inside(mcords, moves, screen_uv[0], screen_uv[1], V2D_IS_CLIPPED)) BLI_lasso_is_point_inside(mcords, moves, screen_uv[0], screen_uv[1], V2D_IS_CLIPPED))
{ {
uvedit_face_select_enable(scene, em, efa, FALSE); uvedit_face_select_enable(scene, em, efa, FALSE);
@ -2788,7 +2788,7 @@ static int do_lasso_select_mesh_uv(bContext *C, int mcords[][2], short moves, sh
if ((select) != (uvedit_uv_select_test(em, scene, l))) { if ((select) != (uvedit_uv_select_test(em, scene, l))) {
MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV); MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
UI_view2d_view_to_region(&ar->v2d, luv->uv[0], luv->uv[1], &screen_uv[0], &screen_uv[1]); UI_view2d_view_to_region(&ar->v2d, luv->uv[0], luv->uv[1], &screen_uv[0], &screen_uv[1]);
if (BLI_in_rcti_v(&rect, screen_uv) && if (BLI_rcti_isect_pt_v(&rect, screen_uv) &&
BLI_lasso_is_point_inside(mcords, moves, screen_uv[0], screen_uv[1], V2D_IS_CLIPPED)) BLI_lasso_is_point_inside(mcords, moves, screen_uv[0], screen_uv[1], V2D_IS_CLIPPED))
{ {
if (select) { if (select) {

@ -1824,7 +1824,7 @@ static void isb_bsp_face_inside(ISBBranch *bspn, BSPFace *face)
if ((samp->facenr!=face->facenr || samp->obi!=face->obi) && samp->shadfac) { if ((samp->facenr!=face->facenr || samp->obi!=face->obi) && samp->shadfac) {
if (face->box.zmin < samp->zco[2]) { if (face->box.zmin < samp->zco[2]) {
if (BLI_in_rctf_v((rctf *)&face->box, samp->zco)) { if (BLI_rctf_isect_pt_v((rctf *)&face->box, samp->zco)) {
int inshadow= 0; int inshadow= 0;
if (face->type) { if (face->type) {

@ -922,7 +922,7 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event,
ScrArea *sa = CTX_wm_area(C); ScrArea *sa = CTX_wm_area(C);
if (ar && ar->regiontype == RGN_TYPE_WINDOW && event && if (ar && ar->regiontype == RGN_TYPE_WINDOW && event &&
BLI_in_rcti_v(&ar->winrct, &event->x)) BLI_rcti_isect_pt_v(&ar->winrct, &event->x))
{ {
winrect = &ar->winrct; winrect = &ar->winrct;
} }
@ -1642,17 +1642,17 @@ static int handler_boundbox_test(wmEventHandler *handler, wmEvent *event)
rcti rect = *handler->bblocal; rcti rect = *handler->bblocal;
BLI_rcti_translate(&rect, handler->bbwin->xmin, handler->bbwin->ymin); BLI_rcti_translate(&rect, handler->bbwin->xmin, handler->bbwin->ymin);
if (BLI_in_rcti_v(&rect, &event->x)) if (BLI_rcti_isect_pt_v(&rect, &event->x))
return 1; return 1;
else if (event->type == MOUSEMOVE && BLI_in_rcti_v(&rect, &event->prevx)) else if (event->type == MOUSEMOVE && BLI_rcti_isect_pt_v(&rect, &event->prevx))
return 1; return 1;
else else
return 0; return 0;
} }
else { else {
if (BLI_in_rcti_v(handler->bbwin, &event->x)) if (BLI_rcti_isect_pt_v(handler->bbwin, &event->x))
return 1; return 1;
else if (event->type == MOUSEMOVE && BLI_in_rcti_v(handler->bbwin, &event->prevx)) else if (event->type == MOUSEMOVE && BLI_rcti_isect_pt_v(handler->bbwin, &event->prevx))
return 1; return 1;
else else
return 0; return 0;
@ -1888,10 +1888,10 @@ static int wm_event_inside_i(wmEvent *event, rcti *rect)
{ {
if (wm_event_always_pass(event)) if (wm_event_always_pass(event))
return 1; return 1;
if (BLI_in_rcti_v(rect, &event->x)) if (BLI_rcti_isect_pt_v(rect, &event->x))
return 1; return 1;
if (event->type == MOUSEMOVE) { if (event->type == MOUSEMOVE) {
if (BLI_in_rcti_v(rect, &event->prevx)) { if (BLI_rcti_isect_pt_v(rect, &event->prevx)) {
return 1; return 1;
} }
return 0; return 0;
@ -1906,7 +1906,7 @@ static ScrArea *area_event_inside(bContext *C, const int xy[2])
if (screen) if (screen)
for (sa = screen->areabase.first; sa; sa = sa->next) for (sa = screen->areabase.first; sa; sa = sa->next)
if (BLI_in_rcti_v(&sa->totrct, xy)) if (BLI_rcti_isect_pt_v(&sa->totrct, xy))
return sa; return sa;
return NULL; return NULL;
} }
@ -1919,7 +1919,7 @@ static ARegion *region_event_inside(bContext *C, const int xy[2])
if (screen && area) if (screen && area)
for (ar = area->regionbase.first; ar; ar = ar->next) for (ar = area->regionbase.first; ar; ar = ar->next)
if (BLI_in_rcti_v(&ar->winrct, xy)) if (BLI_rcti_isect_pt_v(&ar->winrct, xy))
return ar; return ar;
return NULL; return NULL;
} }
@ -1950,7 +1950,7 @@ static void wm_paintcursor_test(bContext *C, wmEvent *event)
wm_paintcursor_tag(C, wm->paintcursors.first, ar); wm_paintcursor_tag(C, wm->paintcursors.first, ar);
/* if previous position was not in current region, we have to set a temp new context */ /* if previous position was not in current region, we have to set a temp new context */
if (ar == NULL || !BLI_in_rcti_v(&ar->winrct, &event->prevx)) { if (ar == NULL || !BLI_rcti_isect_pt_v(&ar->winrct, &event->prevx)) {
ScrArea *sa = CTX_wm_area(C); ScrArea *sa = CTX_wm_area(C);
CTX_wm_area_set(C, area_event_inside(C, &event->prevx)); CTX_wm_area_set(C, area_event_inside(C, &event->prevx));
@ -2125,7 +2125,7 @@ void wm_event_do_handlers(bContext *C)
if (CTX_wm_window(C) == NULL) if (CTX_wm_window(C) == NULL)
return; return;
doit |= (BLI_in_rcti_v(&ar->winrct, &event->x)); doit |= (BLI_rcti_isect_pt_v(&ar->winrct, &event->x));
if (action & WM_HANDLER_BREAK) if (action & WM_HANDLER_BREAK)
break; break;