diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-27 19:15:55 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-27 19:15:55 +0400 |
commit | f1acd6ac3e78aa4b898ee310dae2814015616e5f (patch) | |
tree | f9e12a8ac3f65b75465920ec188803751fe06c8b /source/blender/editors/mask | |
parent | 49e0c832e16195d8a656798830a63074eb6cd6c7 (diff) |
code cleanup: pass mouse position as int[2] rather then wmEvent
Diffstat (limited to 'source/blender/editors/mask')
-rw-r--r-- | source/blender/editors/mask/mask_add.c | 4 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_edit.c | 9 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_ops.c | 6 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_select.c | 4 |
4 files changed, 12 insertions, 11 deletions
diff --git a/source/blender/editors/mask/mask_add.c b/source/blender/editors/mask/mask_add.c index 48c81894b55..958fad56b0c 100644 --- a/source/blender/editors/mask/mask_add.c +++ b/source/blender/editors/mask/mask_add.c @@ -621,7 +621,7 @@ static int add_vertex_invoke(bContext *C, wmOperator *op, wmEvent *event) float co[2]; - ED_mask_mouse_pos(sa, ar, event, co); + ED_mask_mouse_pos(sa, ar, event->mval, co); RNA_float_set_array(op->ptr, "location", co); @@ -695,7 +695,7 @@ static int add_feather_vertex_invoke(bContext *C, wmOperator *op, wmEvent *event float co[2]; - ED_mask_mouse_pos(sa, ar, event, co); + ED_mask_mouse_pos(sa, ar, event->mval, co); RNA_float_set_array(op->ptr, "location", co); diff --git a/source/blender/editors/mask/mask_edit.c b/source/blender/editors/mask/mask_edit.c index dc41424b1d9..85a8ae11111 100644 --- a/source/blender/editors/mask/mask_edit.c +++ b/source/blender/editors/mask/mask_edit.c @@ -90,20 +90,21 @@ int ED_maskedit_mask_poll(bContext *C) /********************** registration *********************/ -void ED_mask_mouse_pos(ScrArea *sa, ARegion *ar, wmEvent *event, float co[2]) +/* takes event->mval */ +void ED_mask_mouse_pos(ScrArea *sa, ARegion *ar, const int mval[2], float co[2]) { if (sa) { switch (sa->spacetype) { case SPACE_CLIP: { SpaceClip *sc = sa->spacedata.first; - ED_clip_mouse_pos(sc, ar, event, co); + ED_clip_mouse_pos(sc, ar, mval, co); BKE_mask_coord_from_movieclip(sc->clip, &sc->user, co, co); break; } case SPACE_SEQ: { - UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &co[0], &co[1]); + UI_view2d_region_to_view(&ar->v2d, mval[0], mval[1], &co[0], &co[1]); break; } case SPACE_IMAGE: @@ -111,7 +112,7 @@ void ED_mask_mouse_pos(ScrArea *sa, ARegion *ar, wmEvent *event, float co[2]) float frame_size[2]; SpaceImage *sima = sa->spacedata.first; ED_space_image_get_size_fl(sima, frame_size); - ED_image_mouse_pos(sima, ar, event, co); + ED_image_mouse_pos(sima, ar, mval, co); BKE_mask_coord_from_frame(co, co, frame_size); break; } diff --git a/source/blender/editors/mask/mask_ops.c b/source/blender/editors/mask/mask_ops.c index 116c3dcede1..b1b3e0cf6c8 100644 --- a/source/blender/editors/mask/mask_ops.c +++ b/source/blender/editors/mask/mask_ops.c @@ -446,7 +446,7 @@ static void *slide_point_customdata(bContext *C, wmOperator *op, wmEvent *event) float co[2], cv_score, feather_score; const float threshold = 19; - ED_mask_mouse_pos(sa, ar, event, co); + ED_mask_mouse_pos(sa, ar, event->mval, co); ED_mask_get_size(sa, &width, &height); cv_point = ED_mask_point_find_nearest(C, mask, co, threshold, &cv_masklay, &cv_spline, &is_handle, &cv_score); @@ -511,7 +511,7 @@ static void *slide_point_customdata(bContext *C, wmOperator *op, wmEvent *event) copy_m3_m3(customdata->vec, point->bezt.vec); if (BKE_mask_point_has_handle(point)) BKE_mask_point_handle(point, customdata->handle); - ED_mask_mouse_pos(sa, ar, event, customdata->co); + ED_mask_mouse_pos(sa, ar, event->mval, customdata->co); } return customdata; @@ -652,7 +652,7 @@ static int slide_point_modal(bContext *C, wmOperator *op, wmEvent *event) ScrArea *sa = CTX_wm_area(C); ARegion *ar = CTX_wm_region(C); - ED_mask_mouse_pos(sa, ar, event, co); + ED_mask_mouse_pos(sa, ar, event->mval, co); sub_v2_v2v2(dco, co, data->co); if (data->action == SLIDE_ACTION_HANDLE) { diff --git a/source/blender/editors/mask/mask_select.c b/source/blender/editors/mask/mask_select.c index 81cfbb9b586..9c1b4f0fd42 100644 --- a/source/blender/editors/mask/mask_select.c +++ b/source/blender/editors/mask/mask_select.c @@ -348,7 +348,7 @@ static int select_invoke(bContext *C, wmOperator *op, wmEvent *event) float co[2]; - ED_mask_mouse_pos(sa, ar, event, co); + ED_mask_mouse_pos(sa, ar, event->mval, co); RNA_float_set_array(op->ptr, "location", co); @@ -688,7 +688,7 @@ static int mask_select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent * const float threshold = 19; int change = FALSE; - ED_mask_mouse_pos(sa, ar, event, co); + ED_mask_mouse_pos(sa, ar, event->mval, co); point = ED_mask_point_find_nearest(C, mask, co, threshold, &masklay, &spline, &is_handle, NULL); |