- fixed Measuring Tool in legacy graphic engine

- fixed Gerber plotting
- fixed Geometry plotting
This commit is contained in:
Marius Stanciu
2019-09-21 13:07:30 +03:00
committed by Marius
parent 01e2755676
commit 9aef293a26
5 changed files with 130 additions and 43 deletions

View File

@@ -284,7 +284,13 @@ class Measurement(FlatCAMTool):
log.debug("Measuring Tool --> mouse click release")
if event.button == 1:
pos_canvas = self.canvas.translate_coords(event.pos)
if self.app.is_legacy is False:
event_pos = event.pos
else:
event_pos = (event.xdata, event.ydata)
pos_canvas = self.canvas.translate_coords(event_pos)
# if GRID is active we need to get the snapped positions
if self.app.grid_status() == True:
pos = self.app.geo_editor.snap(pos_canvas[0], pos_canvas[1])
@@ -323,7 +329,12 @@ class Measurement(FlatCAMTool):
def on_mouse_move_meas(self, event):
try: # May fail in case mouse not within axes
pos_canvas = self.app.plotcanvas.translate_coords(event.pos)
if self.app.is_legacy is False:
event_pos = event.pos
else:
event_pos = (event.xdata, event.ydata)
pos_canvas = self.app.plotcanvas.translate_coords(event_pos)
if self.app.grid_status() == True:
pos = self.app.geo_editor.snap(pos_canvas[0], pos_canvas[1])
# Update cursor