summaryrefslogtreecommitdiff
path: root/gerbonara/rs274x.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-03-31 22:31:19 +0200
committerjaseg <git@jaseg.de>2023-04-10 23:57:15 +0200
commit33a35f796d1efa5233adb3da7483b198f13cb375 (patch)
tree01b13bc686ee427adf9b83a6da91dff41506f0ed /gerbonara/rs274x.py
parent02954407703430dcefba0b165360d201fe8e205c (diff)
downloadgerbonara-33a35f796d1efa5233adb3da7483b198f13cb375.tar.gz
gerbonara-33a35f796d1efa5233adb3da7483b198f13cb375.tar.bz2
gerbonara-33a35f796d1efa5233adb3da7483b198f13cb375.zip
Fix failing tests
Diffstat (limited to 'gerbonara/rs274x.py')
-rw-r--r--gerbonara/rs274x.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/gerbonara/rs274x.py b/gerbonara/rs274x.py
index 5ef93dd..6620f10 100644
--- a/gerbonara/rs274x.py
+++ b/gerbonara/rs274x.py
@@ -544,9 +544,11 @@ class GraphicsState:
yield '%LPD*%' if polarity_dark else '%LPC*%'
def set_aperture(self, aperture):
- if self.aperture != aperture:
+ ap_id = self.aperture_map[id(aperture)]
+ old_ap_id = self.aperture_map.get(id(self.aperture), None)
+ if ap_id != old_ap_id:
self.aperture = aperture
- yield f'D{self.aperture_map[id(aperture)]}*'
+ yield f'D{ap_id}*'
def set_current_point(self, point, unit=None):
point_mm = MM(point[0], unit), MM(point[1], unit)