From 9777255117fb87c24902279319971326a3544103 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Mon, 6 Sep 2021 04:39:01 +0300 Subject: [PATCH] - in Align Plugin treated a possible exception DivideByZero --- CHANGELOG.md | 1 + appPlugins/ToolAlignObjects.py | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3442aa25..bfcfa52a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ CHANGELOG for FlatCAM beta - remade the CNC Job Object Properties UI - in Etch Compensation Plugin updated the GUI - small UI updates in other Plugins +- in Align Plugin treated a possible exception DivideByZero 5.09.2021 diff --git a/appPlugins/ToolAlignObjects.py b/appPlugins/ToolAlignObjects.py index d6765c32..cb80cc97 100644 --- a/appPlugins/ToolAlignObjects.py +++ b/appPlugins/ToolAlignObjects.py @@ -346,10 +346,13 @@ class AlignObjects(AppTool): (abs(new_start[1] - new_dest[1]) <= (10 ** -self.decimals)) if rotation_not_needed is False: # calculate rotation angle - angle_dest = math.degrees(math.atan(dyd / dxd)) - angle_start = math.degrees(math.atan(dys / dxs)) - angle = angle_dest - angle_start - self.aligned_obj.rotate(angle=angle, point=origin_pt) + try: + angle_dest = math.degrees(math.atan(dyd / dxd)) + angle_start = math.degrees(math.atan(dys / dxs)) + angle = angle_dest - angle_start + self.aligned_obj.rotate(angle=angle, point=origin_pt) + except Exception: + pass def disconnect_cal_events(self): # restore the Grid snapping if it was active before