kopia lustrzana https://github.com/inkstitch/inkstitch
fix defaulting of stroke width to 1
rodzic
4a2162e258
commit
d06ff488f0
|
@ -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
|
||||
|
|
|
@ -57,10 +57,7 @@ class Stroke(EmbroideryElement):
|
|||
def is_running_stitch(self):
|
||||
# using stroke width <= 0.5 pixels to indicate running stitch is deprecated in favor of dashed lines
|
||||
|
||||
try:
|
||||
stroke_width = float(self.get_style("stroke-width"))
|
||||
except ValueError:
|
||||
stroke_width = 1
|
||||
stroke_width = float(self.get_style("stroke-width", 1))
|
||||
|
||||
if self.dashed:
|
||||
return True
|
||||
|
|
Ładowanie…
Reference in New Issue