From abdf88cf0f5ad1aa1dbc8e72bcb4ac9aacdba0c8 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Thu, 12 Nov 2020 17:49:24 +0200 Subject: [PATCH] - fixed bug that inversed mouse cursor movement versus the real movement on Y axis when Grid lines are Off --- CHANGELOG.md | 1 + appGUI/PlotCanvas.py | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 523c854b..7e75f881 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ CHANGELOG for FlatCAM beta - removed the "follow" functionality from the Isolation Tool - created a new application Tool named Follow Tool - added the "follow" functionality in the Follow Tool and added the new feature of allowing to perform "follow" on an area selection +- fixed bug that inversed mouse cursor movement versus the real movement on Y axis when Grid lines are Off 11.11.2020 diff --git a/appGUI/PlotCanvas.py b/appGUI/PlotCanvas.py index 0b8872b9..1f8f6fd9 100644 --- a/appGUI/PlotCanvas.py +++ b/appGUI/PlotCanvas.py @@ -276,16 +276,29 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas): def on_toggle_grid_lines(self, signal=None, silent=None): state = not self.grid_lines_enabled + settings = QtCore.QSettings("Open Source", "FlatCAM") + if settings.contains("theme"): + theme = settings.value('theme', type=str) + else: + theme = 'white' + + if theme == 'white': + color = 'dimgray' + else: + color = '#dededeff' + if state: self.fcapp.defaults['global_grid_lines'] = True self.grid_lines_enabled = True - self.grid.parent = self.view.scene + # self.grid.parent = self.view.scene + self.grid._grid_color_fn['color'] = Color(color).rgba if silent is None: self.fcapp.inform[str, bool].emit(_("Grid enabled."), False) else: self.fcapp.defaults['global_grid_lines'] = False self.grid_lines_enabled = False - self.grid.parent = None + # self.grid.parent = None + self.grid._grid_color_fn['color'] = Color('#FFFFFFFF').rgba if silent is None: self.fcapp.inform[str, bool].emit(_("Grid disabled."), False)