hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8f440cdedc090fd71fbda4c10bf2f4af6bafec40
commit 8f440cdedc090fd71fbda4c10bf2f4af6bafec40 Author: JunsuChoi <jsuya.c...@samsung.com> Date: Mon Aug 19 19:46:01 2019 +0900 vg_common_svg: Apply node opacity to stroke color Summary: When an object to be converted to a stroke or path uses "opacity" attribute, opacity is also applied. Test Plan: [SVG] <?xml version="1.0" encoding="UTF-8"?> <svg width="40px" height="40px" viewBox="0 0 40 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- Generator: Sketch 52.6 (67491) - http://www.bohemiancoding.com/sketch --> <rect fill="#FF0000" opacity="0" x="0" y="0" width="40" height="40"></rect> <path d="M12,20 L25,8 L12,20 Z M12,20 L25,32 L12,20 Z" id="Combined-Shape" stroke="#FFFFFF" stroke-width="2" opacity="0.12" stroke-linecap="round" stroke-linejoin="round" fill-rule="nonzero"></path> </svg> [Code] int main(int argc, char **argv) { setenv("ECTOR_BACKEND", "default", 1); elm_init(argc, argv); Evas_Object *win = elm_win_util_standard_add(NULL, "test"); evas_object_smart_callback_add(win, "delete,request", win_del, 0); elm_win_autodel_set(win, 1); Evas *evas = evas_object_evas_get(win); Evas_Object *vg = evas_object_vg_add(evas); evas_object_show(vg); Evas_Object *container = evas_vg_container_add(vg); evas_object_vg_root_node_set(vg, container); Evas_Object *svg = efl_add(EFL_CANVAS_VG_OBJECT_CLASS, container); efl_file_simple_load(svg, "./i_arrow_l_disable.svg", NULL); efl_gfx_entity_size_set(svg, EINA_SIZE2D(600, 600)); efl_gfx_entity_visible_set(svg, EINA_TRUE); evas_object_size_hint_weight_set(svg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(svg, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_win_resize_object_add(win, vg); evas_object_resize(win, 600, 600); evas_object_show(win); elm_run(); elm_shutdown(); return 0; } Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9620 --- src/static_libs/vg_common/vg_common_svg.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/static_libs/vg_common/vg_common_svg.c b/src/static_libs/vg_common/vg_common_svg.c index e3866e2018..5f8398d44b 100644 --- a/src/static_libs/vg_common/vg_common_svg.c +++ b/src/static_libs/vg_common/vg_common_svg.c @@ -784,6 +784,15 @@ _apply_vg_property(Svg_Node *node, Efl_VG *vg, Efl_VG *parent, Vg_File_Data *vg_ efl_gfx_shape_stroke_color_set(vg, style->stroke.paint.r, style->stroke.paint.g, style->stroke.paint.b, style->stroke.opacity); } + + //apply node opacity to stroke color + if (style->opacity < 255) + { + int r, g, b, a; + efl_gfx_shape_stroke_color_get(vg, &r, &g, &b, &a); + float fa = ((float) style->opacity / 255); + efl_gfx_shape_stroke_color_set(vg, ((float) r) * fa, ((float) g) * fa, ((float) b) * fa, ((float) a) * fa); + } } static void --