diff options
| author | Lex Neva <github.com@lexneva.name> | 2018-09-01 13:35:47 -0400 |
|---|---|---|
| committer | Lex Neva <github.com@lexneva.name> | 2018-09-01 13:35:47 -0400 |
| commit | 3fe3399d909de6549a7ce64f4347b342933b2465 (patch) | |
| tree | 7e7caa215fc5b65784a5f8f7ac3a1511ea718a43 /lib/extensions | |
| parent | 5f29e5a4a52ae8e5a434676648b0baa6253bd325 (diff) | |
simulator standalone mode
Diffstat (limited to 'lib/extensions')
| -rw-r--r-- | lib/extensions/simulate.py | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/lib/extensions/simulate.py b/lib/extensions/simulate.py index dcb5e604..e23d391b 100644 --- a/lib/extensions/simulate.py +++ b/lib/extensions/simulate.py @@ -1,8 +1,6 @@ -import wx - from .base import InkstitchExtension from ..i18n import _ -from ..simulator import EmbroiderySimulator +from ..simulator import show_simulator from ..stitch_plan import patches_to_stitch_plan @@ -19,18 +17,4 @@ class Simulate(InkstitchExtension): return patches = self.elements_to_patches(self.elements) stitch_plan = patches_to_stitch_plan(patches) - app = wx.App() - current_screen = wx.Display.GetFromPoint(wx.GetMousePosition()) - display = wx.Display(current_screen) - screen_rect = display.GetClientArea() - - simulator_pos = (screen_rect[0], screen_rect[1]) - - # subtract 1 because otherwise the window becomes maximized on Linux - width = screen_rect[2] - 1 - height = screen_rect[3] - 1 - - frame = EmbroiderySimulator(None, -1, _("Embroidery Simulation"), pos=simulator_pos, size=(width, height), stitch_plan=stitch_plan) - app.SetTopWindow(frame) - frame.Show() - app.MainLoop() + show_simulator(stitch_plan) |
