From b9943cb44f4b07f7fe52f126810accf91f6a05cd Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Fri, 17 Aug 2018 07:16:34 +0200 Subject: Improve Simulator (#261) * open simulator on the screen with the mouse cursor on * fix simulator positioning in mac * simulator shortcut keys: closes #97, closes #21 --- lib/extensions/simulate.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/extensions/simulate.py') diff --git a/lib/extensions/simulate.py b/lib/extensions/simulate.py index 0c372d4d..38f86156 100644 --- a/lib/extensions/simulate.py +++ b/lib/extensions/simulate.py @@ -17,11 +17,16 @@ class Simulate(InkstitchExtension): def effect(self): if not self.get_elements(): return - patches = self.elements_to_patches(self.elements) stitch_plan = patches_to_stitch_plan(patches) app = wx.App() - frame = EmbroiderySimulator(None, -1, _("Embroidery Simulation"), wx.DefaultPosition, size=(1000, 1000), stitch_plan=stitch_plan) + current_screen = wx.Display.GetFromPoint(wx.GetMousePosition()) + display = wx.Display(current_screen) + screen_rect = display.GetClientArea() + + simulator_pos = (screen_rect[0], screen_rect[1]) + + frame = EmbroiderySimulator(None, -1, _("Embroidery Simulation"), pos=simulator_pos, size=(1000, 1000), stitch_plan=stitch_plan) app.SetTopWindow(frame) frame.Show() wx.CallAfter(frame.go) -- cgit v1.2.3