diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2025-03-10 08:00:53 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-10 08:00:53 +0100 |
| commit | b8d694f1c290e0d43d1c23a487a99335ee753784 (patch) | |
| tree | 8cc8c958cc920d548803b3b78d7f364e523777e1 /lib | |
| parent | 99509df8d8abf1e7b701a4a09cf170a362f6d878 (diff) | |
Simulator ruler (#3554)
* set pen for scale drawing
* ignore ruler in windows when current_stitch < 2
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/gui/simulator/drawing_panel.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/gui/simulator/drawing_panel.py b/lib/gui/simulator/drawing_panel.py index 4a07bfd7..6954f17d 100644 --- a/lib/gui/simulator/drawing_panel.py +++ b/lib/gui/simulator/drawing_panel.py @@ -3,6 +3,7 @@ # Copyright (c) 2024 Authors # Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details. import time +from sys import platform import wx from numpy import split @@ -136,7 +137,11 @@ class DrawingPanel(wx.Panel): canvas = wx.GraphicsContext.Create(dc) self.draw_stitches(canvas) - self.draw_scale(canvas) + + if platform != "win32" or self.current_stitch >= 2: + # on Windows the positioning of the ruler is a bit problematic + # when current_stitch is smaller than 2 + self.draw_scale(canvas) def draw_page(self, canvas): self._update_background_color() @@ -233,6 +238,7 @@ class DrawingPanel(wx.Panel): scale_lower_left_x = 20 scale_lower_left_y = canvas_height - 30 + canvas.SetPen(self.black_pen) canvas.StrokeLines(((scale_lower_left_x, scale_lower_left_y - 6), (scale_lower_left_x, scale_lower_left_y), (scale_lower_left_x + scale_width / 2.0, scale_lower_left_y), |
