parsesvg: use new stroke-opacity and fill-opacity properties
This commit is contained in:
parent
d5a8eb4713
commit
f8b0c5548c
1 changed files with 17 additions and 14 deletions
|
@ -526,21 +526,25 @@ var parsesvg = func(group, path, options = nil)
|
|||
else
|
||||
parsePath(attr['d']);
|
||||
|
||||
var fillOpacity = style['fill-opacity'];
|
||||
if( fillOpacity != nil)
|
||||
stack[-1].set('fill', style['fill'] ~ sprintf("%02x", int(style['fill-opacity']*255)));
|
||||
else
|
||||
stack[-1].set('fill', style['fill']);
|
||||
var fill = style['fill'];
|
||||
if( fill != nil )
|
||||
stack[-1].set('fill', fill);
|
||||
|
||||
var fill_opacity = style['fill-opacity'];
|
||||
if( fill_opacity != nil)
|
||||
stack[-1].setDouble('fill-opacity', fill_opacity);
|
||||
|
||||
var stroke = style['stroke'];
|
||||
if( stroke != nil )
|
||||
stack[-1].set('stroke', stroke);
|
||||
|
||||
var stroke_opacity = style['stroke-opacity'];
|
||||
if( stroke_opacity != nil)
|
||||
stack[-1].setDouble('stroke-opacity', stroke_opacity);
|
||||
|
||||
var w = style['stroke-width'];
|
||||
stack[-1].setStrokeLineWidth( w != nil ? evalCSSNum(w) : 1 );
|
||||
|
||||
var strokeOpacity = style['stroke-opacity'];
|
||||
if(strokeOpacity != nil)
|
||||
stack[-1].set('stroke', (style['stroke'] ~ sprintf("%02x", int(style['stroke-opacity']*255))));
|
||||
else
|
||||
stack[-1].set('stroke', style['stroke'] or "none");
|
||||
|
||||
var linecap = style['stroke-linecap'];
|
||||
if( linecap != nil )
|
||||
stack[-1].setStrokeLineCap(style['stroke-linecap']);
|
||||
|
@ -549,7 +553,6 @@ var parsesvg = func(group, path, options = nil)
|
|||
if( linejoin != nil )
|
||||
stack[-1].setStrokeLineJoin(style['stroke-linejoin']);
|
||||
|
||||
|
||||
# http://www.w3.org/TR/SVG/painting.html#StrokeDasharrayProperty
|
||||
var dash = style['stroke-dasharray'];
|
||||
if( dash and size(dash) > 3 )
|
||||
|
|
Loading…
Reference in a new issue