From f7a4a2b2a04d3135f874bc0760db90a247b8f270 Mon Sep 17 00:00:00 2001 From: Jee-Yong Um Date: Fri, 8 Apr 2016 17:47:11 +0900 Subject: [PATCH] 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 --- src/lib/elementary/elm_list.c | 31 ++++++++++++++----------------- 1 file 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