Преглед на файлове

Fixed missing first segment in path bug. Delete last point in sequence while drawing object with backspace.

Juan Pablo Caram преди 10 години
родител
ревизия
83eb535479
променени са 1 файла, в които са добавени 11 реда и са изтрити 1 реда
  1. 11 1
      FlatCAMDraw.py

+ 11 - 1
FlatCAMDraw.py

@@ -457,6 +457,11 @@ class FCPolygon(FCShapeTool):
         self.geometry = DrawToolShape(Polygon(self.points))
         self.complete = True
 
+    def on_key(self, key):
+        if key == 'backspace':
+            if len(self.points) > 0:
+                self.points = self.points[0:-1]
+
 
 class FCPath(FCPolygon):
     """
@@ -468,13 +473,18 @@ class FCPath(FCPolygon):
         self.complete = True
 
     def utility_geometry(self, data=None):
-        if len(self.points) > 1:
+        if len(self.points) > 0:
             temp_points = [x for x in self.points]
             temp_points.append(data)
             return DrawToolUtilityShape(LineString(temp_points))
 
         return None
 
+    def on_key(self, key):
+        if key == 'backspace':
+            if len(self.points) > 0:
+                self.points = self.points[0:-1]
+
 
 class FCSelect(DrawTool):
     def __init__(self, draw_app):