forked from enlightenment/efl
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:
parent
008b74372f
commit
a83643d134
|
@ -2771,6 +2771,7 @@ _elm_gengrid_item_edge_check(Elm_Object_Item *eo_it,
|
||||||
((sd->horizontal) && (dir == ELM_FOCUS_LEFT)))
|
((sd->horizontal) && (dir == ELM_FOCUS_LEFT)))
|
||||||
{
|
{
|
||||||
Evas_Coord col, row, cvw, cvh;
|
Evas_Coord col, row, cvw, cvh;
|
||||||
|
int x;
|
||||||
|
|
||||||
evas_object_geometry_get(sd->pan_obj, NULL, NULL, &cvw, &cvh);
|
evas_object_geometry_get(sd->pan_obj, NULL, NULL, &cvw, &cvh);
|
||||||
if (sd->horizontal && sd->item_height > 0)
|
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;
|
row = cvh / sd->item_height;
|
||||||
if (row <= 0) row = 1;
|
if (row <= 0) row = 1;
|
||||||
col = tmp->position / row;
|
col = tmp->position / row;
|
||||||
if (col == 0)
|
x = tmp->position % row;
|
||||||
|
if (col == 0 || (col == 1 && x == 0))
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
else if (sd->item_width > 0)
|
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;
|
col = cvw / sd->item_width;
|
||||||
if (col <= 0) col = 1;
|
if (col <= 0) col = 1;
|
||||||
row = tmp->position / col;
|
row = tmp->position / col;
|
||||||
if (row == 0)
|
x = tmp->position % col;
|
||||||
|
if (row == 0 || (row == 1 && x == 0))
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue