- in Distance Plugin, fixed the Snap to center feature to work as intended
This commit is contained in:
@@ -12,6 +12,7 @@ CHANGELOG for FlatCAM Evo beta
|
|||||||
- added ability to change the mouse cursor color on the fly
|
- added ability to change the mouse cursor color on the fly
|
||||||
- in Distance Plugin made sure that the 'big cursor' (when is used) is black in color (visible in most situations)
|
- in Distance Plugin made sure that the 'big cursor' (when is used) is black in color (visible in most situations)
|
||||||
- in Distance Plugin, for the 2D graphic mode activated the utility line
|
- in Distance Plugin, for the 2D graphic mode activated the utility line
|
||||||
|
- in Distance Plugin, fixed the `Snap to center` feature to work as intended
|
||||||
|
|
||||||
28.03.2022
|
28.03.2022
|
||||||
|
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ class Distance(AppTool):
|
|||||||
if self.app.use_3d_engine:
|
if self.app.use_3d_engine:
|
||||||
self.canvas.graph_event_disconnect('mouse_move', self.app.grb_editor.on_canvas_move)
|
self.canvas.graph_event_disconnect('mouse_move', self.app.grb_editor.on_canvas_move)
|
||||||
self.canvas.graph_event_disconnect('mouse_press', self.app.grb_editor.on_canvas_click)
|
self.canvas.graph_event_disconnect('mouse_press', self.app.grb_editor.on_canvas_click)
|
||||||
self.canvas.graph_event_disconnect('mouse_release', self.app.grb_editor.on_grb_click_release)
|
self.canvas.graph_event_disconnect('mouse_release', self.app.grb_editor.on_canvas_click_release)
|
||||||
else:
|
else:
|
||||||
self.canvas.graph_event_disconnect(self.app.grb_editor.mm)
|
self.canvas.graph_event_disconnect(self.app.grb_editor.mm)
|
||||||
self.canvas.graph_event_disconnect(self.app.grb_editor.mp)
|
self.canvas.graph_event_disconnect(self.app.grb_editor.mp)
|
||||||
@@ -302,7 +302,7 @@ class Distance(AppTool):
|
|||||||
self.app.grb_editor.mm = self.canvas.graph_event_connect('mouse_move', self.app.grb_editor.on_canvas_move)
|
self.app.grb_editor.mm = self.canvas.graph_event_connect('mouse_move', self.app.grb_editor.on_canvas_move)
|
||||||
self.app.grb_editor.mp = self.canvas.graph_event_connect('mouse_press', self.app.grb_editor.on_canvas_click)
|
self.app.grb_editor.mp = self.canvas.graph_event_connect('mouse_press', self.app.grb_editor.on_canvas_click)
|
||||||
self.app.grb_editor.mr = self.canvas.graph_event_connect('mouse_release',
|
self.app.grb_editor.mr = self.canvas.graph_event_connect('mouse_release',
|
||||||
self.app.grb_editor.on_grb_click_release)
|
self.app.grb_editor.on_canvas_click_release)
|
||||||
|
|
||||||
# disconnect the mouse/key events from functions of measurement tool
|
# disconnect the mouse/key events from functions of measurement tool
|
||||||
if self.app.use_3d_engine:
|
if self.app.use_3d_engine:
|
||||||
@@ -373,7 +373,7 @@ class Distance(AppTool):
|
|||||||
pos = pos_canvas[0], pos_canvas[1]
|
pos = pos_canvas[0], pos_canvas[1]
|
||||||
else:
|
else:
|
||||||
pos = (pos_canvas[0], pos_canvas[1])
|
pos = (pos_canvas[0], pos_canvas[1])
|
||||||
self.snap_handler(pos)
|
pos = self.snap_handler(pos)
|
||||||
|
|
||||||
self.points.append(pos)
|
self.points.append(pos)
|
||||||
|
|
||||||
@@ -464,7 +464,7 @@ class Distance(AppTool):
|
|||||||
|
|
||||||
# if it's a drill
|
# if it's a drill
|
||||||
if isinstance(closest_shape.geo, MultiLineString):
|
if isinstance(closest_shape.geo, MultiLineString):
|
||||||
radius = closest_shape.geo[0].length / 2.0
|
radius = closest_shape.geo.geoms[0].length / 2.0
|
||||||
center_pt = closest_shape.geo.centroid
|
center_pt = closest_shape.geo.centroid
|
||||||
|
|
||||||
geo_buffered = center_pt.buffer(radius)
|
geo_buffered = center_pt.buffer(radius)
|
||||||
@@ -509,6 +509,7 @@ class Distance(AppTool):
|
|||||||
symbol='++', edge_color='#000000',
|
symbol='++', edge_color='#000000',
|
||||||
edge_width=self.app.options["global_cursor_width"],
|
edge_width=self.app.options["global_cursor_width"],
|
||||||
size=self.app.options["global_cursor_size"])
|
size=self.app.options["global_cursor_size"])
|
||||||
|
return pos
|
||||||
|
|
||||||
def on_multipoint_measurement_changed(self, val):
|
def on_multipoint_measurement_changed(self, val):
|
||||||
if val:
|
if val:
|
||||||
|
|||||||
Reference in New Issue
Block a user