diff options
author | JunsuChoi <jsuya.choi@samsung.com> | 2020-09-15 12:11:49 +0900 |
---|---|---|
committer | Hermet Park <chuneon.park@samsung.com> | 2020-09-15 12:11:49 +0900 |
commit | 35f17a13fa0cd1de855cc2215e4f0ac9da6fb7bc (patch) | |
tree | 0a03fce07557e15edfaf987453811aa43d447ba2 /src/static_libs | |
parent | c412406487579627b79f417f947ca512aa034ce0 (diff) | |
download | efl-35f17a13fa0cd1de855cc2215e4f0ac9da6fb7bc.tar.gz |
vg_load_svg: Support dasharray attribute for stroke
Summary:
It supports stroke-dasharray, one of the stroke properties of svg.
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray
Test Plan:
[Test SVG]
<svg viewBox="0 0 30 10" xmlns="http://www.w3.org/2000/svg">
<!-- No dashes nor gaps -->
<line x1="0" y1="1" x2="30" y2="1" stroke="black" />
<!-- Dashes and gaps of the same size -->
<line x1="0" y1="3" x2="30" y2="3" stroke="black"
stroke-dasharray="4" />
<!-- Dashes and gaps of different sizes -->
<line x1="0" y1="5" x2="30" y2="5" stroke="black"
stroke-dasharray="4 1" />
<!-- Dashes and gaps of various sizes with an odd number of values -->
<line x1="0" y1="7" x2="30" y2="7" stroke="black"
stroke-dasharray="4 1 2" />
<!-- Dashes and gaps of various sizes with an even number of values -->
<line x1="0" y1="9" x2="30" y2="9" stroke="black"
stroke-dasharray="4 1 2 3" />
</svg>
Reviewers: Hermet, smohanty
Reviewed By: Hermet
Subscribers: kimcinoo, herb, cedric, #committers, #reviewers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D12146
Diffstat (limited to 'src/static_libs')
-rw-r--r-- | src/static_libs/vg_common/vg_common_svg.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/static_libs/vg_common/vg_common_svg.c b/src/static_libs/vg_common/vg_common_svg.c index f5b71c43d2..38e203b205 100644 --- a/src/static_libs/vg_common/vg_common_svg.c +++ b/src/static_libs/vg_common/vg_common_svg.c @@ -498,6 +498,7 @@ _node_style_free(Svg_Style_Property *style) eina_stringshare_del(style->fill.paint.url); _svg_style_gradient_free(style->stroke.paint.gradient); eina_stringshare_del(style->stroke.paint.url); + if (style->stroke.dash) free(style->stroke.dash); free(style); } @@ -770,6 +771,8 @@ _apply_vg_property(Svg_Node *node, Efl_VG *vg, Efl_VG *parent, Vg_File_Data *vg_ efl_gfx_shape_stroke_cap_set(vg, style->stroke.cap); efl_gfx_shape_stroke_join_set(vg, style->stroke.join); efl_gfx_shape_stroke_scale_set(vg, style->stroke.scale); + if (style->stroke.dash && style->stroke.dash_count > 0) + efl_gfx_shape_stroke_dash_set(vg, style->stroke.dash, style->stroke.dash_count); // if stroke property is NULL then do nothing if (style->stroke.paint.none) |