summaryrefslogtreecommitdiff
path: root/lib/elements/element.py
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2018-06-10 15:13:51 -0400
committerLex Neva <github.com@lexneva.name>2018-06-10 15:25:46 -0400
commitd06ff488f0977ab52dbf0169d85cc5d7a413e079 (patch)
tree92309161007a4cfbde3108e69dc6ae36c9fe9711 /lib/elements/element.py
parent4a2162e25892da7ce49b944532ebc8f2a9786a28 (diff)
fix defaulting of stroke width to 1
Diffstat (limited to 'lib/elements/element.py')
-rw-r--r--lib/elements/element.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/elements/element.py b/lib/elements/element.py
index 42f6c470..39437c9f 100644
--- a/lib/elements/element.py
+++ b/lib/elements/element.py
@@ -135,10 +135,10 @@ class EmbroideryElement(object):
self.node.set("embroider_%s" % name, str(value))
@cache
- def get_style(self, style_name):
+ def get_style(self, style_name, default=None):
style = simplestyle.parseStyle(self.node.get("style"))
if (style_name not in style):
- return None
+ return default
value = style[style_name]
if value == 'none':
return None
@@ -161,7 +161,7 @@ class EmbroideryElement(object):
@property
@cache
def stroke_width(self):
- width = self.get_style("stroke-width")
+ width = self.get_style("stroke-width", "1")
if width is None:
return 1.0