summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYeongjong Lee <yj34.lee@samsung.com>2019-09-06 09:29:09 +0200
committerXavi Artigas <xavierartigas@yahoo.es>2019-09-06 09:38:40 +0200
commitae29408b86eaf8f6f324baff0312b336d56b1efc (patch)
tree8924c2e6b7ed3a042811d2e4e976ceb023bf389b
parent0c801b0d120a5ee8e01c5c323a56a9e07503bf51 (diff)
efl_ui_table: respect col,row span in last_position calculation
Summary: col,row spen is needed to get correct last_position. Thanks to segfaultxavi for refporting. ref T8182 Test Plan: https://git.enlightenment.org/tools/examples.git/tree/reference/c/ui/src/ui_container.c Check that long button and small button are not overlapped. Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8182 Differential Revision: https://phab.enlightenment.org/D9854
-rw-r--r--src/lib/elementary/efl_ui_table.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/lib/elementary/efl_ui_table.c b/src/lib/elementary/efl_ui_table.c
index 2c24c73fb1..865fc76577 100644
--- a/src/lib/elementary/efl_ui_table.c
+++ b/src/lib/elementary/efl_ui_table.c
@@ -88,6 +88,7 @@ _efl_ui_table_last_position_get(Eo * obj, Efl_Ui_Table_Data *pd, int *last_col,
88 Table_Item *gi; 88 Table_Item *gi;
89 int col = -1, row = -1; 89 int col = -1, row = -1;
90 int req_cols, req_rows; 90 int req_cols, req_rows;
91 int item_row, item_col;
91 92
92 if (!pd->linear_recalc) 93 if (!pd->linear_recalc)
93 { 94 {
@@ -102,17 +103,20 @@ _efl_ui_table_last_position_get(Eo * obj, Efl_Ui_Table_Data *pd, int *last_col,
102 { 103 {
103 EINA_INLIST_REVERSE_FOREACH(EINA_INLIST_GET(pd->items), gi) 104 EINA_INLIST_REVERSE_FOREACH(EINA_INLIST_GET(pd->items), gi)
104 { 105 {
105 if ((gi->row < row) || (req_cols < gi->col) || (req_rows < gi->row)) 106 item_row = gi->row + gi->row_span - 1;
107 item_col = gi->col + gi->col_span - 1;
108 if ((item_row < row) || (req_cols < item_col) ||
109 (req_rows < item_row))
106 continue; 110 continue;
107 111
108 if (gi->row > row) 112 if (item_row > row)
109 { 113 {
110 row = gi->row; 114 row = item_row;
111 col = gi->col; 115 col = item_col;
112 } 116 }
113 else if (gi->col > col) 117 else if (item_col > col)
114 { 118 {
115 col = gi->col; 119 col = item_col;
116 } 120 }
117 } 121 }
118 } 122 }
@@ -120,17 +124,20 @@ _efl_ui_table_last_position_get(Eo * obj, Efl_Ui_Table_Data *pd, int *last_col,
120 { 124 {
121 EINA_INLIST_REVERSE_FOREACH(EINA_INLIST_GET(pd->items), gi) 125 EINA_INLIST_REVERSE_FOREACH(EINA_INLIST_GET(pd->items), gi)
122 { 126 {
123 if ((gi->col < col) || (req_cols < gi->col) || (req_rows < gi->row)) 127 item_row = gi->row + gi->row_span - 1;
128 item_col = gi->col + gi->col_span - 1;
129 if ((item_col < col) || (req_cols < item_col) ||
130 (req_rows < item_row))
124 continue; 131 continue;
125 132
126 if (gi->col > col) 133 if (item_col > col)
127 { 134 {
128 col = gi->col; 135 col = item_col;
129 row = gi->row; 136 row = item_row;
130 } 137 }
131 else if (gi->row > row) 138 else if (item_row > row)
132 { 139 {
133 row = gi->row; 140 row = item_row;
134 } 141 }
135 } 142 }
136 } 143 }