diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-11 22:17:48 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-11 22:17:48 +0400 |
commit | a5127dba57490e0c0215e9cabfac1749585c53d1 (patch) | |
tree | 98911e5020e54806155e3a77db345f2b6882cb9f /source/blender/windowmanager | |
parent | 2070cd5d4929b969046492e55da34736a9d6304c (diff) |
vector versions of BLI_in_rctf / BLI_in_rcti, (BLI_in_rctf_v, BLI_in_rcti_v)
use where possible.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 38 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_gesture.c | 2 |
2 files changed, 20 insertions, 20 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 9795c482af2..4b762f94d34 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -919,7 +919,7 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, P ScrArea *sa = CTX_wm_area(C); if (ar && ar->regiontype == RGN_TYPE_WINDOW && event && - BLI_in_rcti(&ar->winrct, event->x, event->y)) + BLI_in_rcti_v(&ar->winrct, &event->x)) { winrect = &ar->winrct; } @@ -1638,17 +1638,17 @@ static int handler_boundbox_test(wmEventHandler *handler, wmEvent *event) rcti rect = *handler->bblocal; BLI_translate_rcti(&rect, handler->bbwin->xmin, handler->bbwin->ymin); - if (BLI_in_rcti(&rect, event->x, event->y)) + if (BLI_in_rcti_v(&rect, &event->x)) return 1; - else if (event->type == MOUSEMOVE && BLI_in_rcti(&rect, event->prevx, event->prevy)) + else if (event->type == MOUSEMOVE && BLI_in_rcti_v(&rect, &event->prevx)) return 1; else return 0; } else { - if (BLI_in_rcti(handler->bbwin, event->x, event->y)) + if (BLI_in_rcti_v(handler->bbwin, &event->x)) return 1; - else if (event->type == MOUSEMOVE && BLI_in_rcti(handler->bbwin, event->prevx, event->prevy)) + else if (event->type == MOUSEMOVE && BLI_in_rcti_v(handler->bbwin, &event->prevx)) return 1; else return 0; @@ -1826,10 +1826,10 @@ static int wm_event_inside_i(wmEvent *event, rcti *rect) { if (wm_event_always_pass(event)) return 1; - if (BLI_in_rcti(rect, event->x, event->y)) + if (BLI_in_rcti_v(rect, &event->x)) return 1; if (event->type == MOUSEMOVE) { - if (BLI_in_rcti(rect, event->prevx, event->prevy)) { + if (BLI_in_rcti_v(rect, &event->prevx)) { return 1; } return 0; @@ -1837,19 +1837,19 @@ static int wm_event_inside_i(wmEvent *event, rcti *rect) return 0; } -static ScrArea *area_event_inside(bContext *C, int x, int y) +static ScrArea *area_event_inside(bContext *C, const int xy[2]) { bScreen *screen = CTX_wm_screen(C); ScrArea *sa; if (screen) for (sa = screen->areabase.first; sa; sa = sa->next) - if (BLI_in_rcti(&sa->totrct, x, y)) + if (BLI_in_rcti_v(&sa->totrct, xy)) return sa; return NULL; } -static ARegion *region_event_inside(bContext *C, int x, int y) +static ARegion *region_event_inside(bContext *C, const int xy[2]) { bScreen *screen = CTX_wm_screen(C); ScrArea *area = CTX_wm_area(C); @@ -1857,7 +1857,7 @@ static ARegion *region_event_inside(bContext *C, int x, int y) if (screen && area) for (ar = area->regionbase.first; ar; ar = ar->next) - if (BLI_in_rcti(&ar->winrct, x, y)) + if (BLI_in_rcti_v(&ar->winrct, xy)) return ar; return NULL; } @@ -1888,11 +1888,11 @@ static void wm_paintcursor_test(bContext *C, wmEvent *event) 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 (ar == NULL || !BLI_in_rcti(&ar->winrct, event->prevx, event->prevy)) { + if (ar == NULL || !BLI_in_rcti_v(&ar->winrct, &event->prevx)) { ScrArea *sa = CTX_wm_area(C); - CTX_wm_area_set(C, area_event_inside(C, event->prevx, event->prevy)); - CTX_wm_region_set(C, region_event_inside(C, event->prevx, event->prevy)); + CTX_wm_area_set(C, area_event_inside(C, &event->prevx)); + CTX_wm_region_set(C, region_event_inside(C, &event->prevx)); wm_paintcursor_tag(C, wm->paintcursors.first, CTX_wm_region(C)); @@ -2000,8 +2000,8 @@ void wm_event_do_handlers(bContext *C) CTX_wm_window_set(C, win); /* we let modal handlers get active area/region, also wm_paintcursor_test needs it */ - CTX_wm_area_set(C, area_event_inside(C, event->x, event->y)); - CTX_wm_region_set(C, region_event_inside(C, event->x, event->y)); + CTX_wm_area_set(C, area_event_inside(C, &event->x)); + CTX_wm_region_set(C, region_event_inside(C, &event->x)); /* MVC demands to not draw in event handlers... but we need to leave it for ogl selecting etc */ wm_window_make_drawable(C, win); @@ -2061,7 +2061,7 @@ void wm_event_do_handlers(bContext *C) if (CTX_wm_window(C) == NULL) return; - doit |= (BLI_in_rcti(&ar->winrct, event->x, event->y)); + doit |= (BLI_in_rcti_v(&ar->winrct, &event->x)); if (action & WM_HANDLER_BREAK) break; @@ -2083,8 +2083,8 @@ void wm_event_do_handlers(bContext *C) if ((action & WM_HANDLER_BREAK) == 0) { /* also some non-modal handlers need active area/region */ - CTX_wm_area_set(C, area_event_inside(C, event->x, event->y)); - CTX_wm_region_set(C, region_event_inside(C, event->x, event->y)); + CTX_wm_area_set(C, area_event_inside(C, &event->x)); + CTX_wm_region_set(C, region_event_inside(C, &event->x)); wm_region_mouse_co(C, event); diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c index b280b979280..c9f1a2587df 100644 --- a/source/blender/windowmanager/intern/wm_gesture.c +++ b/source/blender/windowmanager/intern/wm_gesture.c @@ -253,7 +253,7 @@ static void draw_filled_lasso(wmGesture *gt) /* highly unlikely this will fail, but could crash if (gt->points == 0) */ if (sf_vert_first) { - float zvec[3] = {0.0f, 0.0f, 1.0f}; + const float zvec[3] = {0.0f, 0.0f, 1.0f}; BLI_scanfill_edge_add(&sf_ctx, sf_vert_first, sf_vert); BLI_scanfill_calc_ex(&sf_ctx, FALSE, zvec); |