kopia lustrzana https://github.com/inkstitch/inkstitch
fix corrupted presets error (#715)
rodzic
c65b437cae
commit
5c7b97c9fe
|
@ -122,7 +122,7 @@ class Fill(EmbroideryElement):
|
||||||
@cache
|
@cache
|
||||||
def paths(self):
|
def paths(self):
|
||||||
paths = self.flatten(self.parse_path())
|
paths = self.flatten(self.parse_path())
|
||||||
#ensure path length
|
# ensure path length
|
||||||
for i, path in enumerate(paths):
|
for i, path in enumerate(paths):
|
||||||
if len(path) < 3:
|
if len(path) < 3:
|
||||||
paths[i] = [(path[0][0], path[0][1]), (path[0][0]+1.0, path[0][1]), (path[0][0], path[0][1]+1.0)]
|
paths[i] = [(path[0][0], path[0][1]), (path[0][0]+1.0, path[0][1]), (path[0][0], path[0][1]+1.0)]
|
||||||
|
|
|
@ -98,7 +98,7 @@ class PresetsPanel(wx.Panel):
|
||||||
with open(self.presets_path(), 'r') as presets:
|
with open(self.presets_path(), 'r') as presets:
|
||||||
presets = json.load(presets)
|
presets = json.load(presets)
|
||||||
return presets
|
return presets
|
||||||
except IOError:
|
except (IOError, ValueError):
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
def _save_presets(self, presets):
|
def _save_presets(self, presets):
|
||||||
|
|
|
@ -41,10 +41,10 @@ SVG_OBJECT_TAGS = (SVG_ELLIPSE_TAG, SVG_CIRCLE_TAG, SVG_RECT_TAG)
|
||||||
INKSTITCH_ATTRIBS = {}
|
INKSTITCH_ATTRIBS = {}
|
||||||
inkstitch_attribs = [
|
inkstitch_attribs = [
|
||||||
'ties',
|
'ties',
|
||||||
'trim_after',
|
|
||||||
'stop_after',
|
|
||||||
# clone
|
# clone
|
||||||
'clone',
|
'clone',
|
||||||
|
# polyline
|
||||||
|
'polyline',
|
||||||
# fill
|
# fill
|
||||||
'angle',
|
'angle',
|
||||||
'auto_fill',
|
'auto_fill',
|
||||||
|
@ -86,8 +86,8 @@ inkstitch_attribs = [
|
||||||
'pull_compensation_mm',
|
'pull_compensation_mm',
|
||||||
'stroke_first',
|
'stroke_first',
|
||||||
# Legacy
|
# Legacy
|
||||||
'embroider_trim_after',
|
'trim_after',
|
||||||
'embroider_stop_after'
|
'stop_after'
|
||||||
]
|
]
|
||||||
for attrib in inkstitch_attribs:
|
for attrib in inkstitch_attribs:
|
||||||
INKSTITCH_ATTRIBS[attrib] = inkex.addNS(attrib, 'inkstitch')
|
INKSTITCH_ATTRIBS[attrib] = inkex.addNS(attrib, 'inkstitch')
|
||||||
|
|
Ładowanie…
Reference in New Issue