summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/edje/edje_util.c7
-rw-r--r--src/tests/edje/edje_test_edje.c6
2 files changed, 11 insertions, 2 deletions
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index 8db4ffd9a3..1b772d4be7 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -3274,7 +3274,7 @@ EOLIAN Eina_Rectangle
3274_edje_object_efl_canvas_layout_calc_calc_parts_extends(Eo *obj EINA_UNUSED, Edje *ed) 3274_edje_object_efl_canvas_layout_calc_calc_parts_extends(Eo *obj EINA_UNUSED, Edje *ed)
3275{ 3275{
3276 Evas_Coord xx1 = INT_MAX, yy1 = INT_MAX; 3276 Evas_Coord xx1 = INT_MAX, yy1 = INT_MAX;
3277 Evas_Coord xx2 = 0, yy2 = 0; 3277 Evas_Coord xx2 = 0, yy2 = 0, w = 0, h = 0;
3278 unsigned short i; 3278 unsigned short i;
3279 3279
3280 ed->calc_only = EINA_TRUE; 3280 ed->calc_only = EINA_TRUE;
@@ -3304,7 +3304,10 @@ _edje_object_efl_canvas_layout_calc_calc_parts_extends(Eo *obj EINA_UNUSED, Edje
3304 3304
3305 ed->calc_only = EINA_FALSE; 3305 ed->calc_only = EINA_FALSE;
3306 3306
3307 return (Eina_Rectangle) { xx1, yy1, xx2 - xx1, yy2 - yy1 }; 3307 if ((xx2 - xx1) > 0) w = xx2 - xx1;
3308 if ((yy2 - yy1) > 0) h = yy2 - yy1;
3309
3310 return (Eina_Rectangle) { xx1, yy1, w, h };
3308} 3311}
3309 3312
3310EOLIAN Eina_Size2D 3313EOLIAN Eina_Size2D
diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c
index c47dccb693..3ea0a34acf 100644
--- a/src/tests/edje/edje_test_edje.c
+++ b/src/tests/edje/edje_test_edje.c
@@ -151,8 +151,14 @@ START_TEST(edje_test_calculate_parens)
151 int x, y, w, h; 151 int x, y, w, h;
152 Evas *evas = EDJE_TEST_INIT_EVAS(); 152 Evas *evas = EDJE_TEST_INIT_EVAS();
153 Evas_Object *obj; 153 Evas_Object *obj;
154 Eina_Rect rect;
154 155
155 obj = edje_object_add(evas); 156 obj = edje_object_add(evas);
157
158 /* A negative test case for efl_canvas_layout_calc_parts_extends */
159 rect = efl_canvas_layout_calc_parts_extends(obj);
160 fail_if(rect.w < 0 || rect.h < 0);
161
156 fail_unless(edje_object_file_set(obj, test_layout_get("test_parens.edj"), "test_group")); 162 fail_unless(edje_object_file_set(obj, test_layout_get("test_parens.edj"), "test_group"));
157 163
158 evas_object_resize(obj, 100, 100); 164 evas_object_resize(obj, 100, 100);