evas table: fix miscalcuation in cells with span and padding
authorJee-Yong Um <jc9.um@samsung.com>
Mon, 19 Oct 2015 18:01:22 +0000 (11:01 -0700)
committerCedric BAIL <cedric@osg.samsung.com>
Mon, 19 Oct 2015 18:01:23 +0000 (11:01 -0700)
Summary:
In evas table that homogeneous mode is turned off,
the size of items in cells, whose rowspan or colspan is larger than 1
and horizontal or vertical padding exists, are miscalculatd.

T2655

@fix

Test Plan: elementary_test "Table Padding"

Reviewers: Hermet, cedric

Subscribers: cedric, DaveMDS, Hermet

Differential Revision: https://phab.enlightenment.org/D3192

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
src/lib/evas/canvas/evas_object_table.c

index 5a4cfcb..0c8ea11 100644 (file)
@@ -841,11 +841,13 @@ _evas_object_table_calculate_layout_regular(Evas_Object *o, Evas_Table_Data *pri
 
         cx = x + opt->col * (priv->pad.h);
         cx += _evas_object_table_sum_sizes(cols, 0, opt->col);
-        cw = _evas_object_table_sum_sizes(cols, opt->col, opt->end_col);
+        cw = (opt->colspan - 1) * priv->pad.h;
+        cw += _evas_object_table_sum_sizes(cols, opt->col, opt->end_col);
 
         cy = y + opt->row * (priv->pad.v);
         cy += _evas_object_table_sum_sizes(rows, 0, opt->row);
-        ch = _evas_object_table_sum_sizes(rows, opt->row, opt->end_row);
+        ch = (opt->rowspan - 1) * priv->pad.v;
+        ch += _evas_object_table_sum_sizes(rows, opt->row, opt->end_row);
 
         _evas_object_table_calculate_cell(opt, &cx, &cy, &cw, &ch);