Draft: Small layer improvements
- Added 'Print Line Color' property - Added 'Add new layer' context menu action to layers group
This commit is contained in:
@@ -478,7 +478,12 @@ def get_svg(obj,
|
||||
else:
|
||||
stroke = utils.get_rgb(color)
|
||||
elif App.GuiUp:
|
||||
if hasattr(obj, "ViewObject"):
|
||||
# find print color
|
||||
pc = get_print_color(obj)
|
||||
if pc:
|
||||
stroke = utils.get_rgb(pc)
|
||||
# get line color
|
||||
elif hasattr(obj, "ViewObject"):
|
||||
if hasattr(obj.ViewObject, "LineColor"):
|
||||
stroke = utils.get_rgb(obj.ViewObject.LineColor)
|
||||
elif hasattr(obj.ViewObject, "TextColor"):
|
||||
@@ -918,6 +923,17 @@ def get_svg(obj,
|
||||
return svg
|
||||
|
||||
|
||||
def get_print_color(obj):
|
||||
"""returns the print color of the parent layer, if available"""
|
||||
for parent in obj.InListRecursive:
|
||||
if (hasattr(parent,"ViewObject")
|
||||
and hasattr(parent.ViewObject,"UsePrintColor")
|
||||
and parent.ViewObject.UsePrintColor):
|
||||
if hasattr(parent.ViewObject,"LinePrintColor"):
|
||||
return parent.ViewObject.LinePrintColor
|
||||
return None
|
||||
|
||||
|
||||
def getSVG(obj,
|
||||
scale=1, linewidth=0.35, fontsize=12,
|
||||
fillstyle="shape color", direction=None,
|
||||
|
||||
Reference in New Issue
Block a user