diff options
Diffstat (limited to 'lib/gui/simulator/simulator_preferences.py')
| -rw-r--r-- | lib/gui/simulator/simulator_preferences.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/gui/simulator/simulator_preferences.py b/lib/gui/simulator/simulator_preferences.py index a3e23bdc..9954c8f2 100644 --- a/lib/gui/simulator/simulator_preferences.py +++ b/lib/gui/simulator/simulator_preferences.py @@ -1,6 +1,6 @@ # Authors: see git history # -# Copyright (c) 2010 Authors +# Copyright (c) 2024 Authors # Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details. import wx @@ -54,7 +54,7 @@ class SimulatorPreferenceDialog(wx.Dialog): def on_change(self, attribute, event): global_settings[attribute] = event.EventObject.GetValue() - if attribute == 'simulator_line_width': + if self.drawing_panel.loaded and attribute == 'simulator_line_width': self.drawing_panel.update_pen_size() self.drawing_panel.Refresh() @@ -66,6 +66,7 @@ class SimulatorPreferenceDialog(wx.Dialog): def on_cancel(self, event): global_settings['simulator_line_width'] = self.line_width_value global_settings['simulator_npp_size'] = self.npp_size_value - self.drawing_panel.update_pen_size() - self.drawing_panel.Refresh() + if self.drawing_panel.loaded: + self.drawing_panel.update_pen_size() + self.drawing_panel.Refresh() self.Destroy() |
