Cleanup: Clarify function name and comment logic

This is a bit tricky exceptional case, which originates to an original
motion tracking commit. Took a while to remember what it is ab out so
here is a comment for the future developers.
This commit is contained in:
Sergey Sharybin 2022-05-12 17:15:18 +02:00
parent ccd18691fc
commit b24f204e91
3 changed files with 10 additions and 6 deletions

View File

@ -187,10 +187,10 @@ void clip_draw_sfra_efra(struct View2D *v2d, struct Scene *scene);
/* tracking_ops.c */
/* Find track in a proximity of the given event.
/* Find track which can be slid in a proximity of the given event.
* Uses the same rules w.r.t distance tolerances for track sliding and selection operators. */
struct MovieTrackingTrack *tracking_find_track_in_proximity(struct bContext *C,
const struct wmEvent *event);
struct MovieTrackingTrack *tracking_find_slidable_track_in_proximity(struct bContext *C,
const struct wmEvent *event);
void CLIP_OT_add_marker(struct wmOperatorType *ot);
void CLIP_OT_add_marker_at_click(struct wmOperatorType *ot);

View File

@ -655,8 +655,8 @@ static MovieTrackingTrack *tracking_marker_check_slide(
return NULL;
}
struct MovieTrackingTrack *tracking_find_track_in_proximity(struct bContext *C,
const struct wmEvent *event)
struct MovieTrackingTrack *tracking_find_slidable_track_in_proximity(struct bContext *C,
const struct wmEvent *event)
{
return tracking_marker_check_slide(C, event, NULL, NULL, NULL);
}

View File

@ -405,8 +405,12 @@ static int select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
float co[2];
const bool extend = RNA_boolean_get(op->ptr, "extend");
/* Special code which allows to slide a marker which belongs to currently selected but not yet
* active track. If such track is found activate it and return pass-though so that marker slide
* operator can be used immediately after.
* This logic makes it convenient to slide markers when left mouse selection is used. */
if (!extend) {
MovieTrackingTrack *track = tracking_find_track_in_proximity(C, event);
MovieTrackingTrack *track = tracking_find_slidable_track_in_proximity(C, event);
if (track != NULL) {
MovieClip *clip = ED_space_clip_get_clip(sc);