elm_animation_view: Fix play/play_back behavior
authorJunsuChoi <jsuya.choi@samsung.com>
Thu, 2 Jan 2020 07:57:39 +0000 (16:57 +0900)
committerJunsuChoi <jsuya.choi@samsung.com>
Mon, 6 Jan 2020 00:34:53 +0000 (09:34 +0900)
Summary:
In elm_animation_view(legacy), play means forward and play_back backward.
So change the sign of the speed value for control.

Test Plan: N/A

Reviewers: Hermet, smohanty, kimcinoo

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10995

src/lib/elementary/efl_ui_vg_animation_eo.legacy.c

index eca7abf..ad99d1b 100644 (file)
@@ -70,6 +70,8 @@ elm_animation_view_frame_get(const Efl_Ui_Vg_Animation *obj)
 EAPI Eina_Bool
 elm_animation_view_play(Efl_Ui_Vg_Animation *obj)
 {
+   double speed = efl_player_playback_speed_get(obj);
+   efl_player_playback_speed_set(obj, speed < 0 ? speed * -1 : speed);
    return efl_player_playing_set(obj, EINA_TRUE);
 }
 
@@ -77,7 +79,7 @@ EAPI Eina_Bool
 elm_animation_view_play_back(Efl_Ui_Vg_Animation *obj)
 {
    double speed = efl_player_playback_speed_get(obj);
-   efl_player_playback_speed_set(obj, speed < 0 ? speed * -1 : speed);
+   efl_player_playback_speed_set(obj, speed > 0 ? speed * -1 : speed);
    return efl_player_playing_set(obj, EINA_TRUE);
 }