- fixed bugs in Paint Tool when painting single polygon

This commit is contained in:
Marius Stanciu 2019-11-25 18:44:38 +02:00
parent 2260bee4a5
commit cf3f7687c9
3 changed files with 7 additions and 4 deletions

View File

@ -1126,7 +1126,8 @@ class FlatCAMGerber(FlatCAMObj, Gerber):
self.app.tool_shapes.clear(update=True)
if self.poly_dict:
self.isolate(iso_type=self.iso_type, geometry=self.poly_list)
poly_list = self.poly_dict.values()
self.isolate(iso_type=self.iso_type, geometry=poly_list)
else:
self.app.inform.emit('[ERROR_NOTCL] %s' % _("List of single polygons is empty. Aborting."))

View File

@ -16,6 +16,7 @@ CAD program, and create G-Code for Isolation routing.
- made some optimizations in FlatCAMGerber.isolate() method
- updated the 'single' isolation of Gerber polygons to remove the polygon if clicked on it and it is already in the list of single polygons to be isolated
- clicking to add a polygon when doing Single type isolation will add a blue shape marking the selected polygon, second click will remove that shape
- fixed bugs in Paint Tool when painting single polygon
23.11.2019

View File

@ -1028,7 +1028,7 @@ class ToolPaint(FlatCAMTool, Gerber):
# do paint single only for left mouse clicks
if event.button == 1:
self.app.inform.emit(_("Painting polygon..."))
if self.app.is_legacy:
if self.app.is_legacy is False:
self.app.plotcanvas.graph_event_disconnect('mouse_press', doit)
else:
self.app.plotcanvas.graph_event_disconnect(self.mp)
@ -1054,6 +1054,7 @@ class ToolPaint(FlatCAMTool, Gerber):
else:
self.app.plotcanvas.graph_event_disconnect(self.app.mr)
self.app.plotcanvas.graph_event_disconnect(self.app.mp)
self.mp = self.app.plotcanvas.graph_event_connect('mouse_press', doit)
elif self.select_method == "area":
@ -1416,9 +1417,9 @@ class ToolPaint(FlatCAMTool, Gerber):
if isinstance(poly_buf, MultiPolygon):
cp = []
for pp in poly_buf:
cp.append(paint_p(pp, tooldia=tool_dia))
cp.append(paint_p(pp, tooldiameter=tool_dia))
else:
cp = paint_p(poly_buf, tooldia=tool_dia)
cp = paint_p(poly_buf, tooldiameter=tool_dia)
if cp is not None:
if isinstance(cp, list):