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)
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
352} 352}
353 353
354static void 354static void
355_update_vg_tree(Efl_Canvas_Vg_Container *root, const LOTLayerNode *layer, int depth EINA_UNUSED) 355_reset_vg_tree(Efl_VG *node)
356{ 356{
357 if (!layer->mVisible) 357 //Hide all nodes visibility
358 if (efl_isa(node, EFL_CANVAS_VG_CONTAINER_CLASS))
358 { 359 {
359 efl_gfx_entity_visible_set(root, EINA_FALSE); 360 Efl_VG* child;
360 return; 361 Eina_Iterator *itr = efl_canvas_vg_container_children_get(node);
362 EINA_ITERATOR_FOREACH(itr, child)
363 _reset_vg_tree(child);
361 } 364 }
365 efl_gfx_entity_visible_set(node, EINA_FALSE);
366}
367
368static void
369_update_vg_tree(Efl_Canvas_Vg_Container *root, const LOTLayerNode *layer, int depth EINA_UNUSED)
370{
371 if (!layer->mVisible) return;
372
362 efl_gfx_entity_visible_set(root, EINA_TRUE); 373 efl_gfx_entity_visible_set(root, EINA_TRUE);
363 efl_gfx_color_set(root, layer->mAlpha, layer->mAlpha, layer->mAlpha, layer->mAlpha); 374 efl_gfx_color_set(root, layer->mAlpha, layer->mAlpha, layer->mAlpha, layer->mAlpha);
364 375
@@ -523,6 +534,8 @@ vg_common_json_create_vg_node(Vg_File_Data *vfd)
523 if (tree->keypath) efl_key_data_set(root, "_lot_node_name", tree->keypath); 534 if (tree->keypath) efl_key_data_set(root, "_lot_node_name", tree->keypath);
524 vfd->root = root; 535 vfd->root = root;
525 } 536 }
537 else _reset_vg_tree(root);
538
526 _update_vg_tree(root, tree, 1); 539 _update_vg_tree(root, tree, 1);
527#else 540#else
528 return EINA_FALSE; 541 return EINA_FALSE;