discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=567802f251b105b7ac2820c073011c9ef28d08b3

commit 567802f251b105b7ac2820c073011c9ef28d08b3
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Fri Mar 6 17:59:43 2015 -0500

    fix crash when using e_comp_object_util_center_pos_get() with non 
comp_objects
---
 src/bin/e_comp_object.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c
index 2ed543c..b83fcae 100644
--- a/src/bin/e_comp_object.c
+++ b/src/bin/e_comp_object.c
@@ -2646,12 +2646,17 @@ e_comp_object_util_center_pos_get(Evas_Object *obj, int 
*x, int *y)
 {
    E_Zone *zone;
    int zx, zy, zw, zh;
+   int ow, oh;
    SOFT_ENTRY();
 
+   if (cw)
+     ow = cw->w, oh = cw->h;
+   else
+     evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
    zone = e_comp_object_util_zone_get(obj);
    e_zone_useful_geometry_get(zone, &zx, &zy, &zw, &zh);
-   if (x) *x = zx + (zw - cw->w) / 2;
-   if (y) *y = zy + (zh - cw->h) / 2;
+   if (x) *x = zx + (zw - ow) / 2;
+   if (y) *y = zy + (zh - oh) / 2;
 }
 
 EAPI void

-- 


Reply via email to