diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-27 02:41:40 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-27 02:41:40 +0400 |
commit | ff078d309e65d2383fa0829954c724fc49189492 (patch) | |
tree | e383ad5f7fa69eba20adfa691f7a90f49925c64d /source/blender/editors/space_clip/tracking_select.c | |
parent | ee572a9642d5360f0ba852c17cc345f21ad1f985 (diff) |
change clip utility function arguments to take space data and region rather then the context.
this allows a fix to be applied that corrects the helper line in the image view when transforming a mask.
Diffstat (limited to 'source/blender/editors/space_clip/tracking_select.c')
-rw-r--r-- | source/blender/editors/space_clip/tracking_select.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/source/blender/editors/space_clip/tracking_select.c b/source/blender/editors/space_clip/tracking_select.c index 0d933c1dff3..26a596ead07 100644 --- a/source/blender/editors/space_clip/tracking_select.c +++ b/source/blender/editors/space_clip/tracking_select.c @@ -119,7 +119,7 @@ static int track_mouse_area(const bContext *C, float co[2], MovieTrackingTrack * float epsx, epsy; int width, height; - ED_space_clip_get_size(C, &width, &height); + ED_space_clip_get_size(sc, &width, &height); BKE_tracking_marker_pattern_minmax(marker, pat_min, pat_max); @@ -281,6 +281,9 @@ static int select_exec(bContext *C, wmOperator *op) static int select_invoke(bContext *C, wmOperator *op, wmEvent *event) { + SpaceClip *sc = CTX_wm_space_clip(C); + ARegion *ar = CTX_wm_region(C); + float co[2]; int extend = RNA_boolean_get(op->ptr, "extend"); @@ -299,7 +302,7 @@ static int select_invoke(bContext *C, wmOperator *op, wmEvent *event) } } - ED_clip_mouse_pos(C, event, co); + ED_clip_mouse_pos(sc, ar, event, co); RNA_float_set_array(op->ptr, "location", co); return select_exec(C, op); @@ -333,6 +336,8 @@ void CLIP_OT_select(wmOperatorType *ot) static int border_select_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); + ARegion *ar = CTX_wm_region(C); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; MovieTrackingTrack *track; @@ -348,8 +353,8 @@ static int border_select_exec(bContext *C, wmOperator *op) rect.xmax = RNA_int_get(op->ptr, "xmax"); rect.ymax = RNA_int_get(op->ptr, "ymax"); - ED_clip_point_stable_pos(C, rect.xmin, rect.ymin, &rectf.xmin, &rectf.ymin); - ED_clip_point_stable_pos(C, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax); + ED_clip_point_stable_pos(sc, ar, rect.xmin, rect.ymin, &rectf.xmin, &rectf.ymin); + ED_clip_point_stable_pos(sc, ar, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax); mode = RNA_int_get(op->ptr, "gesture_mode"); extend = RNA_boolean_get(op->ptr, "extend"); @@ -414,6 +419,8 @@ void CLIP_OT_select_border(wmOperatorType *ot) static int do_lasso_select_marker(bContext *C, int mcords[][2], short moves, short select) { SpaceClip *sc = CTX_wm_space_clip(C); + ARegion *ar = CTX_wm_region(C); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; MovieTrackingTrack *track; @@ -435,7 +442,7 @@ static int do_lasso_select_marker(bContext *C, int mcords[][2], short moves, sho float screen_co[2]; /* marker in screen coords */ - ED_clip_point_stable_pos__reverse(C, 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]) && BLI_lasso_is_point_inside(mcords, moves, screen_co[0], screen_co[1], V2D_IS_CLIPPED)) @@ -519,6 +526,8 @@ static int marker_inside_ellipse(MovieTrackingMarker *marker, float offset[2], f static int circle_select_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); + ARegion *ar = CTX_wm_region(C); + MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; MovieTrackingTrack *track; @@ -535,13 +544,13 @@ static int circle_select_exec(bContext *C, wmOperator *op) mode = RNA_int_get(op->ptr, "gesture_mode"); /* compute ellipse and position in unified coordinates */ - ED_space_clip_get_size(C, &width, &height); - ED_space_clip_get_zoom(C, &zoomx, &zoomy); + ED_space_clip_get_size(sc, &width, &height); + ED_space_clip_get_zoom(sc, ar, &zoomx, &zoomy); ellipse[0] = width * zoomx / radius; ellipse[1] = height * zoomy / radius; - ED_clip_point_stable_pos(C, x, y, &offset[0], &offset[1]); + ED_clip_point_stable_pos(sc, ar, x, y, &offset[0], &offset[1]); /* do selection */ track = tracksbase->first; |