svn merge ^/trunk/blender -r47603:47611
[blender.git] / source / blender / editors / transform / transform_generics.c
index e0920e323aa7608a377fe98895ea260a70b73ba5..1b8cc14ecacb6e1acf0454dc666f663c27d74316 100644 (file)
@@ -643,23 +643,30 @@ static void recalcData_spaceclip(TransInfo *t)
                MovieClip *clip = ED_space_clip(sc);
                ListBase *tracksbase = BKE_tracking_get_tracks(&clip->tracking);
                MovieTrackingTrack *track;
+               int framenr = sc->user.framenr;
 
                flushTransTracking(t);
 
                track = tracksbase->first;
                while (track) {
                        if (TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_LOCKED)==0) {
+                               MovieTrackingMarker *marker = BKE_tracking_get_marker(track, framenr);
+
                                if (t->mode == TFM_TRANSLATION) {
                                        if (TRACK_AREA_SELECTED(track, TRACK_AREA_PAT))
-                                               BKE_tracking_clamp_track(track, CLAMP_PAT_POS);
+                                               BKE_tracking_clamp_marker(marker, CLAMP_PAT_POS);
                                        if (TRACK_AREA_SELECTED(track, TRACK_AREA_SEARCH))
-                                               BKE_tracking_clamp_track(track, CLAMP_SEARCH_POS);
+                                               BKE_tracking_clamp_marker(marker, CLAMP_SEARCH_POS);
                                }
                                else if (t->mode == TFM_RESIZE) {
                                        if (TRACK_AREA_SELECTED(track, TRACK_AREA_PAT))
-                                               BKE_tracking_clamp_track(track, CLAMP_PAT_DIM);
+                                               BKE_tracking_clamp_marker(marker, CLAMP_PAT_DIM);
                                        if (TRACK_AREA_SELECTED(track, TRACK_AREA_SEARCH))
-                                               BKE_tracking_clamp_track(track, CLAMP_SEARCH_DIM);
+                                               BKE_tracking_clamp_marker(marker, CLAMP_SEARCH_DIM);
+                               }
+                               else if (t->mode == TFM_ROTATION) {
+                                       if (TRACK_AREA_SELECTED(track, TRACK_AREA_PAT))
+                                               BKE_tracking_clamp_marker(marker, CLAMP_PAT_POS);
                                }
                        }