diff options
author | Amitesh Singh <singh.amitesh@gmail.com> | 2014-03-07 09:08:16 +0530 |
---|---|---|
committer | Amitesh Singh <singh.amitesh@gmail.com> | 2014-03-07 09:14:08 +0530 |
commit | 0417b12347f1c95a514cca865f99df798a601851 (patch) | |
tree | 7ee20cb366fd754bdebca9c4e99780d4d72ad73a | |
parent | 6662fad5086552380507f9c1912081578fdc86e2 (diff) | |
download | elementary-devs/ami/item_focus.tar.gz |
list: Fix item coordinates calculation logic.devs/ami/item_focus
Refer D532 for more details.
-rw-r--r-- | src/lib/elm_list.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c index d18d669e5..99f6da70e 100644 --- a/src/lib/elm_list.c +++ b/src/lib/elm_list.c @@ -3009,19 +3009,27 @@ _elm_list_item_coordinates_adjust(Elm_List_Item *it, *h = ih; if (!sd->h_mode) { - //TODO: Enhance it later. declare a macro in elm_macros.h - if ((ix < vx) || (ix + iw) > (vx + vw) || (iy + ih) > (vy + vh)) - *y = iy - ih; + if ((iy + ih) > (vy + vh)) + *y = vh - ih; else if (iy < vy) - *y = iy + ih; + { + if ((abs(iy) + 1) == ih) + *y = iy + ih; + else + *y = iy + ih - (ih - abs(iy)); + } } else { - //TODO: Enhance it later. declare a macro in elm_macros.h - if ((iy < vy) || (ix + iw) > (vx + vw) || (iy + ih) > (vy + vh)) - *x = ix - iw; + if ((ix + iw) > (vx + vw)) + *x = vw - iw; else if (ix < vx) - *x = ix + iw; + { + if ((abs(ix) + 1) == iw) + *x = ix + iw; + else + *x = ix + iw - (iw - abs(ix)); + } } } |