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/space_clip | |
parent | 49e0c832e16195d8a656798830a63074eb6cd6c7 (diff) |
code cleanup: pass mouse position as int[2] rather then wmEvent
Diffstat (limited to 'source/blender/editors/space_clip')
4 files changed, 11 insertions, 10 deletions
diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c index 1cde271e599..54ee691b63b 100644 --- a/source/blender/editors/space_clip/clip_editor.c +++ b/source/blender/editors/space_clip/clip_editor.c @@ -439,9 +439,10 @@ void ED_clip_point_stable_pos__reverse(SpaceClip *sc, ARegion *ar, const float c r_co[1] = (pos[1] * height * zoomy) + (float)sy; } -void ED_clip_mouse_pos(SpaceClip *sc, ARegion *ar, wmEvent *event, float co[2]) +/* takes event->mval */ +void ED_clip_mouse_pos(SpaceClip *sc, ARegion *ar, const int mval[2], float co[2]) { - ED_clip_point_stable_pos(sc, ar, event->mval[0], event->mval[1], &co[0], &co[1]); + ED_clip_point_stable_pos(sc, ar, mval[0], mval[1], &co[0], &co[1]); } int ED_space_clip_check_show_trackedit(SpaceClip *sc) diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index 1dabef75c21..f7222dae75f 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -119,7 +119,7 @@ static void sclip_zoom_set_factor_exec(bContext *C, wmEvent *event, float factor if (event) { SpaceClip *sc = CTX_wm_space_clip(C); - ED_clip_mouse_pos(sc, ar, event, location); + ED_clip_mouse_pos(sc, ar, event->mval, location); mpos = location; } @@ -483,7 +483,7 @@ static void view_zoom_init(bContext *C, wmOperator *op, wmEvent *event) vpd->zoom = sc->zoom; vpd->event_type = event->type; - ED_clip_mouse_pos(sc, ar, event, vpd->location); + ED_clip_mouse_pos(sc, ar, event->mval, vpd->location); WM_event_add_modal_handler(C, op); } @@ -605,7 +605,7 @@ static int view_zoom_in_invoke(bContext *C, wmOperator *op, wmEvent *event) float location[2]; - ED_clip_mouse_pos(sc, ar, event, location); + ED_clip_mouse_pos(sc, ar, event->mval, location); RNA_float_set_array(op->ptr, "location", location); return view_zoom_in_exec(C, op); @@ -648,7 +648,7 @@ static int view_zoom_out_invoke(bContext *C, wmOperator *op, wmEvent *event) float location[2]; - ED_clip_mouse_pos(sc, ar, event, location); + ED_clip_mouse_pos(sc, ar, event->mval, location); RNA_float_set_array(op->ptr, "location", location); return view_zoom_out_exec(C, op); diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c index 6821acc5f5a..77c4b527a11 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -132,7 +132,7 @@ static int add_marker_invoke(bContext *C, wmOperator *op, wmEvent *event) float co[2]; - ED_clip_mouse_pos(sc, ar, event, co); + ED_clip_mouse_pos(sc, ar, event->mval, co); RNA_float_set_array(op->ptr, "location", co); @@ -543,7 +543,7 @@ MovieTrackingTrack *tracking_marker_check_slide(bContext *C, wmEvent *event, int if (width == 0 || height == 0) return NULL; - ED_clip_mouse_pos(sc, ar, event, co); + ED_clip_mouse_pos(sc, ar, event->mval, co); track = tracksbase->first; while (track) { @@ -641,7 +641,7 @@ static void *slide_marker_customdata(bContext *C, wmEvent *event) if (width == 0 || height == 0) return NULL; - ED_clip_mouse_pos(sc, ar, event, co); + ED_clip_mouse_pos(sc, ar, event->mval, co); track = tracking_marker_check_slide(C, event, &area, &action, &corner); if (track) { diff --git a/source/blender/editors/space_clip/tracking_select.c b/source/blender/editors/space_clip/tracking_select.c index 26a596ead07..9581d7708fb 100644 --- a/source/blender/editors/space_clip/tracking_select.c +++ b/source/blender/editors/space_clip/tracking_select.c @@ -302,7 +302,7 @@ static int select_invoke(bContext *C, wmOperator *op, wmEvent *event) } } - ED_clip_mouse_pos(sc, ar, event, co); + ED_clip_mouse_pos(sc, ar, event->mval, co); RNA_float_set_array(op->ptr, "location", co); return select_exec(C, op); |