elementary: gengrid - check the edge correctly

Summary:
The routine of checking edge of left side, divide position by row.
Since the result of fisrt item of last line is 1, that item was not checked as edge.
This patch is for fixing it.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>

Test Plan:
elementary_test -to gengrid2
append items (about 6)
horizontal mode on and item loop enable
check item loop is working properly

Reviewers: cedric, jpeg, Hermet, SanghyeonLee

Subscribers: jehun.lim, SanghyeonLee, cedric, jpeg

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
This commit is contained in:
Minkyu Kang 2016-10-25 14:12:42 -07:00 committed by Cedric Bail
parent 008b74372f
commit a83643d134
1 changed files with 5 additions and 2 deletions

View File

@ -2771,6 +2771,7 @@ _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)
@ -2778,7 +2779,8 @@ _elm_gengrid_item_edge_check(Elm_Object_Item *eo_it,
row = cvh / sd->item_height;
if (row <= 0) row = 1;
col = tmp->position / row;
if (col == 0)
x = tmp->position % row;
if (col == 0 || (col == 1 && x == 0))
return EINA_TRUE;
}
else if (sd->item_width > 0)
@ -2786,7 +2788,8 @@ _elm_gengrid_item_edge_check(Elm_Object_Item *eo_it,
col = cvw / sd->item_width;
if (col <= 0) col = 1;
row = tmp->position / col;
if (row == 0)
x = tmp->position % col;
if (row == 0 || (row == 1 && x == 0))
return EINA_TRUE;
}
}