diff options
| author | Lex Neva <lexelby@users.noreply.github.com> | 2023-10-22 11:55:02 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-22 17:55:02 +0200 |
| commit | d153132cf46926fda1935db436528d4beaf96c6f (patch) | |
| tree | c8a18d5b56d9180bf3e60d1549c6d3d149a67baf /lib/gui/simulator.py | |
| parent | e4564b8852dc3c6cd65b59a2331d97b19d0c3dea (diff) | |
don't handle simulator click before stitch plan is loaded (#2570)
Diffstat (limited to 'lib/gui/simulator.py')
| -rw-r--r-- | lib/gui/simulator.py | 13 |
1 files changed, 7 insertions, 6 deletions
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(): |
