- fixed some selection issues in the new tool Eraser in Geometry Editor

- updated the translation files
This commit is contained in:
Marius Stanciu
2019-05-22 18:37:33 +03:00
parent f400294027
commit 17a93b8c7d
10 changed files with 4423 additions and 4360 deletions

View File

@@ -12,7 +12,9 @@ CAD program, and create G-Code for Isolation routing.
22.05.2019 22.05.2019
- Geo Editor - added a new editor tool, Eraser - Geo Editor - added a new editor tool, Eraser
- PEP8 cleanup of the Geo Editor - some PEP8 cleanup of the Geo Editor
- fixed some selection issues in the new tool Eraser in Geometry Editor
- updated the translation files
21.05.2019 21.05.2019

View File

@@ -7738,7 +7738,10 @@ class FlatCAMRTree(object):
def remove_obj(self, objid, obj): def remove_obj(self, objid, obj):
# Use all ptids to delete from index # Use all ptids to delete from index
for i, pt in enumerate(self.get_points(obj)): for i, pt in enumerate(self.get_points(obj)):
self.rti.delete(self.obj2points[objid][i], (pt[0], pt[1], pt[0], pt[1])) try:
self.rti.delete(self.obj2points[objid][i], (pt[0], pt[1], pt[0], pt[1]))
except IndexError:
pass
def nearest(self, pt): def nearest(self, pt):
""" """

View File

@@ -2810,16 +2810,19 @@ class FCEraser(FCShapeTool):
def click(self, point): def click(self, point):
if len(self.draw_app.get_selected()) == 0: if len(self.draw_app.get_selected()) == 0:
for obj_shape in self.storage.get_objects(): for obj_shape in self.storage.get_objects():
try: try:
__, closest_shape = self.storage.nearest(point) __, closest_shape = self.storage.nearest(point)
self.draw_app.selected.append(closest_shape) self.draw_app.selected.append(closest_shape)
except StopIteration: except StopIteration:
if len(self.draw_app.selected) > 0:
self.draw_app.app.inform.emit(_("Click to pick-up the erase shape..."))
return "" return ""
if len(self.draw_app.get_selected()) == 0: if len(self.draw_app.get_selected()) == 0:
return "Nothing to ersase." return "Nothing to ersase."
else:
self.draw_app.app.inform.emit(_("Click to pick-up the erase shape..."))
if self.origin is None: if self.origin is None:
self.set_origin(point) self.set_origin(point)
@@ -3594,13 +3597,15 @@ class FlatCAMGeoEditor(QtCore.QObject):
self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: " self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
"%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (dx, dy)) "%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (dx, dy))
# ## Utility geometry (animated) if event.button == 1 and event.is_dragging == 1 and isinstance(self.active_tool, FCEraser):
geo = self.active_tool.utility_geometry(data=(x, y)) pass
else:
if isinstance(geo, DrawToolShape) and geo.geo is not None: # ## Utility geometry (animated)
# Remove any previous utility shape geo = self.active_tool.utility_geometry(data=(x, y))
self.tool_shape.clear(update=True) if isinstance(geo, DrawToolShape) and geo.geo is not None:
self.draw_utility_geometry(geo=geo) # Remove any previous utility shape
self.tool_shape.clear(update=True)
self.draw_utility_geometry(geo=geo)
# ## Selection area on canvas section ### # ## Selection area on canvas section ###
dx = pos[0] - self.pos[0] dx = pos[0] - self.pos[0]
@@ -3687,6 +3692,7 @@ class FlatCAMGeoEditor(QtCore.QObject):
self.active_tool.click_release((self.pos[0], self.pos[1])) self.active_tool.click_release((self.pos[0], self.pos[1]))
# self.app.inform.emit(msg) # self.app.inform.emit(msg)
self.replot() self.replot()
except Exception as e: except Exception as e:
log.warning("Error: %s" % str(e)) log.warning("Error: %s" % str(e))
return return

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff