raster pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=5cb9b232732c49865e0bbaa56962f69b36320fdc

commit 5cb9b232732c49865e0bbaa56962f69b36320fdc
Author: abhi <[email protected]>
Date:   Sat Jun 7 14:54:28 2014 +0900

    gengrid: fixed _elm_gengrid_item_edge_check for ELM_FOCUS_DOWN and 
ELM_FOCUS_UP for normal and horizontal mode
    
    Summary:
    Added fixes for:
    1.Normal mode: ELM_FOCUS_DOWN and ELM_FOCUS_UP
    2.Horizontal mode: ELM_FOCUS_DOWN and ELM_FOCUS_UP
    
    (i)
    
    1|2|3
    4|5|6
    7|8|9
    
    _elm_gengrid_item_edge_check for ELM_FOCUS_DOWN returns EINA_TRUE for item 
no.6.
    It should not. Fixed this.
    
    (ii)
    
    1|2|3
    4|5|6
    7
    
    _elm_gengrid_item_edge_check returns EINA_FALSE for ELM_FOCUS_DOWN
    for item no. 5 and 6 but EINA_TRUE for item no. 7.
    It should return EINA_TRUE for item no. 5 and 6 instead.
    Fixed this.
    
    (iii)
    
    1|2|3
    4|
    
    _elm_gengrid_item_edge_check returned EINA_FALSE for ELM_FOCUS_UP
    for item no. 3. Fixed this.
    
    (iv)
    
    1|4|7
    2|5|
    3|6|
    
    Horizontal Mode: _elm_gengrid_item_edge_check returned EINA_FALSE
    for ELM_FOCUS_DOWN for item no. 7. Fixed this.
    
    (v)
    
    1|4|7
    2|5|
    3|6|
    
    Horizontal Mode: _elm_gengrid_item_edge_check returned EINA_FALSE
    for ELM_FOCUS_UP for item no. 1. Fixed this.
    
    Test Plan: elementary_test -to gengrid2
    
    Reviewers: seoz, raster
    
    CC: singh.amitesh, raster
    
    Differential Revision: https://phab.enlightenment.org/D841
    
    Conflicts:
        src/lib/elm_gengrid.c
---
 src/lib/elm_gengrid.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c
index 73406ef..2868896 100644
--- a/src/lib/elm_gengrid.c
+++ b/src/lib/elm_gengrid.c
@@ -1917,6 +1917,8 @@ _elm_gengrid_item_edge_check(Elm_Object_Item *it,
              else
                return EINA_TRUE;
           }
+        if (dir == ELM_FOCUS_UP)
+          return EINA_TRUE;
      }
    else if (((sd->horizontal) && (dir == ELM_FOCUS_DOWN)) ||
             ((!sd->horizontal) && (dir == ELM_FOCUS_RIGHT)))
@@ -1936,6 +1938,8 @@ _elm_gengrid_item_edge_check(Elm_Object_Item *it,
              else
                return EINA_TRUE;
           }
+        if (dir == ELM_FOCUS_DOWN)
+          return EINA_TRUE;
      }
    else if (((!sd->horizontal) && (dir == ELM_FOCUS_UP)) ||
             ((sd->horizontal) && (dir == ELM_FOCUS_LEFT)))
@@ -1954,7 +1958,7 @@ _elm_gengrid_item_edge_check(Elm_Object_Item *it,
           {
              col = cvw / sd->item_width;
              if (col <= 0) col = 1;
-             if (tmp->position < col)
+             if (tmp->position <= col)
                return EINA_TRUE;
           }
      }
@@ -1974,7 +1978,7 @@ _elm_gengrid_item_edge_check(Elm_Object_Item *it,
              if (x == 0)
                {
                   if ((tmp->position <= (row * col)) &&
-                      (tmp->position > (row *(col - 1))))
+                      (tmp->position > (row * (col - 1))))
                     return EINA_TRUE;
                }
              else
@@ -1993,13 +1997,13 @@ _elm_gengrid_item_edge_check(Elm_Object_Item *it,
              if (x == 0)
                {
                   if ((tmp->position <= (col * row)) &&
-                      (tmp->position >= (col *(row - 1))))
+                      (tmp->position > (col * (row - 1))))
                        return EINA_TRUE;
                }
              else
                {
                   if ((tmp->position <= ((col * row) + x)) &&
-                      (tmp->position >= (col * row)))
+                      (tmp->position > (((col * (row - 1)) + x))))
                     return EINA_TRUE;
                }
           }

-- 


Reply via email to