- 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:
Marius Stanciu
2019-10-04 21:11:02 +03:00
committed by Marius
parent 01a9763ad6
commit ba549705a2
2 changed files with 12 additions and 5 deletions

View File

@@ -3229,10 +3229,16 @@ class App(QtCore.QObject):
self.grb_editor.deactivate_grb_editor() self.grb_editor.deactivate_grb_editor()
# delete the old object (the source object) if it was an empty one # delete the old object (the source object) if it was an empty one
if len(edited_obj.solid_geometry) == 0: try:
old_name = edited_obj.options['name'] if len(edited_obj.solid_geometry) == 0:
self.collection.set_active(old_name) old_name = edited_obj.options['name']
self.collection.delete_active() 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 # restore GUI to the Selected TAB
# Remove anything else in the GUI # Remove anything else in the GUI

View File

@@ -19,10 +19,11 @@ CAD program, and create G-Code for Isolation routing.
- some code annotations to make it easier to navigate in the FlatCAMGUI.py - some code annotations to make it easier to navigate in the FlatCAMGUI.py
- fixed exit FullScreen with Escape key - fixed exit FullScreen with Escape key
- added a new menu category in the MenuBar named 'Objects'. It will hold the objects found in the Project tab. Useful when working in FullScreen - added a new menu category in the MenuBar named 'Objects'. It will hold the objects found in the Project tab. Useful when working in FullScreen
- disabeld a log.debug in ObjectColection.get_by_name() - disabled a log.debug in ObjectColection.get_by_name()
- added a Toggle Notebook button named 'NB' in the QMenBar which toggle the notebook - added a Toggle Notebook button named 'NB' in the QMenBar which toggle the notebook
- in Gerber isolation section, the tool dia value is updated when changing from Circular to V-shape and reverse - in Gerber isolation section, the tool dia value is updated when changing from Circular to V-shape and reverse
- in Tool Film, when punching holes in a positive film, if the resulting object geometry is the same as the source object geometry, the film will not ge generated - in Tool Film, when punching holes in a positive film, if the resulting object geometry is the same as the source object geometry, the film will not ge generated
- 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
3.10.2019 3.10.2019