summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaehyub Kim <taehyub.kim@samsung.com>2020-05-12 09:12:26 +0900
committerJunsuChoi <jsuya.choi@samsung.com>2020-05-12 09:12:26 +0900
commita138347c8e410cc495eb422b9778c9bb31dda563 (patch)
treec828f6122dc98057776a9dba3773387c98f9b374
parentcf5df21557dc932e9838fad8f5bc00901c700a8a (diff)
efl_canvas_vg_node: fix the implemenation function of the efl_canvas_vg_node(evas_object_above_get, evas_object_below_get)
Summary: There are wrong implemenation codes in the above and below get objects of efl_canvas_vg_node functin. and made it working correctly. Reviewers: Hermet, jsuya Reviewed By: jsuya Subscribers: singh.amitesh, cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8700 Differential Revision: https://phab.enlightenment.org/D11781
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_node.c107
1 files changed, 28 insertions, 79 deletions
diff --git a/src/lib/evas/canvas/efl_canvas_vg_node.c b/src/lib/evas/canvas/efl_canvas_vg_node.c
index 865107639b..8ed04adee6 100644
--- a/src/lib/evas/canvas/efl_canvas_vg_node.c
+++ b/src/lib/evas/canvas/efl_canvas_vg_node.c
@@ -476,107 +476,56 @@ _efl_canvas_vg_node_efl_gfx_stack_lower_to_bottom(Eo *obj, Efl_Canvas_Vg_Node_Da
476 _node_change(parent, efl_data_scope_get(parent, MY_CLASS)); 476 _node_change(parent, efl_data_scope_get(parent, MY_CLASS));
477} 477}
478 478
479static const Eo *
480_efl_canvas_vg_node_root_parent_get(const Eo *obj)
481{
482 const Eo *parent;
483
484 parent = efl_parent_get(obj);
485
486 if (!parent) return obj;
487 return _efl_canvas_vg_node_root_parent_get(parent);
488}
489
490static void
491_efl_canvas_vg_node_walk_down_at(const Eo *root, Eina_Array *a, Eina_Rectangle *r)
492{
493 Eina_Rect bounds;
494
495 efl_gfx_path_bounds_get(root, &bounds);
496 if (!eina_rectangles_intersect(&bounds.rect, r)) return ;
497
498 eina_array_push(a, root);
499
500 if (efl_isa(root, EFL_CANVAS_VG_CONTAINER_CLASS))
501 {
502 Efl_Canvas_Vg_Container_Data *cd;
503 Eina_List *l;
504 Eo *child;
505
506 cd = efl_data_scope_get(root, EFL_CANVAS_VG_CONTAINER_CLASS);
507 EINA_LIST_FOREACH(cd->children, l, child)
508 _efl_canvas_vg_node_walk_down_at(child, a, r);
509 }
510}
511
512static void
513_efl_canvas_vg_node_object_at(const Eo *obj, Eina_Array *a, Eina_Rectangle *r)
514{
515 const Eo *root;
516
517 root = _efl_canvas_vg_node_root_parent_get(obj);
518 if (!root) return ;
519
520 _efl_canvas_vg_node_walk_down_at(root, a, r);
521}
522
523static Efl_Gfx_Stack * 479static Efl_Gfx_Stack *
524_efl_canvas_vg_node_efl_gfx_stack_below_get(const Eo *obj, Efl_Canvas_Vg_Node_Data *pd EINA_UNUSED) 480_efl_canvas_vg_node_efl_gfx_stack_below_get(const Eo *obj, Efl_Canvas_Vg_Node_Data *pd EINA_UNUSED)
525{ 481{
526 Eina_Rect r; 482 Eo *parent, *below;
527 Eina_Array a; 483 const Eina_List *list;
528 Eo *current;
529 Eo *below = NULL;
530 Eina_Array_Iterator iterator;
531 unsigned int i;
532 484
533 efl_gfx_path_bounds_get(obj, &r); 485 parent = efl_parent_get(obj);
486 if (!efl_isa(parent, EFL_CANVAS_VG_CONTAINER_CLASS)) goto on_error;
534 487
535 eina_array_step_set(&a, sizeof (Eina_Array), 8); 488 list = efl_canvas_vg_container_children_direct_get(parent);
489 if (list == NULL) goto on_error;
536 490
537 _efl_canvas_vg_node_object_at(obj, &a, &r.rect); 491 list = eina_list_data_find_list(list, obj);
492 if (list == NULL) goto on_error;
538 493
539 EINA_ARRAY_ITER_NEXT(&a, i, current, iterator) 494 list = eina_list_prev(list);
540 if (current == obj) 495 if (list == NULL) goto on_error;
541 {
542 i++;
543 if (i < eina_array_count(&a))
544 below = eina_array_data_get(&a, i);
545 break;
546 }
547 496
548 eina_array_flush(&a); 497 below = list->data;
549 498
550 return below; 499 return below;
500
501 on_error:
502 return NULL;
551} 503}
552 504
553static Efl_Gfx_Stack * 505static Efl_Gfx_Stack *
554_efl_canvas_vg_node_efl_gfx_stack_above_get(const Eo *obj, Efl_Canvas_Vg_Node_Data *pd EINA_UNUSED) 506_efl_canvas_vg_node_efl_gfx_stack_above_get(const Eo *obj, Efl_Canvas_Vg_Node_Data *pd EINA_UNUSED)
555{ 507{
556 Eina_Rect r; 508 Eo *parent, *above;
557 Eina_Array a; 509 const Eina_List *list;
558 Eo *current;
559 Eo *above = NULL;
560 Eina_Array_Iterator iterator;
561 unsigned int i;
562 510
563 efl_gfx_path_bounds_get(obj, &r); 511 parent = efl_parent_get(obj);
512 if (!efl_isa(parent, EFL_CANVAS_VG_CONTAINER_CLASS)) goto on_error;
564 513
565 eina_array_step_set(&a, sizeof (Eina_Array), 8); 514 list = efl_canvas_vg_container_children_direct_get(parent);
515 if (list == NULL) goto on_error;
566 516
567 _efl_canvas_vg_node_object_at(obj, &a, &r.rect); 517 list = eina_list_data_find_list(list, obj);
518 if (list == NULL) goto on_error;
568 519
569 EINA_ARRAY_ITER_NEXT(&a, i, current, iterator) 520 list = eina_list_next(list);
570 if (current == obj) 521 if (list == NULL) goto on_error;
571 {
572 if (i > 0)
573 above = eina_array_data_get(&a, i - 1);
574 break;
575 }
576 522
577 eina_array_flush(&a); 523 above = list->data;
578 524
579 return above; 525 return above;
526
527 on_error:
528 return NULL;
580} 529}
581 530
582static Efl_Canvas_Vg_Interpolation * 531static Efl_Canvas_Vg_Interpolation *