sanghyeonlee pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=75c74b40688e27e8ac3cff3e733c87989ec2b419

commit 75c74b40688e27e8ac3cff3e733c87989ec2b419
Author: Umesh Tanwar <umesh.tan...@samsung.com>
Date:   Sun Jul 19 23:40:28 2015 +0900

    Scroller: Improvement in _key_action_move() calculations.
    
    Summary:
    If x coordinate is equal to 0, key action is no more
    effective as EINA_FALSE is returned. This is creating problem
    in looping. Looping will be done when x < 0, but as soon as
    x == 0, _key_action_move starts returning EINA_FALSE. Same
    thing applies to y coordinate and other extremities.
    
    @fix
    
    Signed-off-by: Umesh Tanwar <umesh.tan...@samsung.com>
    
    Test Plan: elementary_test -> Scroller -> Loop in X axis -> scroll left 
using left key(looping does not happen)
    
    Reviewers: raster, Hermet, cedric, singh.amitesh, SanghyeonLee
    
    Reviewed By: SanghyeonLee
    
    Subscribers: sachin.dev, SanghyeonLee, eagleeye
    
    Differential Revision: https://phab.enlightenment.org/D2778
---
 src/lib/elm_scroller.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/lib/elm_scroller.c b/src/lib/elm_scroller.c
index 98f103b..31b9191 100644
--- a/src/lib/elm_scroller.c
+++ b/src/lib/elm_scroller.c
@@ -189,22 +189,22 @@ _key_action_move(Evas_Object *obj, const char *params)
      }
    if (!strcmp(dir, "left"))
      {
-        if (x <= 0) return EINA_FALSE;
+        if ((x <= 0) && (!sd->loop_h)) return EINA_FALSE;
         x -= step_x;
      }
    else if (!strcmp(dir, "right"))
      {
-        if (x >= (max_x - v_w)) return EINA_FALSE;
+        if ((x >= (max_x - v_w)) && (!sd->loop_h)) return EINA_FALSE;
         x += step_x;
      }
    else if (!strcmp(dir, "up"))
      {
-        if (y == 0) return EINA_FALSE;
+        if ((y <= 0) && (!sd->loop_v)) return EINA_FALSE;
         y -= step_y;
      }
    else if (!strcmp(dir, "down"))
      {
-        if (y >= (max_y - v_h)) return EINA_FALSE;
+        if ((y >= (max_y - v_h)) && (!sd->loop_v)) return EINA_FALSE;
         y += step_y;
      }
    else if (!strcmp(dir, "first"))

-- 


Reply via email to