- in Align Plugin treated a possible exception DivideByZero

This commit is contained in:
Marius Stanciu
2021-09-06 04:39:01 +03:00
committed by Marius Stanciu
parent 239cf88a48
commit 9777255117
2 changed files with 8 additions and 4 deletions

View File

@@ -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