From d153132cf46926fda1935db436528d4beaf96c6f Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sun, 22 Oct 2023 11:55:02 -0400 Subject: don't handle simulator click before stitch plan is loaded (#2570) --- lib/gui/simulator.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lib/gui/simulator.py') diff --git a/lib/gui/simulator.py b/lib/gui/simulator.py index b6a8a6cc..863800bd 100644 --- a/lib/gui/simulator.py +++ b/lib/gui/simulator.py @@ -753,12 +753,13 @@ class DrawingPanel(wx.Panel): self.set_current_stitch(self.current_stitch - 1) def on_left_mouse_button_down(self, event): - self.CaptureMouse() - self.drag_start = event.GetPosition() - self.drag_original_pan = self.pan - self.Bind(wx.EVT_MOTION, self.on_drag) - self.Bind(wx.EVT_MOUSE_CAPTURE_LOST, self.on_drag_end) - self.Bind(wx.EVT_LEFT_UP, self.on_drag_end) + if self.loaded: + self.CaptureMouse() + self.drag_start = event.GetPosition() + self.drag_original_pan = self.pan + self.Bind(wx.EVT_MOTION, self.on_drag) + self.Bind(wx.EVT_MOUSE_CAPTURE_LOST, self.on_drag_end) + self.Bind(wx.EVT_LEFT_UP, self.on_drag_end) def on_drag(self, event): if self.HasCapture() and event.Dragging(): -- cgit v1.2.3