efl_ui_position_manager: review cache accesses

in position manager grid and list, there are caches for the sizes, so
the access within placing the item is faster. The cache sometimes is
invalidated, which means, it must be rebuild before accessing it.

This commit is the result of reviewing all the accesses, that the
correct item is available.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10065
This commit is contained in:
Marcel Hollerbach 2019-09-21 11:06:26 +02:00 committed by Cedric Bail
parent 63ebd0e9cc
commit 534021632c
2 changed files with 4 additions and 0 deletions

View File

@ -448,6 +448,8 @@ _reposition_content(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd)
if (pd->max_min_size.w <= 0 || pd->max_min_size.h <= 0) return;
if (!eina_inarray_count(pd->group_cache)) return;
_size_cache_require(obj, pd);
//space size contains the amount of space that is outside the viewport (either to the top or to the left)
space_size.w = (MAX(pd->last_viewport_size.w - pd->viewport.w, 0))*pd->scroll_position.x;
space_size.h = (MAX(pd->last_viewport_size.h - pd->viewport.h, 0))*pd->scroll_position.y;

View File

@ -417,6 +417,8 @@ _efl_ui_position_manager_list_efl_ui_position_manager_entity_position_single_ite
if (!pd->size) return EINA_RECT(0,0,0,0);
cache_require(obj, pd);
//space size contains the amount of space that is outside the viewport (either to the top or to the left)
space_size.w = (MAX(pd->abs_size.w - pd->viewport.w, 0))*pd->scroll_position.x;
space_size.h = (MAX(pd->abs_size.h - pd->viewport.h, 0))*pd->scroll_position.y;