From 399cc982dfecb8ae26da8effe219271e9b7b61ed Mon Sep 17 00:00:00 2001 From: Amritpal Singh Date: Fri, 6 Jul 2018 00:29:26 +0530 Subject: [PATCH] Show color of object wrt to its transparency while exporting SVG file. --- src/Mod/Draft/Draft.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py index c8a77208c3..ddb0dfdb49 100644 --- a/src/Mod/Draft/Draft.py +++ b/src/Mod/Draft/Draft.py @@ -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)