elementary: fix wrong calculation for gengrid group items
authoryoz <yoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 30 Nov 2011 11:03:22 +0000 (11:03 +0000)
committeryoz <yoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 30 Nov 2011 11:03:22 +0000 (11:03 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@65714 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elm_gengrid.c

index b095ef7..24c6d75 100644 (file)
@@ -1224,13 +1224,13 @@ _item_place(Elm_Gen_Item *it,
         if (it->wd->horizontal)
           {
              x = (((cx - it->item->prev_group) * it->wd->item_width) + (it->item->prev_group * it->wd->group_item_width)) - it->wd->pan_x + ox + alignw;
-             y = 0;
+             y = oy;
              iw = it->wd->group_item_width;
              ih = vh;
           }
         else
           {
-             x = 0;
+             x = ox;
              y = (((cy - it->item->prev_group) * it->wd->item_height) + (it->item->prev_group * it->wd->group_item_height)) - it->wd->pan_y + oy + alignh;
              iw = vw;
              ih = it->wd->group_item_height;
@@ -1269,20 +1269,21 @@ _item_place(Elm_Gen_Item *it,
           {
              if (it->wd->horizontal)
                {
-                  if (it->parent->item->gx < 0)
+                  if (it->parent->item->gx < ox)
                     {
                        it->parent->item->gx = x + it->wd->item_width - it->wd->group_item_width;
-                       if (it->parent->item->gx > 0)
-                         it->parent->item->gx = 0;
+                       if (it->parent->item->gx > ox)
+                         it->parent->item->gx = ox;
                     }
+                  it->parent->item->group_realized = EINA_TRUE;
                }
              else
                {
-                  if (it->parent->item->gy < 0)
+                  if (it->parent->item->gy < oy)
                     {
                        it->parent->item->gy = y + it->wd->item_height - it->wd->group_item_height;
-                       if (it->parent->item->gy > 0)
-                         it->parent->item->gy = 0;
+                       if (it->parent->item->gy > oy)
+                         it->parent->item->gy = oy;
                     }
                   it->parent->item->group_realized = EINA_TRUE;
                }