diff options
author | jaseg <git@jaseg.de> | 2023-04-05 14:15:22 +0200 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2023-04-10 23:57:15 +0200 |
commit | 506f61ae8445a7fed49958a7f75154d957207e0e (patch) | |
tree | 3b1ad24049d5d07e5edd0bf059e53a97073c2cd9 /gerbonara/apertures.py | |
parent | 2f048474266396fb0a9817bbec7aff85588dd8e2 (diff) | |
download | gerbonara-506f61ae8445a7fed49958a7f75154d957207e0e.tar.gz gerbonara-506f61ae8445a7fed49958a7f75154d957207e0e.tar.bz2 gerbonara-506f61ae8445a7fed49958a7f75154d957207e0e.zip |
Fix rectangle aperture rotation
Diffstat (limited to 'gerbonara/apertures.py')
-rw-r--r-- | gerbonara/apertures.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gerbonara/apertures.py b/gerbonara/apertures.py index c792e0a..bdebf50 100644 --- a/gerbonara/apertures.py +++ b/gerbonara/apertures.py @@ -301,13 +301,14 @@ class RectangleAperture(Aperture): return replace(self, w=self.w+2*offset, h=self.h+2*offset, hole_dia=None, hole_rect_h=None) def rotated(self, angle=0): - angle += self.rotation - if math.isclose(angle % math.pi, 0): + self.rotation += angle + if math.isclose(self.rotation % math.pi, 0): + self.rotation = 0 return self - elif math.isclose(angle % math.pi, math.pi/2): + elif math.isclose(self.rotation % math.pi, math.pi/2): return replace(self, w=self.h, h=self.w, **self._rotate_hole_90(), rotation=0) else: # odd angle - return self.to_macro(angle) + return self.to_macro() def scaled(self, scale): return replace(self, |