forked from enlightenment/efl
efl_ui_animation_view: Update callback is called only actual change time.
Summary: The transit_cb is called from 0 to 1 depending on the duration. Since the update callback is called even if there is no actual change, we change it to call when there is a change in the frame. Test Plan: N/A Reviewers: Hermet, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8715
This commit is contained in:
parent
5e014df906
commit
81e5ad8715
|
@ -172,7 +172,10 @@ _transit_cb(Elm_Transit_Effect *effect, Elm_Transit *transit, double progress)
|
|||
pd->progress = progress;
|
||||
int minframe = (pd->frame_cnt - 1) * pd->min_progress;
|
||||
int maxframe = (pd->frame_cnt - 1) * pd->max_progress;
|
||||
evas_object_vg_animated_frame_set(pd->vg, (int)((maxframe - minframe) * progress) + minframe);
|
||||
|
||||
int update_frame = (int)((maxframe - minframe) * progress) + minframe;
|
||||
int current_frame = evas_object_vg_animated_frame_get(pd->vg);
|
||||
evas_object_vg_animated_frame_set(pd->vg, update_frame);
|
||||
|
||||
if (pd->auto_repeat)
|
||||
{
|
||||
|
@ -184,7 +187,10 @@ _transit_cb(Elm_Transit_Effect *effect, Elm_Transit *transit, double progress)
|
|||
}
|
||||
}
|
||||
|
||||
evas_object_smart_callback_call(pd->obj, SIG_PLAY_UPDATE, NULL);
|
||||
//transit_cb is always called with a progress value 0 ~ 1.
|
||||
//SIG_PLAY_UPDATE callback is called only when there is a real change.
|
||||
if (update_frame != current_frame)
|
||||
evas_object_smart_callback_call(pd->obj, SIG_PLAY_UPDATE, NULL);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
|
|
Loading…
Reference in New Issue