summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_vg_container.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2015-04-03 16:13:12 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-04-03 16:13:12 +0200
commit1e5c596ca3ddb03e16aae5f2b1418a59cc9db699 (patch)
treeee10d8df2d704326d6cc8de150bfb977608da745 /src/lib/evas/canvas/evas_vg_container.c
parent7f072eb607485d6cd34e4a96feb7d246062d229f (diff)
evas: implement stupid bound get at container level.
Diffstat (limited to 'src/lib/evas/canvas/evas_vg_container.c')
-rw-r--r--src/lib/evas/canvas/evas_vg_container.c32
1 files changed, 27 insertions, 5 deletions
diff --git a/src/lib/evas/canvas/evas_vg_container.c b/src/lib/evas/canvas/evas_vg_container.c
index 4bedd86..3459f4a 100644
--- a/src/lib/evas/canvas/evas_vg_container.c
+++ b/src/lib/evas/canvas/evas_vg_container.c
@@ -6,19 +6,41 @@
6#define MY_CLASS EVAS_VG_CONTAINER_CLASS 6#define MY_CLASS EVAS_VG_CONTAINER_CLASS
7 7
8void 8void
9_evas_vg_container_eo_base_constructor(Eo *obj, Evas_VG_Container_Data *pd) 9_evas_vg_container_eo_base_constructor(Eo *obj,
10 Evas_VG_Container_Data *pd EINA_UNUSED)
10{ 11{
11 Eo *parent;
12
13 eo_do_super(obj, MY_CLASS, eo_constructor()); 12 eo_do_super(obj, MY_CLASS, eo_constructor());
14} 13}
15 14
16Eina_Bool 15Eina_Bool
17_evas_vg_container_evas_vg_node_bound_get(Eo *obj, 16_evas_vg_container_evas_vg_node_bound_get(Eo *obj EINA_UNUSED,
18 Evas_VG_Container_Data *pd, 17 Evas_VG_Container_Data *pd,
19 Eina_Rectangle *r) 18 Eina_Rectangle *r)
20{ 19{
21 // FIXME: iterate children and get their boundary to 20 Eina_Rectangle s;
21 Eina_Bool first = EINA_TRUE;
22 Eina_List *l;
23 Eo *child;
24
25 if (!r) return EINA_FALSE;
26
27 EINA_RECTANGLE_SET(&s, -1, -1, 0, 0);
28
29 EINA_LIST_FOREACH(pd->children, l, child)
30 {
31 if (first)
32 {
33 eo_do(child, evas_vg_node_bound_get(r));
34 first = EINA_FALSE;
35 }
36 else
37 {
38 eo_do(child, evas_vg_node_bound_get(&s));
39 eina_rectangle_union(r, &s);
40 }
41 }
42 // returning EINA_FALSE if no bouding box was found
43 return first ? EINA_FALSE : EINA_TRUE;
22} 44}
23 45
24 46