efl_page_transition_scroll: bug fix in update function
authorJaeun Choi <jaeun12.choi@samsung.com>
Thu, 13 Dec 2018 08:59:47 +0000 (17:59 +0900)
committerTaehyub Kim <taehyub.kim@samsung.com>
Thu, 31 Jan 2019 01:53:45 +0000 (10:53 +0900)
since page_infos are connected in a circular manner,
one node (head or tail) moves in the opposite direction when scrolled.
there was a bug in hiding such nodes and
this patch fixes it.

src/lib/elementary/efl_page_transition_scroll.c

index 41b7033..71b7bfa 100644 (file)
@@ -303,7 +303,7 @@ _efl_page_transition_scroll_update(Eo *obj,
    int tmp_id, curr_page, cnt;
    Eo *tmp;
    Eina_List *list;
-   Page_Info *pi, *tpi;
+   Page_Info *pi, *tpi, *dummy;
 
    t = pos;
    if (t < 0) t *= (-1);
@@ -330,8 +330,6 @@ _efl_page_transition_scroll_update(Eo *obj,
 
         efl_gfx_entity_geometry_set(pi->obj, (Eina_Rect) pi->temp);
 
-        if (!pi->vis_page && !tpi->vis_page) continue;
-
         if (!eina_rectangles_intersect(&pi->temp, &pd->viewport))
           {
              if (pi->content)
@@ -379,6 +377,20 @@ _efl_page_transition_scroll_update(Eo *obj,
                }
           }
      }
+
+   if (pos < 0) dummy = pd->tail;
+   else dummy = pd->head;
+
+   if (dummy->visible)
+     {
+        efl_canvas_object_clip_set(dummy->obj, pd->backclip);
+        efl_pack_unpack(dummy->obj, dummy->content);
+        efl_canvas_object_clip_set(dummy->content, pd->backclip);
+
+        dummy->content_num = -1;
+        dummy->content = NULL;
+        dummy->visible = EINA_FALSE;
+     }
 }
 
 EOLIAN static void