summaryrefslogtreecommitdiff
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
parent74cee52900fa31d01fc68b4735ccd3185cd89859 (diff)
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>
-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,
103 const Efl_VG *from, const Efl_VG *to, 103 const Efl_VG *from, const Efl_VG *to,
104 double pos_map) 104 double pos_map)
105{ 105{
106 Efl_VG_Container_Data *fd; 106 Eina_Iterator *from_it, *to_it;
107 Efl_VG_Container_Data *td; 107 Eina_List *l;
108 Eina_Iterator *it; 108 Eina_Bool r, res = EINA_TRUE;
109 Eina_Hash_Tuple *tuple; 109 Eo *from_child, *to_child, *child;
110 Eina_Bool r; 110
111 //1. check if both the object are containers
112 if (!(eo_isa(from, EFL_VG_CONTAINER_CLASS) &&
113 eo_isa(to, EFL_VG_CONTAINER_CLASS)))
114 return EINA_FALSE;
111 115
112 r = efl_vg_interpolate(eo_super(obj, EFL_VG_CONTAINER_CLASS), from, to, pos_map); 116 r = efl_vg_interpolate(eo_super(obj, EFL_VG_CONTAINER_CLASS), from, to, pos_map);
113 117
114 if (!r) return EINA_FALSE; 118 if (!r) return EINA_FALSE;
115 119
116 fd = eo_data_scope_get(from, EFL_VG_CONTAINER_CLASS); 120 from_it = efl_vg_container_children_get((Efl_VG *)from);
117 td = eo_data_scope_get(to, EFL_VG_CONTAINER_CLASS); 121 to_it = efl_vg_container_children_get((Efl_VG *)to);
118 122 EINA_LIST_FOREACH (pd->children, l, child)
119 it = eina_hash_iterator_tuple_new(pd->names);
120 EINA_ITERATOR_FOREACH(it, tuple)
121 { 123 {
122 Eo *fromc, *toc; 124 res &= eina_iterator_next(from_it, (void **)&from_child);
123 Eo *cc = tuple->data; 125 res &= eina_iterator_next(to_it, (void **)&to_child);
124 126 if (!res && (eo_class_get(from_child) != eo_class_get(to_child) ||
125 fromc = eina_hash_find(fd->names, tuple->key); 127 (eo_class_get(child) != eo_class_get(from_child))))
126 toc = eina_hash_find(td->names, tuple->key); 128 {
127 129 r = EINA_FALSE;
128 if (!toc || !fromc) continue ; 130 break;
129 if (eo_class_get(toc) != eo_class_get(fromc)) continue ; 131 }
130 132 r &= efl_vg_interpolate(child, from_child, to_child, pos_map);
131 r &= efl_vg_interpolate(cc, fromc, toc, pos_map); 133 if (!r)
134 break;
132 } 135 }
133 eina_iterator_free(it); 136 eina_iterator_free(from_it);
137 eina_iterator_free(to_it);
134 138
135 return r; 139 return r;
136} 140}