- fixed a bug that when a Gerber object is edited and it has as solid_geometry a single Polygon, saving the result was failing due of len() function not working on a single Polygon
This commit is contained in:
@@ -3229,10 +3229,16 @@ class App(QtCore.QObject):
|
||||
self.grb_editor.deactivate_grb_editor()
|
||||
|
||||
# delete the old object (the source object) if it was an empty one
|
||||
if len(edited_obj.solid_geometry) == 0:
|
||||
old_name = edited_obj.options['name']
|
||||
self.collection.set_active(old_name)
|
||||
self.collection.delete_active()
|
||||
try:
|
||||
if len(edited_obj.solid_geometry) == 0:
|
||||
old_name = edited_obj.options['name']
|
||||
self.collection.set_active(old_name)
|
||||
self.collection.delete_active()
|
||||
except TypeError:
|
||||
# if the solid_geometry is a single Polygon the len() will not work
|
||||
# in any case, falling here means that we have something in the solid_geometry, even if only
|
||||
# a single Polygon, therefore we pass this
|
||||
pass
|
||||
|
||||
# restore GUI to the Selected TAB
|
||||
# Remove anything else in the GUI
|
||||
|
||||
Reference in New Issue
Block a user