summaryrefslogtreecommitdiff
path: root/src/static_libs
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2019-11-21 17:37:33 +0900
committerHermet Park <hermetpark@gmail.com>2019-11-21 17:47:15 +0900
commit5eab3bff6830d2d2e8cc3f49a11b50b0b986344b (patch)
tree1b397bb3f0583e735b6084ff6c85cb6d2520d2e1 /src/static_libs
parentcf79e1f7e62ea18ed20d94a2238c8c9d1773fed2 (diff)
downloadefl-5eab3bff6830d2d2e8cc3f49a11b50b0b986344b.tar.gz
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.
Diffstat (limited to 'src/static_libs')
-rw-r--r--src/static_libs/vg_common/vg_common_json.c21
1 files 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;