- made sure that the redraw_on_top_on_project_click works properly and only on mouse click release in the Project list

- made sure that the `redraw_on_top_on_project_click` works only on single object selections
This commit is contained in:
Marius Stanciu
2022-02-11 11:06:08 +02:00
committed by Marius
parent 5421b65b9e
commit 529148c60d
4 changed files with 30 additions and 17 deletions

View File

@@ -8994,14 +8994,18 @@ class App(QtCore.QObject):
self.clear_pool()
def gerber_redraw(self):
# the Gerber redraw should work only if there is only one object of type Gerber and active in the selection
sel_gerb_objs = [o for o in self.collection.get_selected() if o.kind == 'gerber' and o.options['plot']]
if len(sel_gerb_objs) > 1:
return
obj = self.collection.get_active()
if obj.options['plot'] is False or obj.kind != 'gerber':
if not obj or (obj.options['plot'] is False or obj.kind != 'gerber'):
# we don't replot something that is disabled or if it is not Gerber type
return
def worker_task(plot_obj):
with self.proc_container.new(''):
plot_obj.plot(visible=True)
plot_obj.plot(visible=True)
self.worker_task.emit({'fcn': worker_task, 'params': [obj]})