summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_page_transition_scroll.c
diff options
context:
space:
mode:
authorJaeun Choi <jaeun12.choi@samsung.com>2019-01-24 17:27:55 +0900
committerJaeun Choi <jaeun12.choi@samsung.com>2019-01-25 13:47:37 +0900
commit591f18f2af2ebcebd5e9d66bc20812eb3a378999 (patch)
treeef496d8e736310bffda10e50665c8ed7c1ff671b /src/lib/elementary/efl_page_transition_scroll.c
parent4dc8712aba0e83f6ea22c8e11f99fe61c953fd5e (diff)
efl_page_transition_scroll: fix _efl_page_transition_scroll_update() function
% operator should not be used when loop is disabled
Diffstat (limited to '')
-rw-r--r--src/lib/elementary/efl_page_transition_scroll.c54
1 files changed, 31 insertions, 23 deletions
diff --git a/src/lib/elementary/efl_page_transition_scroll.c b/src/lib/elementary/efl_page_transition_scroll.c
index 19c4acd82c..fa485f18a4 100644
--- a/src/lib/elementary/efl_page_transition_scroll.c
+++ b/src/lib/elementary/efl_page_transition_scroll.c
@@ -347,41 +347,49 @@ _efl_page_transition_scroll_update(Eo *obj,
347 curr->content_num = -1; 347 curr->content_num = -1;
348 curr->content = NULL; 348 curr->content = NULL;
349 curr->visible = EINA_FALSE; 349 curr->visible = EINA_FALSE;
350
351 } 350 }
352 } 351 }
353 else 352 else
354 { 353 {
355 tmp_id = (curr_page + curr->pos + cnt) % cnt; 354 tmp_id = curr_page + curr->pos;
356 if (curr->content_num != tmp_id) 355 if (spd->loop == EFL_UI_PAGER_LOOP_ENABLED)
357 { 356 tmp_id = (tmp_id + cnt) % cnt;
358 if (curr->content)
359 {
360 efl_pack_unpack(curr->obj, curr->content);
361 efl_canvas_object_clip_set(curr->content, pd->backclip);
362 357
363 curr->content_num = -1; 358 if ((abs(curr->pos) < cnt) &&
364 curr->content = NULL; 359 (tmp_id >= 0) &&
365 } 360 (tmp_id < cnt))
361 {
362 tmp = efl_pack_content_get(spd->pager.obj, tmp_id);
366 363
367 if (!((spd->loop == EFL_UI_PAGER_LOOP_DISABLED) 364 if (curr->content != tmp)
368 && ((curr->pos) * (tmp_id - curr_page) < 0)))
369 { 365 {
370 tmp = efl_pack_content_get(spd->pager.obj, tmp_id); 366 if (curr->content)
371
372 if (tmp)
373 { 367 {
374 efl_canvas_object_clip_set(curr->obj, pd->foreclip); 368 efl_pack_unpack(curr->obj, curr->content);
369 efl_canvas_object_clip_set(curr->content, pd->backclip);
370 }
375 371
376 efl_pack(curr->obj, tmp); 372 efl_canvas_object_clip_set(curr->obj, pd->foreclip);
377 efl_canvas_object_clip_set(tmp, pd->foreclip);
378 373
379 curr->content_num = tmp_id; 374 efl_pack(curr->obj, tmp);
380 curr->content = tmp; 375 efl_canvas_object_clip_set(tmp, pd->foreclip);
381 curr->visible = EINA_TRUE; 376
382 } 377 curr->content_num = tmp_id;
378 curr->content = tmp;
379 curr->visible = EINA_TRUE;
383 } 380 }
384 } 381 }
382 else if (curr->content)
383 {
384 efl_canvas_object_clip_set(curr->obj, pd->backclip);
385
386 efl_pack_unpack(curr->obj, curr->content);
387 efl_canvas_object_clip_set(curr->content, pd->backclip);
388
389 curr->content_num = -1;
390 curr->content = NULL;
391 curr->visible = EINA_FALSE;
392 }
385 } 393 }
386 394
387 curr = target; 395 curr = target;