flat_navi: additionally sort by y-coordinate if x coordinates are equal
authorLukasz Stanislawski <l.stanislaws@samsung.com>
Mon, 8 Dec 2014 17:53:17 +0000 (18:53 +0100)
committerLukasz Stanislawski <l.stanislaws@samsung.com>
Mon, 8 Dec 2014 17:53:17 +0000 (18:53 +0100)
src/position_sort.c

index 5525569..e7cdd63 100644 (file)
@@ -36,7 +36,13 @@ _sort_by_x_cb(const void *a, const void *b)
    cB = object_cache_get(objB);
 
    if (cA->bounds->x == cB->bounds->x)
-     return 0;
+     {
+        if (cA->bounds->y > cB->bounds->y)
+          return 1;
+        if (cA->bounds->y < cB->bounds->y)
+          return -1;
+        return 0;
+     }
    else if (cA->bounds->x > cB->bounds->x)
      return 1;
    else