hermet pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=5eab3bff6830d2d2e8cc3f49a11b50b0b986344b

commit 5eab3bff6830d2d2e8cc3f49a11b50b0b986344b
Author: Hermet Park <hermetp...@gmail.com>
Date:   Thu Nov 21 17:37:33 2019 +0900

    vector lottie: reset vg tree each frames.
    
    Since vector tree nodes are reusing instead of reconstrucion,
    We make it sure that dangling nodes invisible by clearing all nodes 
visibility.
    
    Only valid nodes will be reset to visible while setting up in the progress.
---
 src/static_libs/vg_common/vg_common_json.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/src/static_libs/vg_common/vg_common_json.c 
b/src/static_libs/vg_common/vg_common_json.c
index 2c31d7881a..43ef86b353 100644
--- a/src/static_libs/vg_common/vg_common_json.c
+++ b/src/static_libs/vg_common/vg_common_json.c
@@ -352,13 +352,24 @@ _construct_masks(Efl_Canvas_Vg_Container *mtarget, 
LOTMask *masks, unsigned int
 }
 
 static void
-_update_vg_tree(Efl_Canvas_Vg_Container *root, const LOTLayerNode *layer, int 
depth EINA_UNUSED)
+_reset_vg_tree(Efl_VG *node)
 {
-   if (!layer->mVisible)
+   //Hide all nodes visibility
+   if (efl_isa(node, EFL_CANVAS_VG_CONTAINER_CLASS))
      {
-        efl_gfx_entity_visible_set(root, EINA_FALSE);
-        return;
+        Efl_VG* child;
+        Eina_Iterator *itr = efl_canvas_vg_container_children_get(node);
+        EINA_ITERATOR_FOREACH(itr, child)
+          _reset_vg_tree(child);
      }
+   efl_gfx_entity_visible_set(node, EINA_FALSE);
+}
+
+static void
+_update_vg_tree(Efl_Canvas_Vg_Container *root, const LOTLayerNode *layer, int 
depth EINA_UNUSED)
+{
+   if (!layer->mVisible) return;
+
    efl_gfx_entity_visible_set(root, EINA_TRUE);
    efl_gfx_color_set(root, layer->mAlpha, layer->mAlpha, layer->mAlpha, 
layer->mAlpha);
 
@@ -523,6 +534,8 @@ vg_common_json_create_vg_node(Vg_File_Data *vfd)
         if (tree->keypath) efl_key_data_set(root, "_lot_node_name", 
tree->keypath);
         vfd->root = root;
      }
+   else _reset_vg_tree(root);
+
    _update_vg_tree(root, tree, 1);
 #else
    return EINA_FALSE;

-- 


Reply via email to