ami pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e62d78d594cb8b670bff722193dfa3d1b4baa5a5
commit e62d78d594cb8b670bff722193dfa3d1b4baa5a5 Author: Minkyu Kang <mk7.k...@samsung.com> Date: Tue Feb 21 15:02:30 2017 +0530 elementary gengrid: fix for working item reorder mode correctly Summary: Change the item indexing to start 1 after reordering animation. Change the logic of edge checking to get the row or col correctly. Signed-off-by: Minkyu Kang <mk7.k...@samsung.com> Test Plan: elementary_test -to gengrid2 append 6 items enable the reorder mode check reordering is working properly (4 to 1) @fix Reviewers: singh.amitesh, cedric Subscribers: jehun.lim, jpeg Differential Revision: https://phab.enlightenment.org/D4676 --- src/lib/elementary/elm_gengrid.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/lib/elementary/elm_gengrid.c b/src/lib/elementary/elm_gengrid.c index f677857..3be1fee 100644 --- a/src/lib/elementary/elm_gengrid.c +++ b/src/lib/elementary/elm_gengrid.c @@ -2770,25 +2770,22 @@ _elm_gengrid_item_edge_check(Elm_Object_Item *eo_it, ((sd->horizontal) && (dir == ELM_FOCUS_LEFT))) { Evas_Coord col, row, cvw, cvh; - int x; evas_object_geometry_get(sd->pan_obj, NULL, NULL, &cvw, &cvh); if (sd->horizontal && sd->item_height > 0) { row = cvh / sd->item_height; if (row <= 0) row = 1; - col = tmp->position / row; - x = tmp->position % row; - if (col == 0 || (col == 1 && x == 0)) + col = (tmp->position - 1) / row; + if (col == 0) return EINA_TRUE; } else if (sd->item_width > 0) { col = cvw / sd->item_width; if (col <= 0) col = 1; - row = tmp->position / col; - x = tmp->position % col; - if (row == 0 || (row == 1 && x == 0)) + row = (tmp->position - 1) / col; + if (row == 0) return EINA_TRUE; } } @@ -3025,7 +3022,7 @@ _anim_end(Elm_Gengrid_Data *sd) EINA_INLIST_GET(sd->reorder.it2)); } } - _item_position_update(sd->items, 0); + _item_position_update(sd->items, 1); ecore_job_del(sd->calc_job); sd->calc_job = ecore_job_add(_calc_job, sd->obj); --