add restart option for simulator

pull/10/head
Lex Neva 2018-01-01 15:00:58 -05:00
rodzic e9bddedf36
commit 084dc783d2
1 zmienionych plików z 8 dodań i 1 usunięć

Wyświetl plik

@ -84,6 +84,10 @@ class EmbroiderySimulator(wx.Frame):
self.timer.Stop()
else:
self.timer.Start(self.frame_period)
elif keycode == ord("R"):
self.stop()
self.clear()
self.go()
self.frame_period = max(1, self.frame_period)
self.stitches_per_frame = max(self.stitches_per_frame, 1)
@ -208,7 +212,10 @@ class EmbroiderySimulator(wx.Frame):
self.clear()
self.current_stitch = 0
self.timer = wx.PyTimer(self.draw_one_frame)
if not self.timer:
self.timer = wx.PyTimer(self.draw_one_frame)
self.timer.Start(self.frame_period)
def on_close(self, event):