don't crash on a design with no stitches

pull/364/head
Lex Neva 2018-12-30 19:59:07 -05:00
rodzic c8d354a2fc
commit 004df12e88
2 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -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()

Wyświetl plik

@ -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)