Label: better speed/duration calculation.
authordavemds <dave@gurumeditation.it>
Mon, 10 Feb 2014 21:53:26 +0000 (22:53 +0100)
committerdavemds <dave@gurumeditation.it>
Mon, 10 Feb 2014 21:53:26 +0000 (22:53 +0100)
This fix the speed calculation with slide_short and slide_bounce
animation. Previously the calc was right only for slide_long.

legacy/elementary/src/lib/elm_label.c

index 96591a4..5b46f3a 100644 (file)
@@ -130,15 +130,19 @@ _label_slide_change(Evas_Object *obj)
           }
 
         // calculate speed or duration
+        if (!strcmp(elm_object_style_get(obj), "slide_long"))
+          w = tb_w + w;
+        else // slide_short or slide_bounce
+          w = tb_w - w;
         if (sd->use_slide_speed)
           {
              if (sd->slide_speed <= 0) sd->slide_speed = 1;
-             sd->slide_duration = (tb_w + w) / sd->slide_speed;
+             sd->slide_duration = w / sd->slide_speed;
           }
         else
           {
              if (sd->slide_duration <= 0) sd->slide_duration = 1;
-             sd->slide_speed = (tb_w + w) / sd->slide_duration;
+             sd->slide_speed = w / sd->slide_duration;
           }
 
         Edje_Message_Float_Set *msg =