- fixed an issue in old default file detection and in saving the factory defaults file
- in Preferences window removed the Import/Export Preferences buttons because they are redundant with the entries in the File -> Menu -> Backup. and added a button to Restore Defaults - when in Basic mode the Tool type of the tool in the Geometry UI Tool Table after isolating a Gerber object is automatically selected as 'C1' - let the multiprocessing Pool have as many processes as needed - added a new Preferences setting allowing a custom mouse line width (to make it thicker or thinner)
This commit is contained in:
@@ -375,16 +375,19 @@ class PlotCanvasLegacy(QtCore.QObject):
|
||||
pass
|
||||
# log.debug("Cache updated the screen!")
|
||||
|
||||
def new_cursor(self, axes=None, big=None):
|
||||
def new_cursor(self, axes=None, big=None, color=None):
|
||||
# if axes is None:
|
||||
# c = MplCursor(axes=self.axes, color='black', linewidth=1)
|
||||
# else:
|
||||
# c = MplCursor(axes=axes, color='black', linewidth=1)
|
||||
|
||||
if self.app.defaults['global_theme'] == 'white':
|
||||
color = '#000000'
|
||||
if color:
|
||||
color = color
|
||||
else:
|
||||
color = '#FFFFFF'
|
||||
if self.app.defaults['global_theme'] == 'white':
|
||||
color = '#000000'
|
||||
else:
|
||||
color = '#FFFFFF'
|
||||
|
||||
if big is True:
|
||||
self.big_cursor = True
|
||||
@@ -398,7 +401,7 @@ class PlotCanvasLegacy(QtCore.QObject):
|
||||
|
||||
return c
|
||||
|
||||
def draw_cursor(self, x_pos, y_pos):
|
||||
def draw_cursor(self, x_pos, y_pos, color=None):
|
||||
"""
|
||||
Draw a cursor at the mouse grid snapped position
|
||||
|
||||
@@ -408,10 +411,13 @@ class PlotCanvasLegacy(QtCore.QObject):
|
||||
"""
|
||||
# there is no point in drawing mouse cursor when panning as it jumps in a confusing way
|
||||
if self.app.app_cursor.enabled is True and self.panning is False:
|
||||
if self.app.defaults['global_theme'] == 'white':
|
||||
color = '#000000'
|
||||
if color:
|
||||
color = color
|
||||
else:
|
||||
color = '#FFFFFF'
|
||||
if self.app.defaults['global_theme'] == 'white':
|
||||
color = '#000000'
|
||||
else:
|
||||
color = '#FFFFFF'
|
||||
|
||||
if self.big_cursor is False:
|
||||
try:
|
||||
@@ -421,10 +427,11 @@ class PlotCanvasLegacy(QtCore.QObject):
|
||||
# The size of the cursor is multiplied by 1.65 because that value made the cursor similar with the
|
||||
# one in the OpenGL(3D) graphic engine
|
||||
pointer_size = int(float(self.app.defaults["global_cursor_size"] ) * 1.65)
|
||||
elements = self.axes.plot(x, y, '+', color=color, ms=pointer_size, mew=1, animated=True)
|
||||
elements = self.axes.plot(x, y, '+', color=color, ms=pointer_size,
|
||||
mew=self.app.defaults["global_cursor_width"], animated=True)
|
||||
for el in elements:
|
||||
self.axes.draw_artist(el)
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
# this happen at app initialization since self.app.geo_editor does not exist yet
|
||||
# I could reshuffle the object instantiating order but what's the point?
|
||||
# I could crash something else and that's pythonic, too
|
||||
|
||||
Reference in New Issue
Block a user