- made PlotCanvas class inherit from VisPy Canvas instead of creating an instance of it (work of JP)

This commit is contained in:
Marius Stanciu
2019-08-24 04:45:25 +03:00
committed by Marius
parent 3fe31dec59
commit 0e96be7d9a
12 changed files with 86 additions and 78 deletions

View File

@@ -961,7 +961,7 @@ class ToolPaint(FlatCAMTool, Gerber):
self.app.inform.emit(_("Painting polygon..."))
self.app.plotcanvas.vis_disconnect('mouse_press', doit)
pos = self.app.plotcanvas.vispy_canvas.translate_coords(event.pos)
pos = self.app.plotcanvas.translate_coords(event.pos)
if self.app.grid_status() == True:
pos = self.app.geo_editor.snap(pos[0], pos[1])
@@ -990,14 +990,14 @@ class ToolPaint(FlatCAMTool, Gerber):
self.first_click = True
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)
self.cursor_pos = self.app.plotcanvas.translate_coords(event.pos)
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(_("Zone added. Right click to finish."))
self.app.delete_selection_shape()
curr_pos = self.app.plotcanvas.vispy_canvas.translate_coords(event.pos)
curr_pos = self.app.plotcanvas.translate_coords(event.pos)
if self.app.grid_status() == True:
curr_pos = self.app.geo_editor.snap(curr_pos[0], curr_pos[1])
@@ -1055,7 +1055,7 @@ class ToolPaint(FlatCAMTool, Gerber):
# called on mouse move
def on_mouse_move(event):
curr_pos = self.app.plotcanvas.vispy_canvas.translate_coords(event.pos)
curr_pos = self.app.plotcanvas.translate_coords(event.pos)
self.app.app_cursor.enabled = False
if event.button == 2: