summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2018-12-30 19:59:07 -0500
committerLex Neva <github.com@lexneva.name>2018-12-30 20:15:32 -0500
commit004df12e88d1531740238ab9831577123e539196 (patch)
tree13d22684140fdf97938011f754fe7f7c72d29819 /lib
parentc8d354a2fc663d49478b1b87329b0e6f11616704 (diff)
don't crash on a design with no stitches
Diffstat (limited to 'lib')
-rw-r--r--lib/gui/simulator.py4
-rw-r--r--lib/output.py2
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/gui/simulator.py b/lib/gui/simulator.py
index 0eed18c9..e0d78983 100644
--- a/lib/gui/simulator.py
+++ b/lib/gui/simulator.py
@@ -385,8 +385,8 @@ class DrawingPanel(wx.Panel):
self.go()
def choose_zoom_and_pan(self, event=None):
- # ignore if called before we load the stitch plan
- if not self.width and not self.height:
+ # ignore if EVT_SIZE fired before we load the stitch plan
+ if not self.width and not self.height and event is not None:
return
panel_width, panel_height = self.GetClientSize()
diff --git a/lib/output.py b/lib/output.py
index 2745de1d..21622765 100644
--- a/lib/output.py
+++ b/lib/output.py
@@ -5,6 +5,7 @@ import simpletransform
from .commands import global_command
from .i18n import _
+from .stitch_plan import Stitch
from .svg import PIXELS_PER_MM, get_doc_size, get_viewbox_transform
from .utils import Point
@@ -58,6 +59,7 @@ def write_embroidery_file(file_path, stitch_plan, svg, settings={}):
origin = get_origin(svg)
pattern = pyembroidery.EmbPattern()
+ stitch = Stitch(0, 0)
for color_block in stitch_plan:
pattern.add_thread(color_block.color.pyembroidery_thread)