Arch: Added SectionColor property to Arch Materials

This commit is contained in:
Yorik van Havre
2020-10-20 14:43:33 +02:00
parent 1a2b75ab03
commit 0d511d0551
2 changed files with 35 additions and 7 deletions

View File

@@ -259,7 +259,9 @@ def getFillForObject(o, defaultFill, source):
elif isinstance(o,str):
material = FreeCAD.ActiveDocument.getObject(o)
if material:
if hasattr(material, 'Color') and material.Color:
if hasattr(material, 'SectionColor') and material.SectionColor:
return material.SectionColor
elif hasattr(material, 'Color') and material.Color:
return material.Color
return defaultFill
@@ -507,7 +509,7 @@ def getSVG(source,
# temporarily disabling fill patterns
svgcache += Draft.get_svg(s,
linewidth=0,
fillstyle=Draft.getrgb(objectFill),
fillstyle=Draft.getrgb(objectFill,testbw=False),
direction=direction.negative(),
color=lineColor)
svgcache += "</g>\n"