ami pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=eae53f221809b7e66bae1476f5697e9e4153ceaa

commit eae53f221809b7e66bae1476f5697e9e4153ceaa
Author: Shuhrat Dehkanov <sh.dehka...@samsung.com>
Date:   Mon Apr 11 17:41:28 2016 +0530

    genlist: do not evaluate against max coord if the value is negative
    
    Summary:
    If x is already less than '0', there is no need to check if it is
    bigger than pan_max_x. Likewise, if y is already less than '0',
    there is no need to check if it is bigger than pan_max_y.
    
    Reviewers: Hermet, cedric, SanghyeonLee, singh.amitesh
    
    Reviewed By: singh.amitesh
    
    Subscribers: seoz, minkyu, sju27, jpeg
    
    Differential Revision: https://phab.enlightenment.org/D3865
---
 src/lib/elementary/elm_genlist.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c
index b5137fc..f204537 100644
--- a/src/lib/elementary/elm_genlist.c
+++ b/src/lib/elementary/elm_genlist.c
@@ -3053,10 +3053,14 @@ _key_action_move(Evas_Object *obj, const char *params)
    else return EINA_FALSE;
 
    elm_obj_pan_pos_max_get(sd->pan_obj, &pan_max_x, &pan_max_y);
-   if (x < 0) x = 0;
-   if (x > pan_max_x) x = pan_max_x;
-   if (y < 0) y = 0;
-   if (y > pan_max_y) y = pan_max_y;
+   if (x < 0)
+     x = 0;
+   else if (x > pan_max_x)
+     x = pan_max_x;
+   if (y < 0)
+     y = 0;
+   else if (y > pan_max_y)
+     y = pan_max_y;
 
    elm_interface_scrollable_content_pos_set(obj, x, y, EINA_TRUE);
 

-- 


Reply via email to