cedric pushed a commit to branch master.

commit 70f0f9c6b52bdca433af735c123b3156bad04acf
Author: Cedric Bail <[email protected]>
Date:   Sun Apr 7 23:44:44 2013 +0900

    evas: get the bounding box from the right object and always update it.
---
 src/lib/evas/canvas/evas_object_smart.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/lib/evas/canvas/evas_object_smart.c 
b/src/lib/evas/canvas/evas_object_smart.c
index 19ecf3d..1a95fce 100644
--- a/src/lib/evas/canvas/evas_object_smart.c
+++ b/src/lib/evas/canvas/evas_object_smart.c
@@ -1211,6 +1211,7 @@ evas_object_update_bounding_box(Evas_Object *eo_obj, 
Evas_Object_Protected_Data
    Eina_Bool noclip;
 
    if (!obj->smart.parent) return ;
+
    if (obj->child_has_map) return ; /* Disable bounding box computation for 
this object and its parent */
    /* We could also remove object that are not visible from the bounding box, 
use the clipping information
       to reduce the bounding of the object they are clipping, but for the 
moment this will do it's jobs */
@@ -1489,7 +1490,8 @@ evas_object_smart_bounding_box_update(Evas_Object 
*eo_obj, Evas_Object_Protected
 
    os = eo_data_get(eo_obj, MY_CLASS);
 
-   if (!os->update_boundingbox_needed) return ;
+   // FIXME: disable optimization and always rebuild the child map for now.
+   /* if (!os->update_boundingbox_needed) return ; */
    os->update_boundingbox_needed = EINA_FALSE;
 
    minx = obj->layer->evas->output.w;
@@ -1506,14 +1508,16 @@ evas_object_smart_bounding_box_update(Evas_Object 
*eo_obj, Evas_Object_Protected
         if (o == obj) continue ;
         if (o->clip.clipees || o->is_static_clip) continue ;
 
-        if (o->is_smart)
+       if (o->is_smart)
           {
+            Evas_Object_Smart *s = eo_data_get(o->object, MY_CLASS);
+
              evas_object_smart_bounding_box_update(o->object, o);
 
-             tx = os->cur.bounding_box.x;
-             ty = os->cur.bounding_box.y;
-             tw = os->cur.bounding_box.x + os->cur.bounding_box.w;
-             th = os->cur.bounding_box.y + os->cur.bounding_box.h;
+             tx = s->cur.bounding_box.x;
+             ty = s->cur.bounding_box.y;
+             tw = s->cur.bounding_box.x + s->cur.bounding_box.w;
+             th = s->cur.bounding_box.y + s->cur.bounding_box.h;
           }
         else
           {

-- 

------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html

Reply via email to