diff options
author | Jee-Yong Um <jc9.um@samsung.com> | 2016-04-08 17:47:11 +0900 |
---|---|---|
committer | Jaehyun Cho <jae_hyun.cho@samsung.com> | 2016-04-08 17:47:11 +0900 |
commit | f7a4a2b2a04d3135f874bc0760db90a247b8f270 (patch) | |
tree | df1343136e15360b10ef7bb9af070506cf589abe | |
parent | a6d7efcf73aa63bbf56f34e11ee81cc9b9005bad (diff) | |
download | efl-f7a4a2b2a04d3135f874bc0760db90a247b8f270.tar.gz |
list: fix item highlight geometry correctly
Summary:
Calculation for item highlight geometry is incorrect when item
is larger than viewport geometry.
This patch adjusts highlight geometry to fit visible item size.
Test Plan: enventor (look "Settings-Text Editor-Font Names" list)
Reviewers: Jaehyun_Cho
Subscribers: jpeg, cedric
Differential Revision: https://phab.enlightenment.org/D3738
-rw-r--r-- | src/lib/elementary/elm_list.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/src/lib/elementary/elm_list.c b/src/lib/elementary/elm_list.c index 14164dcf5b..9a0e71b054 100644 --- a/src/lib/elementary/elm_list.c +++ b/src/lib/elementary/elm_list.c @@ -3097,30 +3097,27 @@ _elm_list_item_coordinates_adjust(Elm_List_Item_Data *it, Evas_Coord *w, Evas_Coord *h) { - ELM_LIST_DATA_GET_FROM_ITEM(it, sd); - Evas_Coord ix, iy, iw, ih, vx, vy, vw, vh; - evas_object_geometry_get(sd->hit_rect, &vx, &vy, &vw, &vh); + elm_interface_scrollable_content_viewport_geometry_get(WIDGET(it), &vx, &vy, &vw, &vh); evas_object_geometry_get(VIEW(it), &ix, &iy, &iw, &ih); + + if (iy < vy) + iy = vy; + + if ((iy + ih) > (vy + vh)) + ih = (vy + vh - iy); + + if (ix < vx) + ix = vx; + + if ((ix + iw) > (vx + vw)) + iw = (vx + vw - ix); + *x = ix; *y = iy; *w = iw; *h = ih; - if (!sd->h_mode) - { - if (ELM_RECTS_X_AXIS_OUT(ix, iy, iw, ih, vx, vy, vw, vh)) - *y = iy - ih; - else if (iy < vy) - *y = iy + ih; - } - else - { - if (ELM_RECTS_Y_AXIS_OUT(ix, iy, iw, ih, vx, vy, vw, vh)) - *x = ix - iw; - else if (ix < vx) - *x = ix + iw; - } } EOLIAN static void |