Show color of object wrt to its transparency while exporting SVG file.

This commit is contained in:
Amritpal Singh
2018-07-06 00:29:26 +05:30
committed by Yorik van Havre
parent 53537c9d08
commit 399cc982df

View File

@@ -2207,6 +2207,10 @@ def getSVG(obj,scale=1,linewidth=0.35,fontsize=12,fillstyle="shape color",direct
svg += ';stroke-miterlimit:4'
svg += ';stroke-dasharray:' + lstyle
svg += ';fill:' + fill
try:
svg += ';fill-opacity:' + str(fill_opacity)
except NameError:
pass
svg += ';fill-rule: evenodd "'
svg += '/>\n'
return svg
@@ -2660,6 +2664,7 @@ def getSVG(obj,scale=1,linewidth=0.35,fontsize=12,fillstyle="shape color",direct
if (m != "Wireframe"):
if fillstyle == "shape color":
fill = getrgb(obj.ViewObject.ShapeColor,testbw=False)
fill_opacity = 1 - (obj.ViewObject.Transparency / 100.0)
else:
fill = 'url(#'+fillstyle+')'
svg += getPattern(fillstyle)