summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLarry Jr <larry.olj@gmail.com>2017-11-07 19:46:12 -0200
committerSangHyeon Jade Lee <dltkdgus1764@gmail.com>2017-11-15 17:06:45 +0900
commita818c9c92ac4b47c7a4725fd58428324cbcc2a79 (patch)
treebc3ab563261d1228c186165b6cd9a2ec051cab32
parent5fa241fc4d07914c84a156be592c9bbd5b4f3fe4 (diff)
elm: segarray node min size cache
-rw-r--r--src/lib/elementary/efl_ui_list_precise_layouter.c213
-rw-r--r--src/lib/elementary/efl_ui_list_types.eot1
2 files changed, 91 insertions, 123 deletions
diff --git a/src/lib/elementary/efl_ui_list_precise_layouter.c b/src/lib/elementary/efl_ui_list_precise_layouter.c
index c9d3d4118b..bd0ac68fcb 100644
--- a/src/lib/elementary/efl_ui_list_precise_layouter.c
+++ b/src/lib/elementary/efl_ui_list_precise_layouter.c
@@ -22,7 +22,6 @@ typedef struct _Efl_Ui_List_Precise_Layouter_Data
22{ 22{
23 Eina_Bool initialized; 23 Eina_Bool initialized;
24 Eina_Bool recalc; 24 Eina_Bool recalc;
25 Eina_Hash* size_information;
26 Eina_Size2D min; 25 Eina_Size2D min;
27 Efl_Model* model; 26 Efl_Model* model;
28 Efl_Ui_List_Model *modeler; 27 Efl_Ui_List_Model *modeler;
@@ -35,24 +34,16 @@ typedef struct _Efl_Ui_List_Precise_Layouter_Data
35 unsigned int calc_progress; 34 unsigned int calc_progress;
36} Efl_Ui_List_Precise_Layouter_Data; 35} Efl_Ui_List_Precise_Layouter_Data;
37 36
38typedef struct _Efl_Ui_List_Precise_Layouter_Size
39{
40 Eina_Size2D min;
41 double weight_x, weight_y;
42} Efl_Ui_List_Precise_Layouter_Size;
43
44typedef struct _Efl_Ui_List_Precise_Layouter_Node_Data 37typedef struct _Efl_Ui_List_Precise_Layouter_Node_Data
45{ 38{
46 Eina_Size2D min; 39 Eina_Size2D min;
47 Eina_Bool realized; 40 Eina_Bool realized;
48} Efl_Ui_List_Precise_Layouter_Node_Data; 41} Efl_Ui_List_Precise_Layouter_Node_Data;
49 42
50
51
52typedef struct _Efl_Ui_List_Precise_Layouter_Callback_Data 43typedef struct _Efl_Ui_List_Precise_Layouter_Callback_Data
53{ 44{
54 Efl_Ui_List_Precise_Layouter_Data* pd; 45 Efl_Ui_List_Precise_Layouter_Data* pd;
55 Efl_Ui_List_Precise_Layouter_Size* size; 46 Efl_Ui_List_SegArray_Node* node;
56} Efl_Ui_List_Precise_Layouter_Callback_Data; 47} Efl_Ui_List_Precise_Layouter_Callback_Data;
57 48
58 49
@@ -64,79 +55,53 @@ static void _initilize(Eo *, Efl_Ui_List_Precise_Layouter_Data*, Efl_Ui_List_Mod
64static void _finalize(Eo *, Efl_Ui_List_Precise_Layouter_Data*); 55static void _finalize(Eo *, Efl_Ui_List_Precise_Layouter_Data*);
65 56
66static void 57static void
67_item_min_calc(Efl_Ui_List_Precise_Layouter_Data *pd, Evas_Object *layout, Efl_Ui_List_Precise_Layouter_Size *size, Eina_Size2D min 58_item_min_calc(Efl_Ui_List_Precise_Layouter_Data *pd, Efl_Ui_List_LayoutItem* item
68 , Efl_Ui_List_SegArray_Node *node) 59 , Eina_Size2D min, Efl_Ui_List_SegArray_Node *itemnode)
69{ 60{
70 int pad[4]; 61 Efl_Ui_List_Precise_Layouter_Node_Data *nodedata = itemnode->layout_data;
71 Efl_Ui_List_Precise_Layouter_Node_Data *nodedata = node->layout_data; 62 Efl_Ui_List_LayoutItem *layout_item;
63 int i, pad[4];
72 64
73 efl_gfx_size_hint_margin_get(layout, &pad[0], &pad[1], &pad[2], &pad[3]); 65 efl_gfx_size_hint_margin_get(item->layout, &pad[0], &pad[1], &pad[2], &pad[3]);
74 efl_gfx_size_hint_weight_get(layout, &size->weight_x, &size->weight_y);
75 66
76 min.w += pad[0] + pad[1]; 67 min.w += pad[0] + pad[1];
77 min.h += pad[2] + pad[3]; 68 min.h += pad[2] + pad[3];
78 69
79// if(_horiz(pd->orient)) 70 pd->min.h += min.h - item->min.h;
80// { 71 nodedata->min.h += min.h - item->min.h;
81// pdp->realized.w -= item->minw; 72
82// pd->realized.w += w; 73 if (nodedata->min.w <= min.w)
83// if(pd->realized.h <= h) 74 nodedata->min.w = min.w;
84// pd->realized.h = h; 75 else if (nodedata->min.w == item->min.w)
85// else if (pd->realized.h < item->minh) 76 for (i = 0; i != itemnode->length; ++i)
86// { 77 {
87// pd->realized.h = h; 78 layout_item = (Efl_Ui_List_LayoutItem *)itemnode->pointers[i];
88// EINA_INARRAY_FOREACH(&pd->items.array, it) 79 if (nodedata->min.w < layout_item->min.w)
89// { 80 nodedata->min.w = layout_item->min.w;
90// litem = *it; 81
91// if (!litem) continue; 82 if (item->min.w == layout_item->min.w)
92// if (pd->realized.h < litem->minh) 83 break;
93// pd->realized.h = litem->minh; 84 }
94// 85
95// if (litem != item && litem->minh == item->minh) 86 if (pd->min.w <= min.w)
96// break; 87 pd->min.w = min.w;
97// } 88 else if (pd->min.w == item->min.w)
98// } 89 {
99// }
100// else
101// {
102
103 pd->min.h += min.h - size->min.h;
104 nodedata->min.h += min.h - size->min.h;
105
106 if (nodedata->min.w <= min.w)
107 nodedata->min.w = min.w;
108 else if (nodedata->min.w == size->min.w)
109 {
110 int i;
111 for (i = 0; i != node->length; ++i)
112 {
113 }
114 }
115
116 if (pd->min.w <= min.w)
117 pd->min.w = min.w; 90 pd->min.w = min.w;
118 else if (pd->min.w == size->min.w) 91 Efl_Ui_List_SegArray_Node *node;
119 { 92 EINA_ACCESSOR_FOREACH(pd->nodes, i, node)
120 Efl_Ui_List_Precise_Layouter_Size *size_item; 93 {
121 Eina_Iterator *size_iterator; 94 Efl_Ui_List_Precise_Layouter_Node_Data *nodedata = node->layout_data;
122 95 if (pd->min.w < nodedata->min.w)
123 pd->min.w = min.w; 96 pd->min.w = nodedata->min.w;
124 size_iterator = eina_hash_iterator_data_new(pd->size_information); 97
125 EINA_ITERATOR_FOREACH(size_iterator, size_item) 98 if (item->min.w == nodedata->min.w)
126 { 99 break;
127 if (pd->min.w < size_item->min.w) 100 }
128 pd->min.w = size_item->min.w; 101 }
129 102
130 if (size->min.w == size_item->min.w) 103 item->min.w = min.w;
131 break; 104 item->min.h = min.h;
132 }
133 eina_iterator_free(size_iterator);
134 }
135
136// }
137
138 size->min.w = min.w;
139 size->min.h = min.h;
140} 105}
141 106
142static void 107static void
@@ -178,20 +143,34 @@ _slice_error(void * data, Efl_Event const* event EINA_UNUSED)
178 pd->slice_future = NULL; 143 pd->slice_future = NULL;
179} 144}
180*/ 145*/
146
181static void 147static void
182_on_item_size_hint_change(void *data, Evas *e EINA_UNUSED, 148_on_item_size_hint_change(void *data, Evas *e EINA_UNUSED,
183 Evas_Object *obj, void *event_info EINA_UNUSED) 149 Evas_Object *obj, void *event_info EINA_UNUSED)
184{ 150{
185 Efl_Ui_List_Precise_Layouter_Callback_Data *cb_data = data; 151 Efl_Ui_List_Precise_Layouter_Callback_Data *cb_data = data;
152 Efl_Ui_List_SegArray_Node *node = cb_data->node;
153 Efl_Ui_List_LayoutItem *item;
154 int i;
155
186 Eina_Size2D min = efl_gfx_size_hint_combined_min_get(obj); 156 Eina_Size2D min = efl_gfx_size_hint_combined_min_get(obj);
187 _item_min_calc(cb_data->pd, obj, cb_data->size, min, NULL); 157
158 for (i = 0; i != node->length; ++i)
159 {
160 item = (Efl_Ui_List_LayoutItem *)node->pointers[i];
161 if (item->layout == obj)
162 {
163 _item_min_calc(cb_data->pd, item, min, node);
164 return;
165 }
166 }
188} 167}
189 168
190static void 169static void
191_on_modeler_resize(void *data, Evas *e EINA_UNUSED, 170_on_modeler_resize(void *data, Evas *e EINA_UNUSED,
192 Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 171 Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
193{ 172{
194 Efl_Ui_List_Precise_Layouter_Data *pd = data; 173// Efl_Ui_List_Precise_Layouter_Data *pd = data;
195// pd->recalc = EINA_TRUE; 174// pd->recalc = EINA_TRUE;
196} 175}
197 176
@@ -209,7 +188,6 @@ _initilize(Eo *obj EINA_UNUSED, Efl_Ui_List_Precise_Layouter_Data *pd, Efl_Ui_Li
209 if (pd->slice_future) 188 if (pd->slice_future)
210 efl_future_cancel(pd->slice_future); 189 efl_future_cancel(pd->slice_future);
211 190
212
213 pd->slice_future = efl_model_children_slice_get(pd->model, 0, 0); 191 pd->slice_future = efl_model_children_slice_get(pd->model, 0, 0);
214 efl_future_then(pd->slice_future, &_slice_then, &_slice_error, NULL, pd); 192 efl_future_then(pd->slice_future, &_slice_then, &_slice_error, NULL, pd);
215*/ 193*/
@@ -226,7 +204,7 @@ _finalize(Eo *obj EINA_UNUSED, Efl_Ui_List_Precise_Layouter_Data *pd)
226 void *data; 204 void *data;
227 205
228 evas_object_event_callback_del_full(pd->modeler, EVAS_CALLBACK_RESIZE, _on_modeler_resize, pd); 206 evas_object_event_callback_del_full(pd->modeler, EVAS_CALLBACK_RESIZE, _on_modeler_resize, pd);
229 207/*
230 item_iterator = eina_hash_iterator_key_new(pd->size_information); 208 item_iterator = eina_hash_iterator_key_new(pd->size_information);
231 while(eina_iterator_next(item_iterator, &data)) 209 while(eina_iterator_next(item_iterator, &data))
232 { 210 {
@@ -236,8 +214,8 @@ _finalize(Eo *obj EINA_UNUSED, Efl_Ui_List_Precise_Layouter_Data *pd)
236 free(cb_data); 214 free(cb_data);
237 } 215 }
238 eina_iterator_free(item_iterator); 216 eina_iterator_free(item_iterator);
239
240 eina_hash_free_buckets(pd->size_information); 217 eina_hash_free_buckets(pd->size_information);
218*/
241 pd->modeler = NULL; 219 pd->modeler = NULL;
242 pd->min.w = 0; 220 pd->min.w = 0;
243 pd->min.h = 0; 221 pd->min.h = 0;
@@ -261,17 +239,13 @@ _calc_range(, Efl_Ui_List_Precise_Layouter_Data *pd, )
261 (pd->modeler, NULL, NULL, &ow, &oh); 239 (pd->modeler, NULL, NULL, &ow, &oh);
262 240
263 elm_interface_scrollable_content_pos_get(pd->modeler, &scr_x, &scr_y); 241 elm_interface_scrollable_content_pos_get(pd->modeler, &scr_x, &scr_y);
264
265
266
267} 242}
268*/ 243*/
269static void 244static void
270_calc_size_job(void *data) 245_calc_size_job(void *data)
271{ 246{
272 Efl_Ui_List_Precise_Layouter_Size *size, *nodesize;
273 Efl_Ui_List_Precise_Layouter_Data *pd; 247 Efl_Ui_List_Precise_Layouter_Data *pd;
274 Efl_Ui_List_SegArray_Node *items_node; 248 Efl_Ui_List_SegArray_Node *node;
275 Efl_Ui_List_LayoutItem *layout_item; 249 Efl_Ui_List_LayoutItem *layout_item;
276 Eo *obj = data; 250 Eo *obj = data;
277 int i; 251 int i;
@@ -284,26 +258,24 @@ _calc_size_job(void *data)
284 258
285 pd->recalc = EINA_FALSE; 259 pd->recalc = EINA_FALSE;
286 260
287 while (eina_accessor_data_get(pd->nodes, pd->calc_progress, (void **)&items_node)) 261 while (eina_accessor_data_get(pd->nodes, pd->calc_progress, (void **)&node))
288 { 262 {
289 pd->calc_progress++; 263 pd->calc_progress++;
290 DBG("node first %d", items_node->first); 264 DBG("node first %d", node->first);
291 nodesize = (Efl_Ui_List_Precise_Layouter_Node_Data *)items_node->layout_data; 265 if (!node->layout_data)
292 if (!nodesize) 266 node->layout_data = calloc(1, sizeof(Efl_Ui_List_Precise_Layouter_Node_Data));
293 nodesize = calloc(1, sizeof(Efl_Ui_List_Precise_Layouter_Size));
294 267
295 for(i = 0; i != items_node->length; ++i) 268 for (i = 0; i != node->length; ++i)
296 { 269 {
297 layout_item = (Efl_Ui_List_LayoutItem *)items_node->pointers[i]; 270 layout_item = (Efl_Ui_List_LayoutItem *)node->pointers[i];
298 DBG("layout_do first %d count %d", pd->first, pd->count); 271 DBG("layout_do first %d count %d", pd->first, pd->count);
299 EINA_SAFETY_ON_NULL_RETURN(layout_item); 272 EINA_SAFETY_ON_NULL_RETURN(layout_item);
300 273
301 // cache size of new items 274 // cache size of new items
302 size = eina_hash_find(pd->size_information, &layout_item); 275 if ((layout_item->min.w == 0) && (layout_item->min.h == 0))
303 if(!size)
304 { 276 {
305 Eina_Bool realized = EINA_FALSE; 277 Eina_Bool realized = EINA_FALSE;
306 if(!layout_item->layout) 278 if (!layout_item->layout)
307 { 279 {
308 DBG("no layout, realizing"); 280 DBG("no layout, realizing");
309 efl_ui_list_model_realize(pd->modeler, layout_item); 281 efl_ui_list_model_realize(pd->modeler, layout_item);
@@ -319,24 +291,22 @@ _calc_size_job(void *data)
319 /* } */ 291 /* } */
320 } 292 }
321 293
322 size = calloc(1, sizeof(Efl_Ui_List_Precise_Layouter_Size));
323 eina_hash_add(pd->size_information, &layout_item, size);
324 Eina_Size2D min = efl_gfx_size_hint_combined_min_get(layout_item->layout); 294 Eina_Size2D min = efl_gfx_size_hint_combined_min_get(layout_item->layout);
325 if(min.w && min.h) 295 if (min.w && min.h)
326 { 296 {
327 //DBG("size was calculated"); 297 //DBG("size was calculated");
328 _item_min_calc(pd, layout_item->layout, size, min, nodesize); 298 _item_min_calc(pd, layout_item, min, node);
329 } 299 }
330 300
331 if (realized) 301// if (realized)
332 { 302 {
333// Efl_Ui_List_Precise_Layouter_Callback_Data *cb_data = calloc(1, sizeof(Efl_Ui_List_Precise_Layouter_Callback_Data)); 303 Efl_Ui_List_Precise_Layouter_Callback_Data *cb_data = calloc(1, sizeof(Efl_Ui_List_Precise_Layouter_Callback_Data));
334// cb_data->pd = pd; 304 cb_data->pd = pd;
335// cb_data->size = size; 305 cb_data->node = node;
336// evas_object_event_callback_add(layout_item->layout, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_item_size_hint_change, cb_data); 306 evas_object_event_callback_add(layout_item->layout, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_item_size_hint_change, cb_data);
337 } 307 }
338 else 308// else
339 efl_ui_list_model_unrealize(pd->modeler, layout_item); 309// efl_ui_list_model_unrealize(pd->modeler, layout_item);
340 } 310 }
341 } 311 }
342 if ( (ecore_time_get() - start_time ) > 0.01 ) 312 if ( (ecore_time_get() - start_time ) > 0.01 )
@@ -358,7 +328,6 @@ EOLIAN static Efl_Object *
358_efl_ui_list_precise_layouter_efl_object_constructor(Eo *obj EINA_UNUSED, Efl_Ui_List_Precise_Layouter_Data *pd) 328_efl_ui_list_precise_layouter_efl_object_constructor(Eo *obj EINA_UNUSED, Efl_Ui_List_Precise_Layouter_Data *pd)
359{ 329{
360 obj = efl_constructor(efl_super(obj, MY_CLASS)); 330 obj = efl_constructor(efl_super(obj, MY_CLASS));
361 pd->size_information = eina_hash_pointer_new(&free);
362 pd->initialized = EINA_FALSE; 331 pd->initialized = EINA_FALSE;
363 pd->count_future = NULL; 332 pd->count_future = NULL;
364 333
@@ -404,7 +373,6 @@ _efl_ui_list_relayout_layout_do(Efl_Ui_List_Precise_Layouter_Data *pd)
404 int boxl = 0, boxr = 0, boxt = 0, boxb = 0; 373 int boxl = 0, boxr = 0, boxt = 0, boxb = 0;
405 double cur_pos = 0, scale, box_align[2], weight[2] = { 0, 0 }; 374 double cur_pos = 0, scale, box_align[2], weight[2] = { 0, 0 };
406 Eina_Bool box_fill[2] = { EINA_FALSE, EINA_FALSE }; 375 Eina_Bool box_fill[2] = { EINA_FALSE, EINA_FALSE };
407 Efl_Ui_List_Precise_Layouter_Size* size;
408 Efl_Ui_List_LayoutItem* layout_item; 376 Efl_Ui_List_LayoutItem* layout_item;
409 Efl_Ui_List_SegArray_Node *items_node; 377 Efl_Ui_List_SegArray_Node *items_node;
410 unsigned int i; 378 unsigned int i;
@@ -450,7 +418,7 @@ _efl_ui_list_relayout_layout_do(Efl_Ui_List_Precise_Layouter_Data *pd)
450 } 418 }
451 419
452 // padding can not be squeezed (note: could make it an option) 420 // padding can not be squeezed (note: could make it an option)
453 length -= pad * (eina_hash_population(pd->size_information) - 1); 421 length -= pad * (pd->count_total - 1);
454 // available space. if <0 we overflow 422 // available space. if <0 we overflow
455 extra = length - want; 423 extra = length - want;
456 424
@@ -489,18 +457,18 @@ _efl_ui_list_relayout_layout_do(Efl_Ui_List_Precise_Layouter_Data *pd)
489 { 457 {
490 layout_item = (Efl_Ui_List_LayoutItem *)items_node->pointers[j]; 458 layout_item = (Efl_Ui_List_LayoutItem *)items_node->pointers[j];
491 double cx, cy, cw, ch, x, y, w, h; 459 double cx, cy, cw, ch, x, y, w, h;
460 double weight_x, weight_y;
492 double align[2]; 461 double align[2];
493 int item_pad[4]; 462 int item_pad[4];
494 Eina_Size2D max; 463 Eina_Size2D max;
495 int pad = 0; 464 int pad = 0;
496 465
497 size = eina_hash_find(pd->size_information, &layout_item); 466 if(layout_item->min.w && layout_item->min.h)
498
499 if(size)
500 { 467 {
501// DBG("size information for item %d width %d height %d", i, size->min.w, size->min.h); 468// DBG("size information for item %d width %d height %d", i, size->min.w, size->min.h);
502 469
503 assert(layout_item->layout != NULL); 470 assert(layout_item->layout != NULL);
471 efl_gfx_size_hint_weight_get(layout_item->layout, &weight_x, &weight_y);
504 efl_gfx_size_hint_align_get(layout_item->layout, &align[0], &align[1]); 472 efl_gfx_size_hint_align_get(layout_item->layout, &align[0], &align[1]);
505 max = efl_gfx_size_hint_max_get(layout_item->layout); 473 max = efl_gfx_size_hint_max_get(layout_item->layout);
506 efl_gfx_size_hint_margin_get(layout_item->layout, &item_pad[0], &item_pad[1], &item_pad[2], &item_pad[3]); 474 efl_gfx_size_hint_margin_get(layout_item->layout, &item_pad[0], &item_pad[1], &item_pad[2], &item_pad[3]);
@@ -512,8 +480,8 @@ _efl_ui_list_relayout_layout_do(Efl_Ui_List_Precise_Layouter_Data *pd)
512 480
513 if (max.w <= 0) max.w = INT_MAX; 481 if (max.w <= 0) max.w = INT_MAX;
514 if (max.h <= 0) max.h = INT_MAX; 482 if (max.h <= 0) max.h = INT_MAX;
515 if (max.w < size->min.w) max.w = size->min.w; 483 if (max.w < layout_item->min.w) max.w = layout_item->min.w;
516 if (max.h < size->min.h) max.h = size->min.h; 484 if (max.h < layout_item->min.h) max.h = layout_item->min.h;
517 485
518 // extra rounding up (compensate cumulative error) 486 // extra rounding up (compensate cumulative error)
519 if ((i == (pd->count - 1)) && (cur_pos - floor(cur_pos) >= 0.5)) 487 if ((i == (pd->count - 1)) && (cur_pos - floor(cur_pos) >= 0.5))
@@ -523,7 +491,7 @@ _efl_ui_list_relayout_layout_do(Efl_Ui_List_Precise_Layouter_Data *pd)
523 { 491 {
524 cx = boxx + cur_pos; 492 cx = boxx + cur_pos;
525 cy = boxy; 493 cy = boxy;
526 cw = size->min.w + rounding + (zeroweight ? 1.0 : size->weight_x) * extra / weight[0]; 494 cw = layout_item->min.w + rounding + (zeroweight ? 1.0 : weight_x) * extra / weight[0];
527 ch = boxh; 495 ch = boxh;
528 cur_pos += cw + pad; 496 cur_pos += cw + pad;
529 } 497 }
@@ -532,14 +500,14 @@ _efl_ui_list_relayout_layout_do(Efl_Ui_List_Precise_Layouter_Data *pd)
532 cx = boxx; 500 cx = boxx;
533 cy = boxy + cur_pos; 501 cy = boxy + cur_pos;
534 cw = boxw; 502 cw = boxw;
535 ch = size->min.h + rounding + (zeroweight ? 1.0 : size->weight_y) * extra / weight[1]; 503 ch = layout_item->min.h + rounding + (zeroweight ? 1.0 : weight_y) * extra / weight[1];
536 cur_pos += ch + pad; 504 cur_pos += ch + pad;
537 } 505 }
538 506
539 // horizontally 507 // horizontally
540 if (max.w < INT_MAX) 508 if (max.w < INT_MAX)
541 { 509 {
542 w = MIN(MAX(size->min.w - item_pad[0] - item_pad[1], max.w), cw); 510 w = MIN(MAX(layout_item->min.w - item_pad[0] - item_pad[1], max.w), cw);
543 if (align[0] < 0) 511 if (align[0] < 0)
544 { 512 {
545 // bad case: fill+max are not good together 513 // bad case: fill+max are not good together
@@ -556,14 +524,14 @@ _efl_ui_list_relayout_layout_do(Efl_Ui_List_Precise_Layouter_Data *pd)
556 } 524 }
557 else 525 else
558 { 526 {
559 w = size->min.w - item_pad[0] - item_pad[1]; 527 w = layout_item->min.w - item_pad[0] - item_pad[1];
560 x = cx + ((cw - w) * align[0]) + item_pad[0]; 528 x = cx + ((cw - w) * align[0]) + item_pad[0];
561 } 529 }
562 530
563 // vertically 531 // vertically
564 if (max.h < INT_MAX) 532 if (max.h < INT_MAX)
565 { 533 {
566 h = MIN(MAX(size->min.h - item_pad[2] - item_pad[3], max.h), ch); 534 h = MIN(MAX(layout_item->min.h - item_pad[2] - item_pad[3], max.h), ch);
567 if (align[1] < 0) 535 if (align[1] < 0)
568 { 536 {
569 // bad case: fill+max are not good together 537 // bad case: fill+max are not good together
@@ -580,7 +548,7 @@ _efl_ui_list_relayout_layout_do(Efl_Ui_List_Precise_Layouter_Data *pd)
580 } 548 }
581 else 549 else
582 { 550 {
583 h = size->min.h - item_pad[2] - item_pad[3]; 551 h = layout_item->min.h - item_pad[2] - item_pad[3];
584 y = cy + ((ch - h) * align[1]) + item_pad[2]; 552 y = cy + ((ch - h) * align[1]) + item_pad[2];
585 } 553 }
586 554
@@ -631,8 +599,7 @@ _efl_ui_list_precise_layouter_efl_ui_list_relayout_layout_do
631 eina_accessor_free(pd->nodes); 599 eina_accessor_free(pd->nodes);
632 pd->nodes = nodes; 600 pd->nodes = nodes;
633 601
634 pop = eina_hash_population(pd->size_information); 602 if (pd->recalc) // || pd->count_total > pop)
635 if (pd->recalc || (pd->first + pd->count) > pop) // || pd->count_total > pop)
636 { 603 {
637 // cache size of new items 604 // cache size of new items
638 pd->calc_progress = 0; 605 pd->calc_progress = 0;
diff --git a/src/lib/elementary/efl_ui_list_types.eot b/src/lib/elementary/efl_ui_list_types.eot
index 663ebe8241..fcc1e79e45 100644
--- a/src/lib/elementary/efl_ui_list_types.eot
+++ b/src/lib/elementary/efl_ui_list_types.eot
@@ -2,4 +2,5 @@ struct Efl.Ui.List.LayoutItem {
2 layout: Efl.Ui.Layout; 2 layout: Efl.Ui.Layout;
3 children: Efl.Model; 3 children: Efl.Model;
4 index: int; 4 index: int;
5 min: Eina.Size2D;
5} 6}