efl_ui_active_view_manager_*: fix bugging animation
Summary: we should protect against multiple requests to the same "to" index. Otherwise either the speed could increase dramatically, or we start to oscilate arround the final position, based on the progress sign. Those ifs here are fixing it. fix T7988 Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T7988 Differential Revision: https://phab.enlightenment.org/D9056
This commit is contained in:
parent
9cba6a4f0e
commit
65deb248e3
|
@ -233,6 +233,13 @@ _page_set_animation(void *data, const Efl_Event *event EINA_UNUSED)
|
||||||
static void
|
static void
|
||||||
_animation_request_switch(Eo *obj, Efl_Ui_Active_View_View_Manager_Scroll_Data *pd, int from, int to)
|
_animation_request_switch(Eo *obj, Efl_Ui_Active_View_View_Manager_Scroll_Data *pd, int from, int to)
|
||||||
{
|
{
|
||||||
|
//if there is already a transition ongoing, which is no mouse transition, but goes to the same position, then do nothing
|
||||||
|
if (pd->transition.active && !pd->mouse_move.active && pd->transition.to == to)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!pd->transition.active && !pd->mouse_move.active && from == to)
|
||||||
|
return;
|
||||||
|
|
||||||
efl_event_callback_del(pd->container, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _page_set_animation, obj);
|
efl_event_callback_del(pd->container, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _page_set_animation, obj);
|
||||||
//if there is a ongoing transition, try to guess a better time, and try copy over the position where we are right now
|
//if there is a ongoing transition, try to guess a better time, and try copy over the position where we are right now
|
||||||
if (pd->transition.active || pd->mouse_move.active)
|
if (pd->transition.active || pd->mouse_move.active)
|
||||||
|
|
|
@ -182,6 +182,9 @@ _setup_anim(Efl_Animation_Player *player, Efl_Gfx_Entity *entity)
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_efl_ui_active_view_view_manager_stack_efl_ui_active_view_view_manager_switch_to(Eo *obj, Efl_Ui_Active_View_View_Manager_Stack_Data *pd, int from, int to)
|
_efl_ui_active_view_view_manager_stack_efl_ui_active_view_view_manager_switch_to(Eo *obj, Efl_Ui_Active_View_View_Manager_Stack_Data *pd, int from, int to)
|
||||||
{
|
{
|
||||||
|
if (efl_pack_content_get(pd->container, to) == pd->content)
|
||||||
|
return;
|
||||||
|
|
||||||
if (from != -1)
|
if (from != -1)
|
||||||
{
|
{
|
||||||
if (pd->animation)
|
if (pd->animation)
|
||||||
|
|
Loading…
Reference in New Issue