From 83eb535479238095533d443829021fa729c0af64 Mon Sep 17 00:00:00 2001 From: Juan Pablo Caram Date: Wed, 4 Nov 2015 18:07:23 -0500 Subject: [PATCH] Fixed missing first segment in path bug. Delete last point in sequence while drawing object with backspace. --- FlatCAMDraw.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/FlatCAMDraw.py b/FlatCAMDraw.py index 659506e9..05a90c5c 100644 --- a/FlatCAMDraw.py +++ b/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):