Time-Slide Fix:
authorJoshua Leung <aligorith@gmail.com>
Thu, 2 Jun 2011 11:58:13 +0000 (11:58 +0000)
committerJoshua Leung <aligorith@gmail.com>
Thu, 2 Jun 2011 11:58:13 +0000 (11:58 +0000)
Second attempt at fix for only having a single-key selected. In this
case, it just uses the start/end frame as it's min/max

source/blender/editors/transform/transform_conversions.c

index 29eea932a56a2078c1e0df611ee2e849c42c5f7d..29fc514f01fde8b53e0394c0b8340e07a121228a 100644 (file)
@@ -3129,18 +3129,15 @@ static void createTransActionData(bContext *C, TransInfo *t)
        /* check if we're supposed to be setting minx/maxx for TimeSlide */
        if (t->mode == TFM_TIME_SLIDE) {
                float min=999999999.0f, max=-999999999.0f;
+               int i;
                
-               if (count > 1) {
-                       /* search for min/max selected values to transform */
-                       int i;
-                       
-                       td= t->data;
-                       for (i=0; i < count; i++, td++) {
-                               if (min > *(td->val)) min= *(td->val);
-                               if (max < *(td->val)) max= *(td->val);
-                       }
+               td= t->data;
+               for (i=0; i < count; i++, td++) {
+                       if (min > *(td->val)) min= *(td->val);
+                       if (max < *(td->val)) max= *(td->val);
                }
-               else {
+               
+               if (min == max) {
                        /* just use the current frame ranges */
                        min = (float)PSFRA;
                        max = (float)PEFRA;