- trying to fix reported bugs

This commit is contained in:
Marius Stanciu
2019-08-11 02:18:32 +03:00
parent 377a811810
commit cf8a277825
9 changed files with 36 additions and 54 deletions

View File

@@ -249,7 +249,7 @@ class Measurement(FlatCAMTool):
if event.button == 1:
pos_canvas = self.canvas.vispy_canvas.translate_coords(event.pos)
# if GRID is active we need to get the snapped positions
if self.app.grid_status():
if self.app.grid_status() == True:
pos = self.app.geo_editor.snap(pos_canvas[0], pos_canvas[1])
else:
pos = pos_canvas[0], pos_canvas[1]
@@ -287,7 +287,7 @@ class Measurement(FlatCAMTool):
def on_mouse_move_meas(self, event):
try: # May fail in case mouse not within axes
pos_canvas = self.app.plotcanvas.vispy_canvas.translate_coords(event.pos)
if self.app.grid_status():
if self.app.grid_status() == True:
pos = self.app.geo_editor.snap(pos_canvas[0], pos_canvas[1])
self.app.app_cursor.enabled = True
# Update cursor

View File

@@ -807,7 +807,7 @@ class ToolPaint(FlatCAMTool, Gerber):
self.app.plotcanvas.vis_disconnect('mouse_press', doit)
pos = self.app.plotcanvas.vispy_canvas.translate_coords(event.pos)
if self.app.grid_status():
if self.app.grid_status() == True:
pos = self.app.geo_editor.snap(pos[0], pos[1])
self.paint_poly(self.paint_obj,
@@ -836,7 +836,7 @@ class ToolPaint(FlatCAMTool, Gerber):
self.app.inform.emit(_("[WARNING_NOTCL] Click the end point of the paint area."))
self.cursor_pos = self.app.plotcanvas.vispy_canvas.translate_coords(event.pos)
if self.app.grid_status():
if self.app.grid_status() == True:
self.cursor_pos = self.app.geo_editor.snap(self.cursor_pos[0], self.cursor_pos[1])
else:
self.app.inform.emit(_("Done."))
@@ -844,7 +844,7 @@ class ToolPaint(FlatCAMTool, Gerber):
self.app.delete_selection_shape()
curr_pos = self.app.plotcanvas.vispy_canvas.translate_coords(event.pos)
if self.app.grid_status():
if self.app.grid_status() == True:
curr_pos = self.app.geo_editor.snap(curr_pos[0], curr_pos[1])
x0, y0 = self.cursor_pos[0], self.cursor_pos[1]
@@ -874,7 +874,7 @@ class ToolPaint(FlatCAMTool, Gerber):
curr_pos = self.app.plotcanvas.vispy_canvas.translate_coords(event.pos)
self.app.app_cursor.enabled = False
if self.app.grid_status():
if self.app.grid_status() == True:
self.app.app_cursor.enabled = True
# Update cursor
curr_pos = self.app.geo_editor.snap(curr_pos[0], curr_pos[1])