vg_common_svg: Support opacity attribute of <g> element

Summary:
The <g> element can have an opacity.
Therefore, if node type is SVG_NODE_G, set color.

Test Plan: N/A

Reviewers: Hermet, smohanty, kimcinoo

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10371
This commit is contained in:
junsu choi 2019-10-15 14:53:25 +09:00 committed by Hermet Park
parent ca32732373
commit 74e2c80b6e
1 changed files with 6 additions and 4 deletions

View File

@ -718,10 +718,7 @@ _apply_vg_property(Svg_Node *node, Efl_VG *vg, Efl_VG *parent, Vg_File_Data *vg_
if (node->type != SVG_NODE_DOC && !node->display) efl_gfx_entity_visible_set(vg, EINA_FALSE);
if ((node->type == SVG_NODE_G) || (node->type == SVG_NODE_DOC)) return;
// apply the fill style property
efl_gfx_shape_fill_rule_set(vg, style->fill.fill_rule);
if (node->type == SVG_NODE_DOC) return;
// if fill property is NULL then do nothing
if (style->fill.paint.none)
@ -757,6 +754,11 @@ _apply_vg_property(Svg_Node *node, Efl_VG *vg, Efl_VG *parent, Vg_File_Data *vg_
efl_gfx_color_set(vg, ((float) r) * fa, ((float) g) * fa, ((float) b) * fa, ((float) a) * fa);
}
if (node->type == SVG_NODE_G) return;
// apply the fill style property
efl_gfx_shape_fill_rule_set(vg, style->fill.fill_rule);
efl_gfx_shape_stroke_width_set(vg, style->stroke.width);
efl_gfx_shape_stroke_cap_set(vg, style->stroke.cap);
efl_gfx_shape_stroke_join_set(vg, style->stroke.join);