From 9866997f0d9682dde51036657a92265002713a4e Mon Sep 17 00:00:00 2001 From: Michal Maciola Date: Tue, 14 Sep 2021 16:51:32 +0200 Subject: [PATCH] common json: fix for an empty layer used as a mask If a layer is empty, do not use it as a mask, so not to incorrectly completely hide a parent layer. Change-Id: Ia48b0b150faa3a1fd44cc79c16facab14ab00564 --- src/static_libs/vg_common/vg_common_json.c | 10 ++++++---- 1 file changed, 6 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 7664494..6a3fef3 100644 --- a/src/static_libs/vg_common/vg_common_json.c +++ b/src/static_libs/vg_common/vg_common_json.c @@ -301,10 +301,10 @@ _construct_masks(Tvg_Paint *mtarget, LOTMask *masks, unsigned int mask_cnt, int return mtarget; } -static void +static Eina_Bool _update_vg_tree(Tvg_Paint *root, const LOTLayerNode *layer, int depth EINA_UNUSED) { - if (!layer->mVisible) return; + if (!layer->mVisible) return EINA_FALSE; Tvg_Paint *ptree = NULL; @@ -327,13 +327,13 @@ _update_vg_tree(Tvg_Paint *root, const LOTLayerNode *layer, int depth EINA_UNUSE //Source Layer Tvg_Paint *ctree = tvg_scene_new(); - _update_vg_tree(ctree, clayer, depth+1); + Eina_Bool hastree = _update_vg_tree(ctree, clayer, depth+1); if (matte_mode == TVG_COMPOSITE_METHOD_NONE) { tvg_scene_push(root, ctree); } - else + else if (hastree == EINA_TRUE) { tvg_paint_set_composite_method(ptree, ctree, matte_mode); mtarget = ctree; @@ -382,6 +382,8 @@ _update_vg_tree(Tvg_Paint *root, const LOTLayerNode *layer, int depth EINA_UNUSE //Construct drawable nodes. if (layer->mNodeList.size > 0) _construct_drawable_nodes(root, layer, depth); + + return layer->mLayerList.size || layer->mNodeList.size; } #endif -- 2.7.4