diff options
author | Sergey Sharybin <sergey@blender.org> | 2022-05-13 18:14:28 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2022-05-13 18:18:25 +0300 |
commit | a80ad0a54578d6e92695dced22538bdca3c8e1a7 (patch) | |
tree | 748b479579585a806ce0e7dfdaa9a51b7c062453 /source/blender/editors/space_clip/tracking_ops.c | |
parent | 4680331749aa716fe01445c473308f3ff80ec8c9 (diff) |
Refactor: Use coordinate in API for track selection
Currently no functional changes. Prepares for a change which will
allow to more consistently redo the track selection operator.
Diffstat (limited to 'source/blender/editors/space_clip/tracking_ops.c')
-rw-r--r-- | source/blender/editors/space_clip/tracking_ops.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c index 8cddd0ab23b..ca224b04da5 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -528,11 +528,10 @@ static bool slide_check_corners(float (*corners)[2]) } static MovieTrackingTrack *tracking_marker_check_slide( - bContext *C, const wmEvent *event, int *r_area, eSlideAction *r_action, int *r_corner) + bContext *C, const float co[2], int *r_area, eSlideAction *r_action, int *r_corner) { const float distance_clip_squared = 12.0f * 12.0f; SpaceClip *sc = CTX_wm_space_clip(C); - ARegion *region = CTX_wm_region(C); MovieClip *clip = ED_space_clip_get_clip(sc); ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking); const int framenr = ED_space_clip_get_clip_frame_number(sc); @@ -549,9 +548,6 @@ static MovieTrackingTrack *tracking_marker_check_slide( return NULL; } - float co[2]; - ED_clip_mouse_pos(sc, region, event->mval, co); - LISTBASE_FOREACH (MovieTrackingTrack *, track, tracksbase) { if (!TRACK_VIEW_SELECTED(sc, track) || (track->flag & TRACK_LOCKED)) { continue; @@ -640,9 +636,9 @@ static MovieTrackingTrack *tracking_marker_check_slide( } struct MovieTrackingTrack *tracking_find_slidable_track_in_proximity(struct bContext *C, - const struct wmEvent *event) + const float co[2]) { - return tracking_marker_check_slide(C, event, NULL, NULL, NULL); + return tracking_marker_check_slide(C, co, NULL, NULL, NULL); } static void *slide_marker_customdata(bContext *C, const wmEvent *event) @@ -666,7 +662,7 @@ static void *slide_marker_customdata(bContext *C, const wmEvent *event) ED_clip_mouse_pos(sc, region, event->mval, co); - track = tracking_marker_check_slide(C, event, &area, &action, &corner); + track = tracking_marker_check_slide(C, co, &area, &action, &corner); if (track != NULL) { MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr); customdata = create_slide_marker_data( |