forked from enlightenment/efl
elementary/transit - make simpler code and don't overflow the image index
SVN revision: 83346
This commit is contained in:
parent
52f8ae6834
commit
741fde0abb
|
@ -2328,6 +2328,8 @@ _transit_effect_image_animation_context_free(Elm_Transit_Effect *effect, Elm_Tra
|
|||
const char *image;
|
||||
Eina_List *elist, *elist_next;
|
||||
|
||||
//FIXME: Reset the image to first one.
|
||||
|
||||
EINA_LIST_FOREACH_SAFE(image_animation->images, elist, elist_next, image)
|
||||
{
|
||||
image_animation->images =
|
||||
|
@ -2351,11 +2353,13 @@ _transit_effect_image_animation_op(Elm_Transit_Effect *effect, Elm_Transit *tran
|
|||
int len;
|
||||
|
||||
len = eina_list_count(image_animation->images);
|
||||
if (len)
|
||||
{
|
||||
if (len <= 0) return;
|
||||
|
||||
idx = floor(progress * len);
|
||||
if (image_animation->prev_idx != idx)
|
||||
{
|
||||
if ((int)idx >= len) return;
|
||||
|
||||
if (image_animation->prev_idx == idx) return;
|
||||
|
||||
type = eina_stringshare_add("elm_image");
|
||||
//FIXME: Remove later when elm_icon is cleared.
|
||||
type_deprecated = eina_stringshare_add("elm_icon");
|
||||
|
@ -2376,10 +2380,8 @@ _transit_effect_image_animation_op(Elm_Transit_Effect *effect, Elm_Transit *tran
|
|||
eina_stringshare_del(type);
|
||||
eina_stringshare_del(type_deprecated);
|
||||
|
||||
}
|
||||
image_animation->prev_idx = idx;
|
||||
}
|
||||
}
|
||||
|
||||
static Elm_Transit_Effect *
|
||||
_transit_effect_image_animation_context_new(Eina_List *images)
|
||||
|
|
Loading…
Reference in New Issue