From a33fabdd6fb3cbb18c8b4eac17306fe5a983dbd4 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Mon, 11 Oct 2021 00:05:58 +0300 Subject: [PATCH] - in Distance Plugin, after setting the start point of the measurement, moving the mouse will update the end point position --- CHANGELOG.md | 4 ++++ appPlugins/ToolDistance.py | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22492dd7..83d4eb26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ CHANGELOG for FlatCAM beta ================================================= +11.10.2021 + +- in Distance Plugin, after setting the start point of the measurement, moving the mouse will update the end point position + 10.10.2021 - in Markers Plugin replaced the Margin parameters with the Offset parameters that now can be referenced either to the edge of the bounding box (effectively replacing the old Margin parameter) or to the center of the bounding box diff --git a/appPlugins/ToolDistance.py b/appPlugins/ToolDistance.py index 73507b7f..ba4003ef 100644 --- a/appPlugins/ToolDistance.py +++ b/appPlugins/ToolDistance.py @@ -319,7 +319,7 @@ class Distance(AppTool): # mouse click releases will be accepted only if the left button is clicked # this is necessary because right mouse click or middle mouse click # are used for panning on the canvas - log.debug("Distance Tool --> mouse click release") + # log.debug("Distance Tool --> mouse click release") if self.app.is_legacy is False: event_pos = event.pos @@ -517,10 +517,16 @@ class Distance(AppTool): angle = math.degrees(math.atan2(dy, dx)) if angle < 0: angle += 360 - self.ui.angle_entry.set_value('%.*f' % (self.decimals, angle)) + self.ui.angle_entry.set_value(str(self.app.dec_format(angle, self.decimals))) except Exception as e: log.error("Distance.on_mouse_move_meas() -> update utility geometry -> %s" % str(e)) pass + # update the end point value + end_val = ( + self.app.dec_format(pos[0], self.decimals), + self.app.dec_format(pos[1], self.decimals) + ) + self.ui.stop_entry.set_value(str(end_val)) except Exception as e: log.error("Distance.on_mouse_move_meas() --> %s" % str(e))