Fixed missing first segment in path bug. Delete last point in sequence while drawing object with backspace.
This commit is contained in:
@@ -457,6 +457,11 @@ class FCPolygon(FCShapeTool):
|
|||||||
self.geometry = DrawToolShape(Polygon(self.points))
|
self.geometry = DrawToolShape(Polygon(self.points))
|
||||||
self.complete = True
|
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):
|
class FCPath(FCPolygon):
|
||||||
"""
|
"""
|
||||||
@@ -468,13 +473,18 @@ class FCPath(FCPolygon):
|
|||||||
self.complete = True
|
self.complete = True
|
||||||
|
|
||||||
def utility_geometry(self, data=None):
|
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 = [x for x in self.points]
|
||||||
temp_points.append(data)
|
temp_points.append(data)
|
||||||
return DrawToolUtilityShape(LineString(temp_points))
|
return DrawToolUtilityShape(LineString(temp_points))
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def on_key(self, key):
|
||||||
|
if key == 'backspace':
|
||||||
|
if len(self.points) > 0:
|
||||||
|
self.points = self.points[0:-1]
|
||||||
|
|
||||||
|
|
||||||
class FCSelect(DrawTool):
|
class FCSelect(DrawTool):
|
||||||
def __init__(self, draw_app):
|
def __init__(self, draw_app):
|
||||||
|
|||||||
Reference in New Issue
Block a user