Fixed bug #593 - Draft SVG representation of white objects

This commit is contained in:
Yorik van Havre 2012-02-13 10:44:59 -02:00
parent 8f075ab326
commit 601d292b54
3 changed files with 13012 additions and 51026 deletions

View File

@ -100,7 +100,7 @@ def getParamType(param):
return "string"
elif param in ["textheight","tolerance","gridSpacing"]:
return "float"
elif param in ["selectBaseObjects","alwaysSnap","grid","fillmode","saveonexit","maxSnap"]:
elif param in ["selectBaseObjects","alwaysSnap","grid","fillmode","saveonexit","maxSnap","SvgLinesBlack"]:
return "bool"
elif param in ["color","constructioncolor","snapcolor"]:
return "unsigned"
@ -1029,7 +1029,12 @@ def getrgb(color):
r = str(hex(int(color[0]*255)))[2:].zfill(2)
g = str(hex(int(color[1]*255)))[2:].zfill(2)
b = str(hex(int(color[2]*255)))[2:].zfill(2)
return "#"+r+g+b
col = "#"+r+g+b
if col == "#ffffff":
print getParam('SvgLinesBlack')
if getParam('SvgLinesBlack'):
col = "#000000"
return col
def getSVG(obj,modifier=100,textmodifier=100,linestyle="continuous",fillstyle="shape color",direction=None):
'''getSVG(object,[modifier],[textmodifier],[linestyle],[fillstyle],[direction]):

File diff suppressed because it is too large Load Diff

View File

@ -393,6 +393,29 @@ If color mapping is choosed, you must choose a color mapping file containing a t
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="Gui::PrefCheckBox" name="gui::prefcheckbox_6">
<property name="toolTip">
<string>When exporting SVG views, make all white linework appear in black, for better readability against white backgrounds</string>
</property>
<property name="text">
<string>Translate white line color to black</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>SvgLinesBlack</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Draft</cstring>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>