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-03-31 22:31:19 +0200
commit845224e2d6afef782c5d4206fe1a1b503d37583a (patch)
tree91ce9f1c1275df57a68be5a51846db2d73364b4a /gerbonara/rs274x.py
parent0ae72f315998fc22cace3a6dcb5472720f58b743 (diff)
downloadgerbonara-845224e2d6afef782c5d4206fe1a1b503d37583a.tar.gz
gerbonara-845224e2d6afef782c5d4206fe1a1b503d37583a.tar.bz2
gerbonara-845224e2d6afef782c5d4206fe1a1b503d37583a.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)