From b8d694f1c290e0d43d1c23a487a99335ee753784 Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Mon, 10 Mar 2025 08:00:53 +0100 Subject: Simulator ruler (#3554) * set pen for scale drawing * ignore ruler in windows when current_stitch < 2 --- lib/gui/simulator/drawing_panel.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib') 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), -- cgit v1.2.3