[elm_widget] fixed bug in elm widget show function
authorMyungjae Lee <mjae.lee@samsung.com>
Tue, 7 Sep 2010 06:18:59 +0000 (15:18 +0900)
committerMyungjae Lee <mjae.lee@samsung.com>
Tue, 7 Sep 2010 06:18:59 +0000 (15:18 +0900)
src/lib/elm_widget.c

index b417271..a4267b7 100644 (file)
@@ -794,22 +794,33 @@ elm_widget_show_region_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Co
    sd->rh = h;
    if (sd->on_show_region_func)
      sd->on_show_region_func(sd->on_show_region_data, obj);
-   else
-     {
-       Evas_Object *parent_obj;
+     
+       Evas_Object *parent_obj, *child_obj;
+       Evas_Coord px, py, cx, cy;
        do
          {
-            parent_obj = sd->parent_obj;                
+            parent_obj = sd->parent_obj; 
+                child_obj = sd->obj;
             sd = evas_object_smart_data_get(parent_obj);
+
             if ((!parent_obj) || (!sd) || (!_elm_widget_is(parent_obj))) break;
+
+                evas_object_geometry_get(parent_obj, &px, &py, NULL, NULL);
+                evas_object_geometry_get(child_obj, &cx, &cy, NULL, NULL);
+
+                x += (cx - px);
+                y += (cy - py);
+                sd->rx = x;
+                sd->ry = y;
+                sd->rw = w;
+                sd->rh = h;
+
             if (sd->on_show_region_func)
               {
-                 sd->on_show_region_func(sd->on_show_region_data, obj);
-                 break;
+                 sd->on_show_region_func(sd->on_show_region_data, parent_obj);
               }
          }
        while (parent_obj);
-     }
 }
 
 EAPI void