From 550771d10b3cb7ed93138c0923ddc57fd89c4a32 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Mon, 11 Oct 2021 12:07:12 +0300 Subject: [PATCH] - in Markers Plugin: fixed the offset from center functionality --- CHANGELOG.md | 1 + appPlugins/ToolMarkers.py | 14 ++------------ 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83d4eb26..b4542a3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ 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 +- in Markers Plugin: fixed the offset from center functionality 10.10.2021 diff --git a/appPlugins/ToolMarkers.py b/appPlugins/ToolMarkers.py index 09992948..12031408 100644 --- a/appPlugins/ToolMarkers.py +++ b/appPlugins/ToolMarkers.py @@ -378,16 +378,6 @@ class ToolMarkers(AppTool): return return_val - # def offset_location_from_bb_center(self, pt): - # """ - # Will offset a set of x, y coordinates - # from the center of the source object bounding box. - # - # :param pt: x, y coordinates of a location point - # :type pt: tuple - # :return: an offseted point pt from the center of the bounding box - # """ - def offset_values(self, offset_reference=None, offset_x=None, offset_y=None): """ Will offset a set of x, y coordinates depending on the chosen reference @@ -422,8 +412,8 @@ class ToolMarkers(AppTool): return xmin, ymin, xmax, ymax = self.grb_object.bounds() - center_x = xmin + (xmax - xmin) / 2 - center_y = ymin + (ymax - ymin) / 2 + center_x = (xmax - xmin) / 2 + center_y = (ymax - ymin) / 2 offset_x -= center_x offset_y -= center_y