Jelajahi Sumber

- 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

Marius Stanciu 6 tahun lalu
induk
melakukan
ba549705a2
2 mengubah file dengan 12 tambahan dan 5 penghapusan
  1. 10 4
      FlatCAMApp.py
  2. 2 1
      README.md

+ 10 - 4
FlatCAMApp.py

@@ -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

+ 2 - 1
README.md

@@ -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
 - 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
-- 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
 - 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
+- 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