- made PlotCanvas class inherit from VisPy Canvas instead of creating an instance of it (work of JP)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user