aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/evas/canvas/evas_vg_container.c
diff options
context:
space:
mode:
authorSubhransu Mohanty <sub.mohanty@samsung.com>2016-05-19 01:39:44 -0700
committerCedric Bail <cedric@osg.samsung.com>2016-05-19 02:23:56 -0700
commita3cdafe9a25b2f12a1ba3dc7d99df1fda23c5fd1 (patch)
tree96c4877d5c06f3ac2cc41cd70c97ee090c5d4b88 /src/lib/evas/canvas/evas_vg_container.c
parentevas: fix the ref issue of newly created object in shape_dup() function (diff)
downloadefl-a3cdafe9a25b2f12a1ba3dc7d99df1fda23c5fd1.tar.gz
evas: changed the interpolate() implementaion
Reviewers: Hermet, cedric Reviewed By: cedric Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D3960 Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/evas/canvas/evas_vg_container.c')
-rw-r--r--src/lib/evas/canvas/evas_vg_container.c46
1 files changed, 25 insertions, 21 deletions
diff --git a/src/lib/evas/canvas/evas_vg_container.c b/src/lib/evas/canvas/evas_vg_container.c
index a805902d19..b34d137fba 100644
--- a/src/lib/evas/canvas/evas_vg_container.c
+++ b/src/lib/evas/canvas/evas_vg_container.c
@@ -103,34 +103,38 @@ _efl_vg_container_efl_vg_interpolate(Eo *obj,
const Efl_VG *from, const Efl_VG *to,
double pos_map)
{
- Efl_VG_Container_Data *fd;
- Efl_VG_Container_Data *td;
- Eina_Iterator *it;
- Eina_Hash_Tuple *tuple;
- Eina_Bool r;
+ Eina_Iterator *from_it, *to_it;
+ Eina_List *l;
+ Eina_Bool r, res = EINA_TRUE;
+ Eo *from_child, *to_child, *child;
+
+ //1. check if both the object are containers
+ if (!(eo_isa(from, EFL_VG_CONTAINER_CLASS) &&
+ eo_isa(to, EFL_VG_CONTAINER_CLASS)))
+ return EINA_FALSE;
r = efl_vg_interpolate(eo_super(obj, EFL_VG_CONTAINER_CLASS), from, to, pos_map);
if (!r) return EINA_FALSE;
- fd = eo_data_scope_get(from, EFL_VG_CONTAINER_CLASS);
- td = eo_data_scope_get(to, EFL_VG_CONTAINER_CLASS);
-
- it = eina_hash_iterator_tuple_new(pd->names);
- EINA_ITERATOR_FOREACH(it, tuple)
+ from_it = efl_vg_container_children_get((Efl_VG *)from);
+ to_it = efl_vg_container_children_get((Efl_VG *)to);
+ EINA_LIST_FOREACH (pd->children, l, child)
{
- Eo *fromc, *toc;
- Eo *cc = tuple->data;
-
- fromc = eina_hash_find(fd->names, tuple->key);
- toc = eina_hash_find(td->names, tuple->key);
-
- if (!toc || !fromc) continue ;
- if (eo_class_get(toc) != eo_class_get(fromc)) continue ;
-
- r &= efl_vg_interpolate(cc, fromc, toc, pos_map);
+ res &= eina_iterator_next(from_it, (void **)&from_child);
+ res &= eina_iterator_next(to_it, (void **)&to_child);
+ if (!res && (eo_class_get(from_child) != eo_class_get(to_child) ||
+ (eo_class_get(child) != eo_class_get(from_child))))
+ {
+ r = EINA_FALSE;
+ break;
+ }
+ r &= efl_vg_interpolate(child, from_child, to_child, pos_map);
+ if (!r)
+ break;
}
- eina_iterator_free(it);
+ eina_iterator_free(from_it);
+ eina_iterator_free(to_it);
return r;
}