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/editors/screen | |
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/editors/screen')
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 8 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_intern.h | 2 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 8 |
3 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index a638aac9423..48532c83e4c 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1219,7 +1219,7 @@ static void screen_cursor_set(wmWindow *win, wmEvent *event) ScrArea *sa; for (sa = win->screen->areabase.first; sa; sa = sa->next) - if ((az = is_in_area_actionzone(sa, event->x, event->y))) + if ((az = is_in_area_actionzone(sa, &event->x))) break; if (sa) { @@ -1262,12 +1262,12 @@ void ED_screen_set_subwinactive(bContext *C, wmEvent *event) for (sa = scr->areabase.first; sa; sa = sa->next) { if (event->x > sa->totrct.xmin && event->x < sa->totrct.xmax) if (event->y > sa->totrct.ymin && event->y < sa->totrct.ymax) - if (NULL == is_in_area_actionzone(sa, event->x, event->y)) + if (NULL == is_in_area_actionzone(sa, &event->x)) break; } if (sa) { for (ar = sa->regionbase.first; ar; ar = ar->next) { - if (BLI_in_rcti(&ar->winrct, event->x, event->y)) + if (BLI_in_rcti_v(&ar->winrct, &event->x)) scr->subwinactive = ar->swinid; } } @@ -1314,7 +1314,7 @@ int ED_screen_area_active(const bContext *C) ScrArea *sa = CTX_wm_area(C); if (win && sc && sa) { - AZone *az = is_in_area_actionzone(sa, win->eventstate->x, win->eventstate->y); + AZone *az = is_in_area_actionzone(sa, &win->eventstate->x); ARegion *ar; if (az && az->type == AZONE_REGION) diff --git a/source/blender/editors/screen/screen_intern.h b/source/blender/editors/screen/screen_intern.h index aa11c3eecdd..86d99777e98 100644 --- a/source/blender/editors/screen/screen_intern.h +++ b/source/blender/editors/screen/screen_intern.h @@ -54,7 +54,7 @@ void removenotused_scredges(bScreen *sc); int scredge_is_horizontal(ScrEdge *se); ScrEdge *screen_find_active_scredge(bScreen *sc, int mx, int my); -struct AZone *is_in_area_actionzone(ScrArea *sa, int x, int y); +struct AZone *is_in_area_actionzone(ScrArea *sa, const int xy[2]); /* screen_context.c */ int ed_screen_context(const bContext *C, const char *member, bContextDataResult *result); diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 6be276dea14..547e7bc8e5a 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -524,15 +524,15 @@ static int actionzone_area_poll(bContext *C) return 0; } -AZone *is_in_area_actionzone(ScrArea *sa, int x, int y) +AZone *is_in_area_actionzone(ScrArea *sa, const int xy[2]) { AZone *az = NULL; for (az = sa->actionzones.first; az; az = az->next) { - if (BLI_in_rcti(&az->rect, x, y)) { + if (BLI_in_rcti_v(&az->rect, xy)) { if (az->type == AZONE_AREA) { /* no triangle intersect but a hotspot circle based on corner */ - int radius = (x - az->x1) * (x - az->x1) + (y - az->y1) * (y - az->y1); + int radius = (xy[0] - az->x1) * (xy[0] - az->x1) + (xy[1] - az->y1) * (xy[1] - az->y1); if (radius <= AZONESPOT * AZONESPOT) break; @@ -577,7 +577,7 @@ static void actionzone_apply(bContext *C, wmOperator *op, int type) static int actionzone_invoke(bContext *C, wmOperator *op, wmEvent *event) { - AZone *az = is_in_area_actionzone(CTX_wm_area(C), event->x, event->y); + AZone *az = is_in_area_actionzone(CTX_wm_area(C), &event->x); sActionzoneData *sad; /* quick escape */ |