summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorJunsuChoi <jsuya.choi@samsung.com>2020-01-07 15:52:06 +0900
committerHermet Park <hermetpark@gmail.com>2020-01-07 15:52:06 +0900
commit5196484832716a8fdd566e132bfdb5f9247078f3 (patch)
treea9f431827a2d82b548e0bb150c905b68999d113c /src/lib
parent0313104719992737ac5783714bd9988e2c363ca4 (diff)
Efl.Ui.Vg_Animation: Fix state when changed speed
Summary: If speed's direction changed, change state. Test Plan: N/A Reviewers: Hermet, kimcinoo, smohanty Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11021
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/elementary/efl_ui_vg_animation.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/lib/elementary/efl_ui_vg_animation.c b/src/lib/elementary/efl_ui_vg_animation.c
index 72d54cdcad..8e4339b760 100644
--- a/src/lib/elementary/efl_ui_vg_animation.c
+++ b/src/lib/elementary/efl_ui_vg_animation.c
@@ -780,11 +780,22 @@ _efl_ui_vg_animation_efl_player_playback_progress_set(Eo *obj EINA_UNUSED, Efl_U
780EOLIAN static void 780EOLIAN static void
781_efl_ui_vg_animation_efl_player_playback_speed_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, double speed) 781_efl_ui_vg_animation_efl_player_playback_speed_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, double speed)
782{ 782{
783 Eina_Bool rewind = EINA_FALSE;
784
785 if ((pd->playback_speed > 0 && speed < 0) || (pd->playback_speed < 0 && speed > 0))
786 rewind = EINA_TRUE;
787
783 // pd->playback_direction_changed is used only during playback. 788 // pd->playback_direction_changed is used only during playback.
784 if ((pd->state == EFL_UI_VG_ANIMATION_STATE_PLAYING || 789 if (pd->state == EFL_UI_VG_ANIMATION_STATE_PLAYING && rewind)
785 pd->state == EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS) 790 {
786 && ((pd->playback_speed > 0 && speed < 0) || (pd->playback_speed < 0 && speed > 0))) 791 pd->state = EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS;
787 pd->playback_direction_changed = EINA_TRUE; 792 pd->playback_direction_changed = EINA_TRUE;
793 }
794 else if (pd->state == EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS && rewind)
795 {
796 pd->state = EFL_UI_VG_ANIMATION_STATE_PLAYING;
797 pd->playback_direction_changed = EINA_TRUE;
798 }
788 799
789 pd->playback_speed = speed; 800 pd->playback_speed = speed;
790 speed = speed < 0 ? speed * -1 : speed; 801 speed = speed < 0 ? speed * -1 : speed;